Use the ENSP Huawei simulator to configure the combined experiment of OSPF and network DHCP relay

Let's take a look at our network topology:

This is my approximate network topology:

Let's first configure the interface for the network:

sw2:

[Huawei]un in en
Info: Information center is disabled.
[Huawei]vlan	
[Huawei]sys sw2
[sw2]vlan batch 2 3 4
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]int e	
[sw2]int Eth	
[sw2]int Ethernet0/0/1
[sw2-Ethernet0/0/1]port link-type access 
[sw2-Ethernet0/0/1]port default vlan 2
[sw2-Ethernet0/0/1]int e0/0/2
[sw2-Ethernet0/0/2]port link-type access 
[sw2-Ethernet0/0/2]port default vlan 3
[sw2-Ethernet0/0/2]q
[sw2]
[sw2]vlan batch 2 3 4

Sw1:

<Huawei>
<Huawei>
<Huawei>sys
[Huawei]sys sw1
[sw1]int g	
[sw1]int GigabitEthernet 0/0/2	
[sw1-GigabitEthernet0/0/2]port link-type trunk 
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan all 
[sw1-GigabitEthernet0/0/2]q
[sw1]int g	
[sw1]int GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type access 
[sw1-GigabitEthernet0/0/1]port default vlan 4
Error: The VLAN does not exist.
[sw1-GigabitEthernet0/0/1]q
[sw1]vlan batch 2 3 4
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]int GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type access
[sw1-GigabitEthernet0/0/1]port default vlan 4
[sw1-GigabitEthernet0/0/1]q
[sw1]

After the network interface is configured, we first configure the DHCP relay:

Configuration of Sw1:

[sw1]dh	
[sw1]dhcp en	
[sw1]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[sw1]int v	
[sw1]int Vlanif 2
[sw1-Vlanif2]ip ad 192.168.2.254 24
[sw1-Vlanif2]int v3
[sw1-Vlanif3]ip ad 192.168.3.254 24
[sw1-Vlanif3]int v4
[sw1-Vlanif4]ip ad 192.168.4.254 24
[sw1-Vlanif4]

Configuration of R1:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R1
[R1]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip ad 192.168.4.253 24
[R1-GigabitEthernet0/0/0]q
[R1]ip pool vlan2
Info: It's successful to create an IP address pool.
[R1-ip-pool-vlan2]network 192.168.2.0 mask 24
[R1-ip-pool-vlan2]g	
[R1-ip-pool-vlan2]gateway-list 192.168.2.254
[R1-ip-pool-vlan2]dns-list 114.114.114.114
[R1-ip-pool-vlan2]	
[R1-ip-pool-vlan2]q
[R1]ip poo	
[R1]ip pool v	
[R1]ip pool vlan3
Info: It's successful to create an IP address pool.
[R1-ip-pool-vlan3]network 192.168.3.0 mask 24
[R1-ip-pool-vlan3]g	
[R1-ip-pool-vlan3]gateway-list 192.168.3.254
[R1-ip-pool-vlan3]dnsn	
[R1-ip-pool-vlan3]dns	
[R1-ip-pool-vlan3]dns-list 114.114.114.114
[R1-ip-pool-vlan3]q
[R1]ip pool vlan4
Info: It's successful to create an IP address pool.
[R1-ip-pool-vlan4]netw	
[R1-ip-pool-vlan4]network 192.168.4.0 ma	
[R1-ip-pool-vlan4]network 192.168.4.0 mask 24
[R1-ip-pool-vlan4]g	
[R1-ip-pool-vlan4]gateway-list 192.168.4.254
[R1-ip-pool-vlan4]dns	
[R1-ip-pool-vlan4]dns-list 114.114.114.114
[R1-ip-pool-vlan4]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dh	
[R1-GigabitEthernet0/0/0]dhcp se	
[R1-GigabitEthernet0/0/0]dhcp select g	
[R1-GigabitEthernet0/0/0]dhcp select global 
[R1-GigabitEthernet0/0/0]

Configuration of Sw1:

[sw1]dhcp enable 
[sw1]int Vlanif 2
[sw1-Vlanif2]dhcp select relay 
[sw1-Vlanif2]dhcp relay server-ip 192.168.4.253
[sw1-Vlanif2]q
[sw1]int v	
[sw1]int Vlanif 3
[sw1-Vlanif3]dhcp select relay 
[sw1-Vlanif3]dhcp relay server-ip 192.168.4.253
[sw1-Vlanif3]q
[sw1]

 

 R2 configures OSPF to make the network smooth:

[R1-ospf-2]ar	
[R1-ospf-2]are	
[R1-ospf-2]area 0
[R1-ospf-2-area-0.0.0.0]netw	
[R1-ospf-2-area-0.0.0.0]network 0.0.0.0 0.0.0.0
[R1-ospf-2-area-0.0.0.0]q
[R1-ospf-2]

Sw1 configures OSPF to make the network smooth:

[sw1-Vlanif4]q
[sw1]os	
[sw1]ospf 3
[sw1-ospf-3]are	
[sw1-ospf-3]area 0
[sw1-ospf-3-area-0.0.0.0]netw	
[sw1-ospf-3-area-0.0.0.0]network 0.0.0.0 0.0.0.0
[sw1-ospf-3-area-0.0.0.0]q
[sw1-ospf-3]q
[sw1]

 Result: PC2:

PC1:

 

no problem experiment was successful 

 

Guess you like

Origin blog.csdn.net/qq_62466609/article/details/124843038