interface Ethernet0/0/1 //进入1接口的视图 port link-type access //配置为access模式 port default vlan 10 //配置接口的VLAN
int e0/0/2 p l a p d v 20
interface Ethernet0/0/3 port link-type trunk //配置为trunk模式 port trunk allow-pass vlan 10 20 30 40 //配置接口放行的VLAN
int e0/0/4 p l t p t a v 10 20 30 40
二层交换LSW3配置如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
sys sys sw3
vlan batch 10 20 30 40 interface Ethernet0/0/3 port link-type access port default vlan 30 int e0/0/4 p l a p d v 40 interface Ethernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 20 30 40 int e0/0/2 p l t p t a v 10 20 30 40
dhcp enable // 开启DHCP功能 vlan batch 10 20 30 40 interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 20 30 40 int g0/0/3 p l t p t a v 10 20 30 40
interface Vlanif10 //虚拟一个vlan10接口(需已创建vlan10) ip address 192.168.10.254 255.255.255.0 //为该虚拟接口配置ip地址 dhcp select interface //在该接口上开启DHCP dhcp server dns-list 3.0.0.1 //在该接口DHCP上设定DNS服务地址 int vlanif20 ip add 192.168.20.254 24 dhcp sel int dhcp server dns 3.0.0.1 int vlanif30 ip add 192.168.30.254 24 dhcp sel int dhcp server dns 3.0.0.1 int vlanif40 ip add 192.168.40.254 24 dhcp sel int dhcp server dns 3.0.0.1