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

Configure DHCP static rout

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

I. configuration steps (configuration on the router)

As shown in the following figure:

(1) # configure the IP address of the interface.

System-view

[H3C] interface g 0/0

[[H3C-GigabitEthernet0/0]] ip address 192.168.1.254 24

[[H3C-GigabitEthernet0/0]] quit

(2) # enable the DHCP service.

[H3C] dhcp enable

(3) # configure IP addresses that do not participate in automatic assignment.

[H3C] dhcp server forbidden-ip 192.168.1.10

[H3C] dhcp server forbidden-ip 192.168.1.254

(4) # configure DHCP address pool 0 and assign IP addresses by dynamic binding.

The assigned network segment is 192.168.1.0 Compact 24, the lease is valid for 10 days, and the DNS server address is 192.168.1.10.

[H3C] dhcp server ip-pool 0

[H3C-dhcp-pool-0] network 192.168.1.0 mask 255.255.255.0

[H3C-dhcp-pool-0] expired day 10

[H3C-dhcp-pool-0] dns-list 192.168.1.10

[H3C-dhcp-pool-0] gateway-list 192.168.1.254

[H3C-dhcp-pool-0] quit

Second, do DHCP relay

The DHCP server is on the router, while there are three VLAN on the SWA, belonging to three different network segments

The request message for DHCP is broadcast, so a relay must be set up on the SWA before it can be delivered to the router.

As shown in the figure:

Configuration step

(1) # configure the router.

System-view

[H3C] interface g 0/0

[[H3C-GigabitEthernet0/0]] ip address 10.1.1.2 30

[[H3C-GigabitEthernet0/0]] quit

Enable the DHCP service.

[H3C] dhcp enable

Configure DHCP address pool 1 to assign addresses to clients from within the 192.168.1.0 Universe 24 network segment.

[H3C] dhcp server ip-pool 1

[H3C-dhcp-pool-0] network 192.168.10.0 mask 255.255.255.0

[H3C-dhcp-pool-0] dns-list 8.8.8.8

[H3C-dhcp-pool-0] gateway-list 192.168.10.254

[H3C-dhcp-pool-0] quit

Configure DHCP address pool 2 to assign addresses to clients from within the 192.168.20.0 tap 24 network segment.

[H3C] dhcp server ip-pool 2

[H3C-dhcp-pool-0] network 192.168.20.0 mask 255.255.255.0

[H3C-dhcp-pool-0] dns-list 8.8.8.8

[H3C-dhcp-pool-0] gateway-list 192.168.20.254

[H3C-dhcp-pool-0] quit

Configure DHCP address pool 3 to assign addresses to clients from within the 192.168.30.0swap 24 network segment.

[H3C] dhcp server ip-pool 3

[H3C-dhcp-pool-0] network 192.168.30.0 mask 255.255.255.0

[H3C-dhcp-pool-0] dns-list 8.8.8.8

[H3C-dhcp-pool-0] gateway-list 192.168.30.254

[H3C-dhcp-pool-0] quit

Configure a static route to the 192.168.0.0ax 16 segment

[H3C] ip route-static 192.168.0.0 16 10.1.1.1

(2) # configure the SWA switch.

Establish the vlan and configure the IP address of each interface.

System-view

[H3C] vlan 10

[H3C-vlan10] quit

[H3C] vlan 20

[H3C-vlan20] quit

[H3C] vlan 30

[H3C-vlan30] quit

[H3C] inter range g 1-0-1 to g 1-0-5

[H3C-if-range] port link-type access

[H3C-if-range] port access vlan 10

[H3C-if-range] quit

[H3C] inter range g 1-0-6 to g 1-0-10

[H3C-if-range] port link-type access

[H3C-if-range] port access vlan 20

[H3C-if-range] quit

[H3C] inter range g 1-0-11 to g 1-0-15

[H3C-if-range] port link-type access

[H3C-if-range] port access vlan 30

[H3C-if-range] quit

[H3C] inter vlan 10

[H3C-Vlan-interface10] ip add 192.168.10.254 24

[H3C-Vlan-interface10] quit

