PC8 vlan10 dhcp获取网段:192.168.10.0/24
pc9 vlan20 dhcp 获取网段:192.168.20.0/24
vlan 10 fd
vlan 20 it
1.二层交换机划分vlan
把端口加进vlan里面去
2.三层交换机配置vlan(和二层交换机一样)
Switch(config)#vlan 10Switch(config-vlan)#name fd
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name it
Switch(config-vlan)#exit
Switch(config)#
3.三层交换机配置dhcp
Switch(config)#ip dhcp pool vlan10 #vlan10只是名字Switch(dhcp-config)#network 192.168.10.0 255.255.255.0Switch(dhcp-config)#dns-server 223.5.5.5Switch(dhcp-config)#default-router 192.168.10.254Switch(dhcp-config)#exitSwitch(config)#ip dhcp excluded-address 192.168.10.254 Switch(config)#ip dhcp pool vlan20 #vlan20只是名字Switch(dhcp-config)#network 192.168.20.0 255.255.255.0Switch(dhcp-config)#dns-server 223.5.5.5Switch(dhcp-config)#default-router 192.168.20.254Switch(dhcp-config)#exitSwitch(config)#ip dhcp excluded-address 192.168.20.254
4.三层交换机配置vlan地址
Switch(config)#interface vlan 10Switch(config-if)#ip address 192.168.10.254 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#Switch(config-if)#exitSwitch(config)#interface vlan 20Switch(config-if)#ip address 192.168.20.254 255.255.255.0Switch(config-if)#no shutdown
5.三层交换机开启路由功能
ip routing
6.二层叫交换机的上行接口划分为trunk模式
本文出自 “砖家博客” 博客,请务必保留此出处http://wsxxsl.blog.51cto.com/9085838/1955096