模式
一般用戶模式Router>enable
特權模式(所有show和ping命令)Router#configure terminal
全局模式Router(config)#interface (FastEthernet/Serial)x/x
接口模式Router(config-if)#ip address A.B.C.D 255.255.255.0
配置網關IP地址Router(config-if)#no shutdown
配置路由器串口地址
Router(config)#interface Serialx/x
Router(config-if)#clock rate 9600(DCE)
Router(config-if)#ip address A.B.C.D 255.255.255.0
Router(config-if)#no shutdown
配置靜態路由
Router(config)#ip route A.B.C.0 255.255.255.0 逃出接口
靜態缺省路由指向運營商 0.0.0.0 0.0.0.0 逃出接口
路由器命名
Router(config)#hostname xxx
Router(config)#no ip domain-lookup
路由器啓用密碼
Router(config)#enable password xxx
Router(config)#line console 0
Router(config-line)#password yyy
Router(config-line)#login
–user access verification password:yyy
enable–password:xxx 一般登錄特權
NAT技術
Router(config)#ip nat inside source static A.B.C.D A.B.C.D
Router(config)#interface FastEthernetx/x
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#interface Serialx/x
Router(config-if)ip nat outside
ping一下以後有流量通過
Router(config-if)#end
Router#show ip nat translations
VLAN
劃分vlan:
Switch(config)#vlan 編號
Switch#show vlan brief
綁定vlan:
Switch(config)#interface 端口號
Switch(config)#switchport access vlan 編號
配置vlan中繼端口:
Switch(config)#interface 端口號
Switch(config)#switchport mode trunk
Switch#show interface trunk
查看trunk:
show interfa trunk
查看端口狀態:
show interfa 端口名
刪除vlan :
no vlan 序號
跨網段通信(單臂路由)
Router(config)#interface 端口號
Router(config-if)#no shutdown
exit
Router(config)#interface FastEthernetx/x.x
Router(config-if)#encapsulation dot1Q 編號
Router(config-if)#ip address A.B.C.D 255.255.255.0
和Router相連的Switch的接口
Switch(config)#interface 端口
Switch(config-if)#switchport mode trunk
Router#show ip route
Router#show ip interface
Router#show running-config
Router#ping A.B.C.D
————————————————
版權聲明:本文爲CSDN博主「skybelle」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/skybelle/article/details/37724171