1.图例
2.实验要求
1)全网可达
2)PC通过DHCP获取地址
3.分析
1)在交换机创建两个广播域
2)交换机和PC设置成 access链路 路由设置为trunk链路
3)配置交换机和路由的接口
4.实验配置
4.1.创建两个虚拟域
例LSW1:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname LSW1
[LSW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW1]interface GigabitEthernet 0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type access
[LSW1-GigabitEthernet0/0/1]port default vlan 10
[LSW1-GigabitEthernet0/0/1]q
[LSW1]int g0/0/2
[LSW1-GigabitEthernet0/0/2]port link-type access
[LSW1-GigabitEthernet0/0/2]port default vlan 20
[LSW1-GigabitEthernet0/0/2]q
[LSW1]int g0/0/3
[LSW1-GigabitEthernet0/0/3]port link-type trunk
[LSW1-GigabitEthernet0/0/3]port trunk allow
[LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
[LSW1-GigabitEthernet0/0/3]q
4.1.2 配置结果
LSW1
LSW2
4.2 DHCP配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0.1
[R1-GigabitEthernet0/0/0.1]ip address 192.168.10.1 24
[R1-GigabitEthernet0/0/0.1]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.1]arp broadcast enable
[R1-GigabitEthernet0/0/0.1]q
[R1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]dot1q termination vid 10
[R1-GigabitEthernet0/0/0.2]ip address 192.168.20.1 24
[R1-GigabitEthernet0/0/0.2]arp broadcast enable
[R1-GigabitEthernet0/0/0.2]q
[R1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]ip pool aa
Info: It's successful to create an IP address pool.
[R1-ip-pool-aa]network 192.168.10.0 mask 24
[R1-ip-pool-aa]gateway-list 192.168.10.1
[R1-ip-pool-aa]dns-list 8.8.8.8
[R1-ip-pool-aa]q
[R1]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]dhcp select global
[R1-GigabitEthernet0/0/0.1]q
[R1]ip pool bb
Info: It's successful to create an IP address pool.
[R1-ip-pool-bb]network 192.168.20.0 mask 24
[R1-ip-pool-bb]gateway-list 192.168.20.1
[R1-ip-pool-bb]dns-list 8.8.8.8
[R1-ip-pool-bb]q
[R1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]dhcp select global
[R1-GigabitEthernet0/0/0.2]q
4.2.2 结果
4.3 全网可达