ensp_DHCP中继模拟2.0
0x0 拓扑图
- 要求
- 各个主机可以获取DHCP服务
- DHCP服务器有存在两个地址池
0x1 配置指令
- 交换机
- LSW1
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type access
port default vlan 11
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
- LSW2
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type access
port default vlan 11
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
- LSW3
DHCP enable
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/4
port link-type access
port default vlan 12
interface Vlanif12
ip address 192.168.12.1 255.255.255.0 // 开启虚拟接口保持连通性
interface Vlanif10
ip address 192.168.10.1 255.255.255.0 //记住中继不是配置在接口上,应该配置在需要获取DHCP服务的vlan里
dhcp select relay
dhcp relay server-ip 192.168.12.100
interface Vlanif11
ip address 192.168.11.1 255.255.255.0
dhcp select relay
dhcp relay server-ip 192.168.12.100
- AR2
dhcp enable
ip pool dhcp1
gateway-list 192.168.10.1
network 192.168.10.0 mask 255.255.255.0
dns-list 114.114.114.114
ip pool dhcp2
gateway-list 192.168.11.1
network 192.168.11.0 mask 255.255.255.0
dns-list 8.8.8.8
interface GigabitEthernet0/0/1
ip address 192.168.12.100 255.255.255.0
dhcp select global
ip route-static 0.0.0.0 0.0.0.0 192.168.12.1 //回包路由
0x2 连通性测试
- PC2获取地址
- PC5获取地址
- PC3 -> pc2