Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

DHCP Relay Agent [Huawei eNSP]

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

The DHCPRelay (DHCPR) DHCP relay is also called the DHCP relay agent. If the DHCP client is on the same physical network segment as the DHCP server, the client can correctly obtain the dynamically assigned ip address. If you are not on the same physical network segment, DHCP Relay Agent (Relay Agent) is required. Using DHCP Relay agent can eliminate the need for a DHCP server in every physical network segment, it can pass messages to DHCP servers that are not in the same physical subnet, or it can send messages back to DHCP clients that are not in the same physical subnet.

Lab requirements:

C1, C2 and C3 belong to different VLAN, which is VLAN10,20,30

Layer 3 switching realizes interworking between PC, and obtains IP address in R2 through dhcp relay agent.

R2 starts the dhcp service to assign IP addresses to PC

The steps of the experiment:

Used in the experiment: HUAWEI eNsp

1.LSW2 switches add VLAN10 in batches, 20 configuration Ethernet 0swap 3 VLAN10 let PC1 belong to VLAN10; configuration Ethernet 0peg 4 PC2 belongs to VLAN20 configuration Ethernet 0Unique 2 trunk port

Sy / / privileged mode

Enter system view, return user view with Ctrl+Z.

[Huawei] vlan bat 10 20 / / add VLAN10,20 in batch

Info: This operation may take a few seconds. Please wait for a moment...done.

Mar 31 2016 19:12:26-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5

.25.191.3.1 configurations have been changed. The current change number is 4, th

E change loop count is 0, and the maximum number of records is 4095.

[Huawei] int e0Compact 3 / / enter the GigabitEthernet0/0/3 physical interface

[Huawei-Ethernet0/0/3] port link-type access / / is set as access port

[Huawei-Ethernet0/0/3] port default vlan 10 / / added as VLAN10

[Huawei-Ethernet0/0/3] int e0Compact 4 / / enter the GigabitEthernet0/0/4 physical interface

[Huawei-Ethernet0/0/4] port link-type access / / is set as access port

[Huawei-Ethernet0/0/4] port default vlan 20 / / added as VLAN20

[Huawei-Ethernet0/0/4] int e0Compact 2 / / enter the GigabitEthernet0/0/2 physical interface

[Huawei-Ethernet0/0/2] port link-type trunk / / is set to trunk port

[Huawei-Ethernet0/0/2] port trunk allow-pass vlan 10 20 / / allow traffic from VLAN10,20 members to pass through

2.LSW1 batch add VLAN10,20 configuration VLAN10,20,30 IP address is PC gateway address and subnet mask add VLAN100 set IP address for GigabitEthernet0/0/1 to achieve upper port interconnection set static route all IP addresses forward to 10.0.0.2 enable dhcp function and set dhcp relay

Sy / / privileged mode

[Huawei] vlan bat 10 20 / / add VLAN10,20 in batch

Info: This operation may take a few seconds. Please wait for a moment...done.

[Huawei] int vlan 10 / / enter the VLAN10 interface

[Huawei-Vlanif10] ip add 192.168.1.1 24 / / configure IP address and subnet mask

[Huawei-Vlanif10] q

[Huawei] int vlan 20 / / enter the VLAN20 interface

[Huawei-Vlanif20]

Mar 31 2016 19:18:31-08:00 Huawei% IFNET/4/IF_STATE (l) [3]: Interface Vlanif20

Has turned into UP state.

[Huawei-Vlanif20] ip add 192.168.2.1 24 / / configure IP address and subnet mask

[Huawei-Vlanif20] q

[Huawei] int vlan 30 / / enter the VLAN30 interface

[Huawei-Vlanif30]

Mar 31 2016 19:18:48-08:00 Huawei% IFNET/4/IF_STATE (l) [5]: Interface Vlanif30

Has turned into UP state.

[Huawei-Vlanif30] ip add 192.168.3.1 24 / / configure IP address and subnet mask

[Huawei-Vlanif30]

Mar 31 2016 19:18:55-08:00 Huawei% IFNET/4/LINK_STATE (l) [6]: The line protocol

IP on the interface Vlanif30 has entered the UP state.

