cisco 三层交换机
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(和二层交换机一样)
1
2
3
4
5
6
7
|
Switch(config) #vlan 10
Switch(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
1
2
3
4
5
6
7
8
9
10
11
12
13
|
Switch(config) #ip dhcp pool vlan10 #vlan10只是名字
Switch(dhcp-config) #network 192.168.10.0 255.255.255.0
Switch(dhcp-config) #dns-server 223.5.5.5
Switch(dhcp-config) #default-router 192.168.10.254
Switch(dhcp-config) #exit
Switch(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.0
Switch(dhcp-config) #dns-server 223.5.5.5
Switch(dhcp-config) #default-router 192.168.20.254
Switch(dhcp-config) #exit
Switch(config) #ip dhcp excluded-address 192.168.20.254
|
4.三层交换机配置vlan地址
1
2
3
4
5
6
7
8
|
Switch(config) #interface vlan 10
Switch(config- if ) #ip address 192.168.10.254 255.255.255.0
Switch(config- if ) #no shutdown
Switch(config- if ) #
Switch(config- if ) #exit
Switch(config) #interface vlan 20
Switch(config- if ) #ip address 192.168.20.254 255.255.255.0
Switch(config- if ) #no shutdown
|
5.三层交换机开启路由功能
ip routing
6.二层叫交换机的上行接口划分为trunk模式
本文转自 小小三郎1 51CTO博客,原文链接:http://blog.51cto.com/wsxxsl/1955096,如需转载请自行联系原作者