华为DHCP中继实验配置

华为DHCP中继实验配置

    • 实验目的
    • 配置SW1交换机
    • 配置AR1路由器
    • 配置AR2路由器
    • 配置AR3路由器

实验目的

运用DHCP中继使数据存在AR3中实现全网互通,分担AR1路由器的压力
华为DHCP中继实验配置_第1张图片

配置SW1交换机

[SW1]vlan batch 10 20													##划分vlan
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk							##trunk链路
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all 						##vlan全开放通过
[SW1-GigabitEthernet0/0/1]int e0/0/1
[SW1-Ethernet0/0/1]port link-type access 								##access链路
[SW1-Ethernet0/0/1]port default vlan 10									##划分到vlan10
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]port link-type access 
[SW1-Ethernet0/0/2]port default vlan 20									##划分到vlan20
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]port link-type access 
[SW1-Ethernet0/0/3]port default vlan 10
[SW1-Ethernet0/0/3]int e0/0/4
[SW1-Ethernet0/0/4]port link-type access 
[SW1-Ethernet0/0/4]port default vlan 20

配置AR1路由器

[AR1]dhcp enable 														##开启DHCP
[AR1]int g0/0/2															##进入G0/0/2口
[AR1-GigabitEthernet0/0/2]ip add 10.1.1.1 24							##配置IP
[AR1]int g0/0/1
[AR1-GigabitEthernet0/0/1]ip add 11.2.2.1 24
[AR1]int g0/0/0.10														##进入子接口
[AR1-GigabitEthernet0/0/0.10]dot1q termination vid 10					##VLAN10加入子接口
[AR1-GigabitEthernet0/0/0.10]ip address 192.168.10.1 24					##配置子接口网关ip
[AR1-GigabitEthernet0/0/0.10]arp broadcast enable						##开启ARP广播
[AR1-GigabitEthernet0/0/0.10]dhcp select relay 							##中继选择
[AR1-GigabitEthernet0/0/0.10]dhcp relay server-ip 10.1.1.2				##选择中继的接口IP
[AR1-GigabitEthernet0/0/0.10]int g0/0/0.20
[AR1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[AR1-GigabitEthernet0/0/0.20]ip address 192.168.20.1 24
[AR1-GigabitEthernet0/0/0.20]arp broadcast enable
[AR1-GigabitEthernet0/0/0.20]dhcp select relay
[AR1-GigabitEthernet0/0/0.20]dhcp relay server-ip 10.1.1.2	
[AR1]ip route-static 0.0.0.0 0.0.0.0 11.2.2.2 							##向上指默认路由

配置AR2路由器

[AR2]dhcp enable
[AR2]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 11.2.2.2 24
[AR2-GigabitEthernet0/0/1]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 14.4.4.1 24
[AR2-GigabitEthernet0/0/0]dhcp select relay
[AR2-GigabitEthernet0/0/0]dhcp relay server-ip 10.1.1.2
[AR2]ip route-static 14.4.4.0 24 11.2.2.1								##向下指静态路由
[AR2]ip route-static 192.168.10.0 24 11.2.2.1
[AR2]ip route-static 192.168.20.0 24 11.2.2.1

配置AR3路由器

[AR3]dhcp enable
[AR3]int g0/0/2
[AR3-GigabitEthernet0/0/2]ip add 10.1.1.2 24
[AR3]ip pool dhcp14.4.4.0												##进入地址池接口
[AR3-ip-pool-dhcp14.4.4.0]network 14.4.4.0 mask 24						##网段和子网掩码
[AR3-ip-pool-dhcp14.4.4.0]gateway-list 14.4.4.1							##网关
[AR3-ip-pool-dhcp14.4.4.0]dns-list 8.8.8.8 2.2.2.2								##DNS服务器
[AR3-ip-pool-dhcp14.4.4.0]static-bind ip-address 14.4.4.66 mac-address 5489-9858-27A0##给PC5配置自动获取的固定IP
[AR3]ip pool dhcpvlan10
[AR3-ip-pool-dhcpvlan10]network 192.168.10.0 mask 24
[AR3-ip-pool-dhcpvlan10]gateway-list 192.168.10.1
[AR3-ip-pool-dhcpvlan10]dns-list 8.8.8.8 2.2.2.2
[AR3]ip pool dhcpvlan20
[AR3-ip-pool-dhcpvlan20]network 192.168.20.0 mask 24
[AR3-ip-pool-dhcpvlan20]gateway-list 192.168.20.1
[AR3-ip-pool-dhcpvlan20]dns-list 8.8.8.8 2.2.2.2
[AR3]int g0/0/2
[AR3]dhcp select global
[AR3]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1

最后获取IP成功
华为DHCP中继实验配置_第2张图片
华为DHCP中继实验配置_第3张图片
如果有错误的地方,欢迎评论,我加以改正。

你可能感兴趣的:(网络)