[H3C] inter vlan 20

[H3C-Vlan-interface20] ip add 192.168.20.254 24

[H3C-Vlan-interface20] quit

[H3C] inter vlan 30

[H3C-Vlan-interface30] ip add 192.168.30.254 24

[H3C-Vlan-interface30] quit

[H3C]

[H3C] inter g 1-0-23

[H3C-GigabitEthernet1/0/23] port link-m r

[H3C-GigabitEthernet1/0/23] ip add 10.1.1.1 30

[H3C-GigabitEthernet1/0/23] quit

(3) # configure DHCP trunking (SWA switch)

Enable the DHCP service.

[H3C] dhcp enable

Configure VLAN interface 10 to operate in DHCP trunk mode.

[H3C] interface vlan-interface 10

[H3C-Vlan-interface10] dhcp select relay

Configure the address of the DHCP server.

[H3C-Vlan-interface10] dhcp relay server-address 10.1.1.2

[H3C-Vlan-interface10] quit

Configure VLAN interface 20 to operate in DHCP trunk mode.

[H3C] interface vlan-interface 20

[H3C-Vlan-interface20] dhcp select relay

[H3C-Vlan-interface20] dhcp relay server-address 10.1.1.2

[H3C-Vlan-interface20] quit

Configure VLAN interface 30 to operate in DHCP trunk mode.

[H3C] interface vlan-interface 30

[H3C-Vlan-interface30] dhcp select relay

[H3C-Vlan-interface30] dhcp relay server-address 10.1.1.2

[H3C-Vlan-interface30] quit

The main task is to do DHCP Snooping.

The DHCP server is on the router, while there are three VLAN on the SWA, belonging to three different network segments

The request message for DHCP is broadcast, so a relay must be set up on the SWA before it can be delivered to the router.

Pseudo DHCP Server has been configured to publish the address pool of 172.22.1.1-99 and the gateway 172.22.1.254 DNS 9.9.9

The figure is as follows:

The main task is to do DHCP Snooping.

The DHCP server is on the router, while there are three VLAN on the SWA, belonging to three different network segments

The request message for DHCP is broadcast, so a relay must be set up on the SWA before it can be delivered to the router.

Pseudo DHCP Server has been configured to publish the address pool of 172.22.1.1-99 and the gateway 172.22.1.254 DNS 9.9.9

The figure is as follows:

Configuration step

(1) # configure the router.

System-view

[H3C] interface g 0/0

[[H3C-GigabitEthernet0/0]] ip address 10.1.1.2 30

[[H3C-GigabitEthernet0/0]] quit

Enable the DHCP service.

[H3C] dhcp enable

Configure DHCP address pool 1 to assign addresses to clients from within the 192.168.1.0 Universe 24 network segment.

[H3C] dhcp server ip-pool 1

[H3C-dhcp-pool-0] network 192.168.10.0 mask 255.255.255.0

[H3C-dhcp-pool-0] dns-list 8.8.8.8

[H3C-dhcp-pool-0] gateway-list 192.168.10.254

[H3C-dhcp-pool-0] quit

Configure DHCP address pool 2 to assign addresses to clients from within the 192.168.20.0 tap 24 network segment.

[H3C] dhcp server ip-pool 2

[H3C-dhcp-pool-0] network 192.168.20.0 mask 255.255.255.0

[H3C-dhcp-pool-0] dns-list 8.8.8.8

[H3C-dhcp-pool-0] gateway-list 192.168.20.254

[H3C-dhcp-pool-0] quit

Configure DHCP address pool 3 to assign addresses to clients from within the 192.168.30.0swap 24 network segment.

[H3C] dhcp server ip-pool 3

[H3C-dhcp-pool-0] network 192.168.30.0 mask 255.255.255.0

[H3C-dhcp-pool-0] dns-list 8.8.8.8

[H3C-dhcp-pool-0] gateway-list 192.168.30.254

[H3C-dhcp-pool-0] quit

Configure a static route to the 192.168.0.0ax 16 segment

[H3C] ip route-static 192.168.0.0 16 10.1.1.1

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