[Huawei] vlan 100 / / create VLAN100

[Huawei-vlan100] int vlan100 / / enter the VLAN100 interface

[Huawei-Vlanif100] ip add 10.0.0.1 24 / / configure IP address and subnet mask

[Huawei] int g0amp 0 / / enter the physical interface of GigabitEthernet0/0/1

[Huawei-GigabitEthernet0/0/1] port link-type access / / sets the interface type to access port

[Huawei-GigabitEthernet0/0/1] port default vlan 100 / / add to VLAN100

[Huawei-GigabitEthernet0/0/1] q

[Huawei] ip route-static 0.0.0.0 0.0.0.0 10.0.0.2 / / configure static rout

[Huawei] q

Ping 12.0.0.3 / Test upper layer interoperability

PING 12.0.0.3: 56 data bytes, press CTRL_C to break

Request time out

Reply from 12.0.0.3: bytes=56 Sequence=2 ttl=254 time=130 ms

Reply from 12.0.0.3: bytes=56 Sequence=3 ttl=254 time=40 ms

Reply from 12.0.0.3: bytes=56 Sequence=4 ttl=254 time=20 ms

Reply from 12.0.0.3: bytes=56 Sequence=5 ttl=254 time=60 ms

[Huawei] dhcp enable / / enable dhcp service

Info: The operation may take a few seconds. Please wait for a moment.done.

[Huawei] int vlan 10 / / enter the VLAN10 interface

[Huawei-Vlanif10] dhcp select relay / / configure dhcp Relay

[Huawei-Vlanif10] dhcp relay server-ip 12.0.0.3 / / set the dhcp relay server address

[Huawei-Vlanif10] int vlan 20 / / enter the VLAN20 interface

[Huawei-Vlanif20] dhcp select relay / / configure dhcp Relay

[Huawei-Vlanif20] dhcp relay server-ip 12.0.0.3 / / set the dhcp relay server address

[Huawei-Vlanif20] int vlan 30 / / enter the VLAN30 interface

[Huawei-Vlanif30] dhcp select relay / / configure dhcp Relay

[Huawei-Vlanif30] dhcp relay server-ip 12.0.0.3 / / set the dhcp relay server address

3. Router AR1 configures GigabitEthernet0/0/1 and GigabitEthernet0/0/0 IP addresses to set static routes to realize network interworking.

Sy / / privileged mode

Enter system view, return user view with Ctrl+Z.

[Huawei] int g0amp 0 / / enter the physical interface GigabitEthernet0/0/1

[Huawei-GigabitEthernet0/0/1] ip add 10.0.0.2 24 / / configure IP address and subnet mask

Mar 31 2016 19:19:58-08:00 Huawei% IFNET/4/LINK_STATE (l) [0]: The line protocol

IP on the interface GigabitEthernet0/0/1 has entered the UP state.

[Huawei] int g0ram 0 / / enter interface GigabitEthernet0/0/0

[Huawei-GigabitEthernet0/0/0] ip add 12.0.0.2 24 / / configure IP address and subnet mask

[Huawei-GigabitEthernet0/0/0] q

[Huawei] ip route-static 0.0.0.0 0.0.0.0 12.0.0.3 / / configure static rout

[Huawei] ip route-static 192.168.1.0 255.255.255.0 10.0.0.1

[Huawei] ip route-static 192.168.2.0 255.255.255.0 10.0.0.1

[Huawei] ip route-static 192.168.3.0 255.255.255.0 10.0.0.1

4. Router AR2 configure GigabitEthernet0/0/0 IP address configuration v10, v20, v30 dhcp server assigns IP address to PC, gateway, DNS configure static route to achieve network interconnection interface GigabitEthernet0/0/0 chooses a global address pool for DHCP clients to use

Sy / / privileged mode

Enter system view, return user view with Ctrl+Z.

[Huawei] int g0ram 0 / / enter the physical interface GigabitEthernet0/0/0

[Huawei-GigabitEthernet0/0/0] ip add 12.0.0.3 24 / / configure IP address and subnet mask

Mar 31 2016 19:21:30-08:00 Huawei% IFNET/4/LINK_STATE (l) [0]: The line protocol

