华为ENSP配置 三层交换机DHCP配置加VLAN划分实验

实验拓扑图如下:

 LSW5三层交换机配置:

#
sysname LSW5
#
vlan batch 10 20
#
dhcp enable
#
ip pool 1
 gateway-list 192.168.1.254
 network 192.168.1.0 mask 255.255.255.0
 dns-list 8.8.8.8
#
ip pool 2
 gateway-list 192.168.2.254
 network 192.168.2.0 mask 255.255.255.0
 dns-list 8.8.8.8
#
interface Vlanif10
 ip address 192.168.1.254 255.255.255.0
 dhcp select global
#
interface Vlanif20
 ip address 192.168.2.254 255.255.255.0
 dhcp select global
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#

 LSW6二层交换机配置:

#
sysname LSW6
#
vlan batch 10 20
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 20
#
interface Ethernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 10 20
#

 LSW7二层交换机配置:

#
sysname LSW7
#
vlan batch 10 20
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 20
#

各pc截图如下,都能通。

 

 

  • 11
    点赞
  • 150
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值