码迷,mamicode.com
首页 > 其他好文 > 详细

三层交换机为不同VLAN自动分配IP地址实现

时间:2018-02-05 21:46:33      阅读:414      评论:0      收藏:0      [点我收藏+]

标签:自动分配   图片   images   system   png   添加   efault   电脑   enable   

技术分享图片
需求:3台电脑分别所属不同VLAN,现在需要为它们设置DHCP服务器
实现:先为交换机的各个接口配好连接类型
现在为LSW9交换机开始建立不同网段虚拟网关地址
现在开始为DHCP授权
建立网段池并设置名字为10
给这池子添加网段,子网掩码,网关,DNS
再回到接口并把DHCP设置为全局模式
LSW7
<Huawei>system-view
[Huawei]vlan batch 10 20
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 10
[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 20
[Huawei]interface Ethernet 0/0/3
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all

                LSW8
                <Huawei>system-view 
                [Huawei]vlan batch 30
                [Huawei]interface Ethernet 0/0/1
                [Huawei-Ethernet0/0/1]port link-type trunk
                [Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
                [Huawei-Ethernet0/0/2]]port link-type access
                [Huawei-Ethernet0/0/2]port default vlan 30

                LSW9
                <Huawei>system-view 
                [Huawei]vlan batch 10 20 30
                [Huawei]interface GigabitEthernet 0/0/1
                [Huawei-GigabitEthernet0/0/1]port link-type trunk
                [Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
                [Huawei]in vlan 10
                [Huawei-Vlanif10]ip address 192.168.10.254 24
                [Huawei]in vlan 20
                [Huawei-Vlanif20]ip address 192.168.20.254 24
                [Huawei]in vlan 30
                [Huawei-Vlanif30]ip address 192.168.30.254 24
                [Huawei]dhcp enable
                [Huawei]ip pool 10
                [Huawei-ip-pool-10]network 192.168.10.0 mask 24
                [Huawei-ip-pool-10]gateway-list 192.168.10.254
                [Huawei-ip-pool-10]dns-list 8.8.8.8
                [Huawei]in vlan 10
              [Huawei-Vlanif10]dhcp select global

三层交换机为不同VLAN自动分配IP地址实现

标签:自动分配   图片   images   system   png   添加   efault   电脑   enable   

原文地址:http://blog.51cto.com/13585704/2069176

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!