网络原理(Cisco Packet Tracer)命令总结

模式
一般用户模式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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章