建立VLAN:服务器
()#vlan 10网络
(-)#name xxxtcp
删除VLAN:ide
()#no vlan 10加密
划分VLAN:spa
()#int_ f_ x/x或int_ ra_ f_ x/x (连续串口)router
(-)#sw_ mo_ ac_dns
(-)#sw_ ac_ vlan x接口
(-)#exitip
生成树协议:
()#Spanning_tree (开启生成树)
()#no Span_ (关闭生成树)
()#Span_ mo_ stp/rstp (配置生成树协议类型)
()#Span_ prio_ xxxxx (配置端口优先级)
()#no Span_ prio_ (恢复到默认值)
#show Span_ (显示生成树状态)
#show span_ int_ fa_ x/x (显示端口生成树协议的状态)
()#sp_ m_ r_ (生成树转快速生成树)
快速生成树:
()#span_
()#span_ mo_ rstp (指定生成树协议类型为rstp)
#show Span_ (验证快速生成树协议已开启)
A ()#span_ prio_ xxxx (指定交换机优先级为xxxx,A为根交换机)
单臂路由:
一.
router()#int_ f_ 0/0.1 (进入子接口)
(-)#enc_ do_ 10 (封装,标记为VLAN10)
(-)#ip add_ x.x.x.x. 255.255.255.x
(-)#int_ f_ 0/0.2 (进入子接口)
(-)#enc_ do_ 20 (封装,标记为VLAN10)
(-)#ip add_ x.x.x.x. 255.255.255.x
()#int_ f_ 0/0
(-)#no shut_
二.
Switch()#int_ f_ 0/1
(- -)#sw_ mo_ trunk
路由器配置:
()#hostname xxx
()#int_ s/f x/x
(-)#ip add_ x.x.x.x 255.255.255.x
(-)#clock rate 64000
(-)#no shut_
三层交换机:
()#hostname xxx
()#ip routing
()#int_ s/f x/x
(-)#no sw_
(-)#ip add_ x.x.x.x 255.255.255.x
(-)#no shut_
#show ip int_ (查看接口状态信息)
#show int_ s/f x/x (查看接口状态信息)
静态路由:
()#ip route 网络编号x.x.x.x 子网掩码255.255.255.x 下一跳地址X.x.x.x
()#no ip route 网络编号x.x.x.x 子网掩码255.255.255.x 下一跳地址X.x.x.x (删 除静态路由)
RIP配置:
()#router rip
(-)#ver_ 2
(-)#net_ 直连的网段x.x.x.0
(-)#no auto_
(-)#exit
OSPF配置:
()#router ospf x
(-)#net_ x.x.x.0 0.0.0.x area x
(-)#no auto_
(-)#exit
RIP中充发布:
()#router rip
(-)#red_ ospf x met_ x (ospf中)
(-)#red_ sta_ met_ x (静态)
(-)#red_ con_ met_ x (直连)
(-)#exit
OSPF中充发布:
()#router ospf x
(-)#red_ rip sub_ (ospf中)
(-)#red_ sta_ sub_ (静态)
(-)#red_ con_ sub_ (直连)
(-)#exit
缺省路由:
()#de originate (RIP和OSPF通用)
()#0.0.0.0 0.0.0.0 下一跳地址
PAP验证:
被验证方:
()#int_ s/f x/x
(-)#enc_ ppp
(-)#ppp pap sent_ 名字 pass_ 0 密码
验证方:
()#username 名字 pass_ 密码
()#int_ s/f x/x
(-)#enc_ ppp
(-)#ppp aut_ pap
CHAP验证:
被验证方:
B()#username A pass_ 密码
B()#int_ s/f x/x
B(-)#enc_ ppp
验证方:
A()#username B pass_ 密码
A()#int_ s/f x/x
A(-)#enc_ ppp
A(-)#ppp aut_ chap
封装广域网协议:
()#int_ s/f x/x
(-)#enc_ ppp或farme-relay或X25 (将接口协议封装为ppp或farme-relay或X25)
(-)#end
#show int_ s/f x/x
静态NAT配置:
定义内外网接口:
()#int_ f x/0
(-)#ip adr x.x.x.x 255.255.255.x
(-)#ip nat outside
()#int_ f x/1
(-)#ip addr x.x.x.x 255.255.255.x
(-)#ip nat inside
创建一对一映射关系:
()#ip nat inside source static x.x.x.1 x.x.x.3
()#ip nat inside source static x.x.x.2 x.x.x.4
设置默认路由:
()#ip route 0.0.0.0 0.0.0.0 200.8.7.2
动态NAT配置:
定义内外网接口:
()#int_ f x/0
(-)#ip adr x.x.x.x 255.255.255.x
(-)#ip nat outside
()#int_ f x/1
(-)#ip addr x.x.x.x 255.255.255.x
(-)#ip nat inside
定义访问控制列表:
()#acc_ 10 permit 192.168.1.1 0.0.0.255
定义转换的外网地址池:
()#ip nat pool abc x.x.x.1 x.x.x.10 net_ 255.255.255.0
创建映射关系:
()#ip nat inside source list 10 pool abc
设置默认路由:
()#ip route 0.0.0.0 0.0.0.0 200.8.7.2
端口复用:
静态PAT配置:
定义内外网接口:
()#int_ f x/0
(-)#ip adr x.x.x.x 255.255.255.x
(-)#ip nat outside
()#int_ f x/1
(-)#ip addr x.x.x.x 255.255.255.x
(-)#ip nat inside
创建静态映射关系:
()#ip nat inside source static tcp x.x.x.1 1024 x.x.x.3 1024
()#ip nat inside source static udp x.x.x.2 1024 x.x.x.4 1024
设置默认路由:
()#ip route 0.0.0.0 0.0.0.0 200.8.7.2
动态NAPT配置:
定义内外网接口:
()#int_ f x/0
(-)#ip adr x.x.x.x 255.255.255.x
(-)#ip nat outside
()#int_ f x/1
(-)#ip addr x.x.x.x 255.255.255.x
(-)#ip nat inside
定义内部本地地址范围:
Access_ 10 permit 192.168.1.0 0.0.0.255
定义内部全局地址池
()#ip nat pool abc 200.8.7.3 200.8.7.3 net_ 255.255.255.0
创建映射关系:
()#ip nat inside source list 10 pool abc overload
删除NAT:
()#no ip nat inside source static (删除静态NAT转换)
()#clear ip nat translation (从NAT转换表中清除全部动态表项)
()#clear ip nat translation protocol (从NAT转换表中清除扩展动态转换表项)
NAT验证:
#show ip nat translate (当前NAT转换状况)
#show ip nat statistics (显示转换统计信息)
DHCP配置:
()#ser_ dhcp
()#ip dhcp ex_ 192.168.1.1 192.168.1.5 (排除地址段)
()#ip dhcp pool 名字 (定义地址池)
(-)#net_ 192.168.x.x 255.255.255.0 (服务器分配网段和掩码)
(-)#de_ x.x.x.x (默认网关)
(-)#dns_ 192.168.1.4 (DNS服务)
(-)#opt_ 150 ip 192.168.1.3 (TETP服务)
路由器配置帮助地址:
()#int_ f_ x/x
(-)#ip add_ x.x.x.x 255.255.255.0
(-)#ip help_ x.x.x.x
(-)#no shut_
VTP配置:
()#hostname 名字
()#vtp do_ 名字
()#vtp m_
()#vtp p_ 密码
()#vtp v_ 2
命令加密口令:
()#ser_ pass_ 密码
0/30->255.255.255.252反子网掩码0.0.0.3
0/24->255.255.255.0反子网掩码0.0.0.255
0/28->255.255.255.240反子网掩码0.0.0.15
黑色实线为直通线,黑色虚线为交叉线,同种设备用交叉线,不一样设备用直通线