Vlan设置开始,定义Vlan的名称
vlan database
vlan 10 name Internet
vlan 100 name Server
vlan 101 name Project
vlan 102 name Sales
vlan 103 name Pur
vlan 105 name AccMc
vlan 106 name PlugQc
vlan 107 name DepIqc
vlan 108 name Ma
vlan 110 name cy
vlan 118 name gennex
vlan database
vlan 10 name Internet
vlan 100 name Server
vlan 101 name Project
vlan 102 name Sales
vlan 103 name Pur
vlan 105 name AccMc
vlan 106 name PlugQc
vlan 107 name DepIqc
vlan 108 name Ma
vlan 110 name cy
vlan 118 name gennex
设置完成退出。
配置VLan,IP地址。
conf t
Service dhcp
ip dhcp relay information option
配置VLan,IP地址。
conf t
Service dhcp
ip dhcp relay information option
Int Vlan 10
Ip Address 192.168.100.2 255.255.255.248
No Shut
Ip Address 192.168.100.2 255.255.255.248
No Shut
Int Vlan 100
Ip Address 192.168.0.1 255.255.255.0
No Shut
Int Vlan 101
Ip Address 192.168.1.254 255.255.255.0
No Shut
Int Vlan 102
Ip Address 192.168.2.254 255.255.255.0
No Shut
Int Vlan 103
Ip Address 192.168.3.254 255.255.255.0
No Shut
Int Vlan 105
Ip Address 192.168.5.254 255.255.255.0
No Shut
Int Vlan 106
Ip Address 192.168.6.254 255.255.255.0
No Shut
Int Vlan 107
Ip Address 192.168.7.254 255.255.255.0
No Shut
Int Vlan 108
Ip Address 192.168.8.254 255.255.255.0
No Shut
Ip Address 192.168.0.1 255.255.255.0
No Shut
Int Vlan 101
Ip Address 192.168.1.254 255.255.255.0
No Shut
Int Vlan 102
Ip Address 192.168.2.254 255.255.255.0
No Shut
Int Vlan 103
Ip Address 192.168.3.254 255.255.255.0
No Shut
Int Vlan 105
Ip Address 192.168.5.254 255.255.255.0
No Shut
Int Vlan 106
Ip Address 192.168.6.254 255.255.255.0
No Shut
Int Vlan 107
Ip Address 192.168.7.254 255.255.255.0
No Shut
Int Vlan 108
Ip Address 192.168.8.254 255.255.255.0
No Shut
Int Vlan 110
Ip Address 192.168.11.1 255.255.255.252
No Shut
Int Vlan 118
Ip Address 192.168.18.254 255.255.255.0
No Shut
Ip Address 192.168.11.1 255.255.255.252
No Shut
Int Vlan 118
Ip Address 192.168.18.254 255.255.255.0
No Shut
划分端口:
Interface Range Fa 0/1 - 24
Switchport Mode Access
Spanning-tree Portfast
Interface Range Fa 0/1 - 3
Switchport Access Vlan 10
Interface Range Fa 0/4 - 7
Switchport Access Vlan 100
Interface Range Fa 0/8 - 10
Switchport Access Vlan 101
Interface Range Fa 0/11 - 12
Switchport Access Vlan 102
Interface Range Fa 0/13
Switchport Access Vlan 103
Interface Range Fa 0/14
Switchport Access Vlan 105
Interface Range Fa 0/15
Switchport Access Vlan 106
Interface Range Fa 0/16
Switchport Access Vlan 107
Interface Range Fa 0/17 - 20
Switchport Access Vlan 108
Interface Range Fa 0/23
Switchport Access Vlan 110
Interface Range Fa 0/24
Switchport Access Vlan 118
Switchport Mode Access
Spanning-tree Portfast
Interface Range Fa 0/1 - 3
Switchport Access Vlan 10
Interface Range Fa 0/4 - 7
Switchport Access Vlan 100
Interface Range Fa 0/8 - 10
Switchport Access Vlan 101
Interface Range Fa 0/11 - 12
Switchport Access Vlan 102
Interface Range Fa 0/13
Switchport Access Vlan 103
Interface Range Fa 0/14
Switchport Access Vlan 105
Interface Range Fa 0/15
Switchport Access Vlan 106
Interface Range Fa 0/16
Switchport Access Vlan 107
Interface Range Fa 0/17 - 20
Switchport Access Vlan 108
Interface Range Fa 0/23
Switchport Access Vlan 110
Interface Range Fa 0/24
Switchport Access Vlan 118
配置DHCP中继
int vlan100
ip helper-address 192.168.0.254
int vlan101
ip helper-address 192.168.0.254
int vlan102
ip helper-address 192.168.0.254
int vlan103
ip helper-address 192.168.0.254
int vlan105
ip helper-address 192.168.0.254
int vlan106
ip helper-address 192.168.0.254
int vlan107
ip helper-address 192.168.0.254
int vlan108
ip helper-address 192.168.0.254
int vlan110
ip helper-address 192.168.0.254
int vlan118
ip helper-address 192.168.0.254
int vlan100
ip helper-address 192.168.0.254
int vlan101
ip helper-address 192.168.0.254
int vlan102
ip helper-address 192.168.0.254
int vlan103
ip helper-address 192.168.0.254
int vlan105
ip helper-address 192.168.0.254
int vlan106
ip helper-address 192.168.0.254
int vlan107
ip helper-address 192.168.0.254
int vlan108
ip helper-address 192.168.0.254
int vlan110
ip helper-address 192.168.0.254
int vlan118
ip helper-address 192.168.0.254
配置路由
ip routing
ip routing
ip route 0.0.0.0 0.0.0.0 192.168.100.1
以下是写道路由器上的回执路由
路由器地址为192.168.100.1
ip route 192.168.0.0 255.255.0.0 192.168.100.2
ip route 0.0.0.0 0.0.0.0 202.104.*.* <----运营商给的网关地址。(补充)
ip route 192.168.0.0 255.255.0.0 192.168.100.2
这个语句要在路由器里配置。这样交换机和路由器才能相互通讯!
需要在交换机上指定DHCP服务器的地址!
需要在交换机上指定DHCP服务器的地址!
配置DHCP中继
int vlan100
ip helper-address 192.168.0.254 //-- DHCP服务器的地址!
int vlan100
ip helper-address 192.168.0.254 //-- DHCP服务器的地址!
以上配置在CISCO 2600 + CISCO 3550 上调试成功。
转载于:https://blog.51cto.com/jt00278/268879