交换机
1.声明vlan and给vlan分配IP
vlan [编号] //vlan 10
Sw I e 0/0/[编号-编号] //sw I e 0/0/1-10s
in vlan [编号] //in vlan 10
ip add [IP地址] [子网掩码] //ip add 192.168.1.1 255.255.255.0
2.静态路由
Ip route 0.0.0.0 0.0.0.0 [下一跳IP] //ip route 0.0.0.0 0.0.0.0 192.168.1.2
3.RIP协议路由
以Vlan方法
Router rip
Network [自己的vlan ] //network vlan 10
以IP方法
Router rip
Network [ip 段]
4.ospf协议路由
以Vlan方法
Router ospf
Int vlan [编号] //int vlan 10
Ip ospf enable area [编号] //ip ospf enable area 0
以IP方法
Router ospf
Network [自己的IP]/[网关] area 0 //network 192.168.1.1/24 area 0
5.telnet开启
telnet-server enable
telnet-user [用户] password 0 [密码]
6.stp生成树协议
spanning-tree mode stp
7.链路聚合(手工)
spanning-tree mode mstp //开启mstp生成树协议
port-group [编号] // port-group 1
int e 0/0/[做链路的那几个端口号] //int 0/0/1-2
port-group [编号] mode on // port-group 1 mode on
8. 链路聚合(LACP动态生成)
spanning-tree mode mstp
port-group [编号]
(交换机A的配置)port-group [编号] mode active
(交换机B的配置)port-group [编号] mode passive
9.trunk
Int e 0/0/[端口]
Sw mode trunk //设置为trunk
Sw trunk allowed vlan all //划分到所有vlan
10.Mac地址和端口绑定(单个)
Int e 0/0/[端口]
Sw port-security
sw port-security mac-address [mac地址]
11. Mac地址和端口绑定(多个)
Int e 0/0/[端口]
Sw port-security maximum [安全mac地址个数如:3]
sw port-security mac-address [mac地址]
sw port-security mac-address [mac地址]
sw port-security mac-address [mac地址]
12. Mac地址和端口绑定(动态学习)
Int e 0/0/[端口]
Sw port-security maximum
Sw port-security maximum lock
Sw port-security maximum convert
13.mac地址表绑定
mac-address-table static address [mac地址] vlan [编号] int e 0/0/[编号]
//解释: 让mac地址只能在指定vlan中的指定端口中使用,其他的都不能使用(未测试)
14.mac地址过滤
mac-address-table blackhole address [mac地址] vlan [编号]
//解释: 让mac地址在指定vlan中不能使用(未测试)
15.用am来绑定ip和mac
Am enable
Int e 0/0/[端口]
Am mac-ip-pool [mac地址] [IP地址]
//验证方法: show am
//解锁:no am port
16.dhcp配置
Service dhcp
Ip dhcp pool [地址池名]
Network-address [IP段如:192.168.1.0] [掩码数如:24]
Lease [租用天数]
Default-router [网关IP]
Dns-server [DNS 的IP]
⊙该文章转自[大赛人网站(技能大赛技术资源网)-DasaiRen.com] 原文链接:http://www.dasairen.com/Article/wlsb/dcnetworks/569.html