switch>enable
switch#config terminal
switch(config)#hostname <hostname>
switch(config)#enable secret xxx
switch(config)#enable password xxx
switch(config)#line console 0
switch(config-line)#line vty 0 4
switch(config-line)#login
switch(config-line)#password xx
switch#exit
switch#vlan database
switch(vlan)#vlan 2
switch(vlan)#no vlan 2
switch(config)#int f0/1
switch(config-if)#switchport access vlan 2
switch(config-if)#switchport mode trunk
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan
switch(config-if)#switchport trunk encap dot1q
switch(config)#vtp domain <name>
switch(config)#vtp password <word>
switch(config)#vtp mode server
switch(config)#vtp mode client
switch(config)#interface vlan 1
switch(config-if)#ip address <IP> <mask>
switch(config)#ip default-gateway <IP>
switch#dir flash:
switch#write
switch#show vtp
switch#show run
switch#show vlan
switch#show interface
switch#show int f0/0
路由器显示命令:
router#show run
router#show interface
router#show ip route
router#show cdp nei
router#reload
router>enable
router#config terminal
router(config)#hostname <hostname>
router(config)#enable secret xxx
router(config)#enable password xxx
router(config)#line console 0
router(config-line)#line vty 0 4
router(config-line)#login
router(config-line)#password xx
router(config)# (Ctrl+z)
router#exit
router(config)#int s0/0
router(config-if)#no shutdown
router(config-if)#clock rate 64000
router(config-if)#ip address 10.1.1.1 255.255.0.0
router(config-if)#ip add 10.1.1.2 255.255.0.0 second;
router(config-if)#int f0/0.1
router(config-subif.1)#ip address <ip><netmask>
router(config-subif.1)#encapsulation dot1q <n>
router(config)#config-register 0x2142
router(config)#config-register 0x2102
router#reload
router#copy running-config startup-config
router#copy running-config tftp
router#copy startup-config tftp
router#copy tftp flash:
router#copy tftp startup-config
Ctrl+Break
rommon>confreg 0x2142
rommon>confreg 0x2102
rommon>reset
rommon>copy xmodem:<sname> flash:<dname>
rommon>IP_SUBNET_MASK=255.255.0.0
rommon>TFTP_SERVER=10.65.1.1
rommon>TFTP_FILE=c2600.bin
rommon>tftpdnld
rommon>dir flash:
rommon>boot
ip route <ip-address> <subnet-mask> <gateway>
router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2
router(config)#ip routing
router(config)#router rip
router(config-router)#network <netid>
router(config-router)#negihbor <ip-address>
router(config)# frame-relay switching
router(config-s0)# encapsulation frame-relay
router(config-s0)# frame-relay intf-type DCE
router(config-s0)# frame-relay local-dlci 20
router(config)#access-list <number> permit|deny <source ip> <wild|any>
router(config)#interface <interface>
router(config-if)#ip access-group <number> in|out
RB(config)#access-list 4 permit 10.8.1.1
RB(config)#access-list 4 deny 10.8.1.0 0.0.0.255
RB(config)#access-list 4 permit 10.8.0.0 0.0.255.255
RB(config)#access-list 4 deny 10.0.0.0 0.255.255.255
RB(config)#access-list 4 permit any
RB(config)#int f0/0
RB(config-if)#ip access-group 4 in
扩展访问控制列表:
access-list <number> permit|deny icmp <SourceIP wild> <destinationIP
wild>[type]
access-list <number> permit|deny tcp <SourceIP wild> <destinationIP
wild>[port]
例1:
router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
router(config)#access-list 101 permit ip any any
router(config)#int s0/0
router(config-if)#ip access-group 101 in
router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
router(config)#access-list 102 permit ip any any
router(config)#interface s0/1
router(config-if)#ip access-group 102 out
router(config-if)#no ip access-group 101 in
或write erase
或erase NVROM