1: Experimental environment
1.1: Huawei ensp software
1.2: PC, router and switch
PC in initialization state and router and switch in initialization state
2, Experiment requirements, realize the whole network interworking and DHCP relay on R4
3: Experimental process
3.1: equipment configuration
In the ensp, the PC, router and switch are ready and started.
3.2 configuration ideas
Configure R1
1) Configure interface
Int g0/0/0 ; ip add 12.0.0.1 24 ;un sh Int g0/0/2 ; ip add 14.0.0.1 24 ;un sh
2) Configure single arm routing and relay
dhcp enable #Commands in system view int g0/0/1.10 ; ip add 192.168.10.1; d t v 10 ; a b e; dhcp select relay; #Configure relay mode dhcp relay server-ip 14.0.0.2; #Configure relay address un sh int g0/0/1.20 ; ip add 192.168.20.1; d t v 20 ;a b e;dhcp select relay; dhcp relay server-ip 14.0.0.2; un sh
3) Configure static / default routes
ip route-static 0.0.0.0 0.0.0.0 12.0.0.2
Configure R2
1) Configure interface
int g0/0/0 ip add 12.0.0.2 24 un sh int g0/0/1 ip add 15.0.0.1 24 un sh;q
2) Configure enable relay mode
dhcp enable dhcp select relay dhcp relay server-ip 14.0.0.2 ##Specify relay address
3) Configure static / default route (operator side)
ip route-static 14.0.0.0 24 12.0.0.1 ip route-static 192.168.10.0 24 12.0.0.1 ip route-static 192.168.20.0 24 12.0.0.1
Configure R4 to provide relay service
1) Configure routing interface
Int g0/0/0 Ip add 14.0.0.2 24 un sh
2) Configure DHCP relay service
dhcp enable int g0/0/0 ip add 14.0.0.2 24 dhcp select global #Declare to go to global mode to find the configured DHCP service on the interface undo sh //Configure relay pool, one for each network segment ip pool DHCP15 #Enter DHCP15 and configure the pool of PC5 15 network segment network 15.0.0.0 mask 24 gateway-list 15.0.0.1 dns-list 8.8.8.8 2.2.2.2 excluded-ip-address 15.0.0.100 15.0.0.254 static-bind ip-address 15.0.0.88 mac-address 5489-98C3-6B6F ip pool DHCPvlan10 #Enter DHCPvlan10 to configure the 10.0 segment pool network 192.168.10.0 mask 24 gateway-list 192.168.10.1 dns-list 8.8.8.8 2.2.2.2 ip pool DHCPvlan20 #Enter DHCPvlan20 to configure the 20.0 segment pool network 192.168.20.0 mask 24 gateway-list 192.168.20.1 dns-list 8.8.8.8 2.2.2.2
3) Configure routing
ip route-static 0.0.0.0 0.0.0.0 14.0.0.1
3.3 configure SW1 switch
[SW1] vlan batch 10 20 [SW1] interface Ethernet0/0/1 [SW1-Ethernet0/0/1]port link-type access [SW1-Ethernet0/0/1]port default vlan 10 [SW1-Ethernet0/0/1]un sh [SW1]interface Ethernet0/0/2 [SW1-Ethernet0/0/2]port link-type access [SW1-Ethernet0/0/2]port default vlan 20 [SW1-Ethernet0/0/2]un sh [SW1] interface Ethernet0/0/3 [SW1-Ethernet0/0/3]port link-type access [SW1-Ethernet0/0/3]port default vlan 10 [SW1-Ethernet0/0/3]un sh [SW1]interface Ethernet0/0/4 [SW1-Ethernet0/0/4]port link-type access [SW1-Ethernet0/0/4]port default vlan 20 [SW1-Ethernet0/0/4]un sh [SW1-Ethernet0/0/4]int g0/0/1 [SW1-GigabitEthernet0/0/1]p l t [SW1-GigabitEthernet0/0/1]p t a v a [SW1-GigabitEthernet0/0/1]un sh
3.4 configure R1 router
3.4.1 configure single arm routing
[R1]int g0/0/2 [R1-GigabitEthernet0/0/2]ip add 14.0.0.1 24 [R1-GigabitEthernet0/0/2]un sh [R1-GigabitEthernet0/0/2]int g0/0/0 [R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24 [R1-GigabitEthernet0/0/0]un sh [R1]dhcp enable [R1]int GigabitEthernet 0/0/1.10 [R1-GigabitEthernet0/0/1.10]d t v 10 [R1-GigabitEthernet0/0/1.10]ip address 192.168.10.1 24 [R1-GigabitEthernet0/0/1.10]a b e [R1-GigabitEthernet0/0/1.10]un sh [R1-GigabitEthernet0/0/1.10]int GigabitEthernet 0/0/1.20 [R1-GigabitEthernet0/0/1.20]d t v 20 [R1-GigabitEthernet0/0/1.20]ip address 192.168.20.1 24 [R1-GigabitEthernet0/0/1.20]a b e [R1-GigabitEthernet0/0/1.20]un sh
3.4.2 configure DHCP relay service (specify relay routing address)
[R1-GigabitEthernet0/0/1.20]int GigabitEthernet 0/0/1.10 [R1-GigabitEthernet0/0/1.10]dhcp select relay #Select relay mode [R1-GigabitEthernet0/0/1.10]dhcp relay server-ip 14.0.0.2 [R1-GigabitEthernet0/0/1.10]un sh [R1-GigabitEthernet0/0/1.10]int GigabitEthernet 0/0/1.20 [R1-GigabitEthernet0/0/1.20]dhcp select relay [R1-GigabitEthernet0/0/1.20]dhcp relay server-ip 14.0.0.2 [R1-GigabitEthernet0/0/1.20]un sh
3.4.3 configure static route
[R1]ip route-static 0.0.0.0 0.0.0.0 12.0.0.2
3.5 configure R2 router
3.5.1 configuration interface
[R2]int g0/0/0 [R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24 [R2-GigabitEthernet0/0/0]un sh [R2-GigabitEthernet0/0/0]int g0/0/1 [R2-GigabitEthernet0/0/1]ip add 15.0.0.1 24 [R2-GigabitEthernet0/0/1]un sh
3.5.2 configure relay service
[R2]dhcp enable [R2-GigabitEthernet0/0/1]dhcp select relay [R2-GigabitEthernet0/0/1]dhcp relay server-ip 14.0.0.2 [R2-GigabitEthernet0/0/1]undo sh [R2-GigabitEthernet0/0/1]q
3.5.3 configure route
[R2]ip route-static 14.0.0.0 24 12.0.0.1 [R2]ip route-static 192.168.10.0 24 12.0.0.1 [R2]ip route-static 192.168.20.0 24 12.0.0.1
3.6 configure R4 router
3.6.1 configure routing interface
Int g0/0/0 Ip add 14.0.0.2 24 un sh
3.6.2 configure DHCP relay service
[R4]dhcp enable #System mode claims DHCP enabled [R4]int g0/0/0 [R4-GigabitEthernet0/0/0]ip add 14.0.0.2 24 [R4-GigabitEthernet0/0/0]dhcp select global #Declare to go to global mode to find configured DHCP on the interface
3.6.3 configured DHCP service
[R4-GigabitEthernet0/0/0]undo sh [R4-GigabitEthernet0/0/0]q [R4]ip pool DHCP15 [R4-ip-pool-DHCP15]network 15.0.0.0 mask 24 [R4-ip-pool-DHCP15]gateway-list 15.0.0.1 [R4-ip-pool-DHCP15]dns-list 8.8.8.8 2.2.2.2 [R4-ip-pool-DHCP15]excluded-ip-address 15.0.0.100 15.0.0.254 [R4-ip-pool-DHCP15]static-bind ip-address 15.0.0.88 mac-address 5489-98C3-6B6F #Here, mac address is configured with mac of PC5, and 15.0.0.88 address is configured [R4-ip-pool-DHCP15]dis this ip pool DHCP15 gateway-list 15.0.0.1 network 15.0.0.0 mask 255.255.255.0 static-bind ip-address 15.0.0.88 mac-address 5489-98c3-6b6f excluded-ip-address 15.0.0.100 15.0.0.254 dns-list 8.8.8.8 2.2.2.2 [R4-ip-pool-DHCP15]q [R4]ip pool DHCPvlan10 [R4-ip-pool-DHCPvlan10]network 192.168.10.0 mask 24 [R4-ip-pool-DHCPvlan10]gateway-list 192.168.10.1 [R4-ip-pool-DHCPvlan10]dns-list 8.8.8.8 2.2.2.2 [R4-ip-pool-DHCPvlan10]ip pool DHCPvlan20 [R4-ip-pool-DHCPvlan20]network 192.168.20.0 mask 24 [R4-ip-pool-DHCPvlan20]gateway-list 192.168.20.1 [R4-ip-pool-DHCPvlan20]dns-list 8.8.8.8 2.2.2.2 [R4-ip-pool-DHCPvlan20]q [R4]ip route-static 0.0.0.0 0.0.0.0 14.0.0.1
3.7 check whether the requirements are met
PC5 has obtained the IP of the specified configuration