IP on the interface GigabitEthernet0/0/0 has entered the UP state.

[Huawei-GigabitEthernet0/0/0] Q / / exit

[Huawei] ip pool v10 / / establish a v10 address pool

Info: It's successful to create an IP address pool.

[Huawei-ip-pool-v10] network 192.168.1.0 mask 24 / / network segment and subnet mask

[Huawei-ip-pool-v10] gateway-list 192.168.1.1 / / Gateway address

[Huawei-ip-pool-v10] dns-list 2.2.2.2 4.4.4.4 / / DNS address

[Huawei-ip-pool-v10] q

[Huawei] ip pool v20 / / establish a v20 address pool

Info: It's successful to create an IP address pool.

[Huawei-ip-pool-v20] network 192.168.2.0 mask 24 / / network segment and subnet mask

[Huawei-ip-pool-v20] gateway-list 192.168.2.1 / / Gateway address

[Huawei-ip-pool-v20] dns-list 2.2.2.2 / / DNS address

[Huawei-ip-pool-v20] q

[Huawei] ip pool v30 / / establish a v30 address pool

Info: It's successful to create an IP address pool.

[Huawei-ip-pool-v30] network 192.168.3.0 mask 24 / / network segment and subnet mask

[Huawei-ip-pool-v30] gateway-list 192.168.3.1 / / Gateway address

[Huawei-ip-pool-v30] dns-list 2.2.2.2 / / DNS address

[Huawei-ip-pool-v30] q

[Huawei] ip route-static 0.0.0.0 0.0.0.0 12.0.0.2 / / set a static rout

[Huawei] dhcp enable / / enable dhcp function

Info: The operation may take a few seconds. Please wait for a moment.done.

[Huawei] int g0ram 0 / / enter the physical interface GigabitEthernet0/0/0

[Huawei-GigabitEthernet0/0/0] dhcp select global / / dhcp Select a global address pool

5. Test PC to obtain IP address, subnet mask, DNS and other information to test the interconnection of the whole network

PC > ipconfig / / PC1 get IP address, subnet mask, DNS and other information

Link local IPv6 address.: fe80::5689:98ff:fe2e:78f6

IPv6 address..: / 128

IPv6 gateway..:::

IPv4 address..: 192.168.1.254

Subnet mask...: 255.255.255.0

Gateway..: 192.168.1.1

Physical address.: 54-89-98-2E-78-F6

DNS server....: 2.2.2.2

4.4.4.4

PC > ipconfig / / PC2 get IP address, subnet mask, DNS and other information

Link local IPv6 address.: fe80::5689:98ff:fe5b:5969

IPv6 address..: / 128

IPv6 gateway..:::

IPv4 address..: 192.168.2.254

Subnet mask...: 255.255.255.0

Gateway..: 192.168.2.1

Physical address.: 54-89-98-5B-59-69

DNS server....: 2.2.2.2

PC > ipconfig / / PC3 get IP address, subnet mask, DNS and other information

Link local IPv6 address.: fe80::5689:98ff:fef1:2fe4

IPv6 address..: / 128

IPv6 gateway..:::

IPv4 address..: 192.168.3.254

Subnet mask...: 255.255.255.0

Gateway..: 192.168.3.1

Physical address.: 54-89-98-F1-2F-E4

DNS server....: 2.2.2.2

PC > ping 192.168.3.254 / / Test PC1 and PC3 connectivity

Ping 192.168.3.254: 32 data bytes, Press Ctrl_C to break

Request timeout!

From 192.168.3.254: bytes=32 seq=2 ttl=127 time=78 ms

From 192.168.3.254: bytes=32 seq=3 ttl=127 time=78 ms

From 192.168.3.254: bytes=32 seq=4 ttl=127 time=47 ms

PC > ping 12.0.0.3 / / Test PC1 and AR2 connectivity

Ping 12.0.0.3: 32 data bytes, Press Ctrl_C to break

From 12.0.0.3: bytes=32 seq=1 ttl=253 time=32 ms

From 12.0.0.3: bytes=32 seq=2 ttl=253 time=32 ms

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report