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

How do I create a DHCP relay to allow my computer to get IP automatically? (turned into)

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Experimental steps and ideas:

one。 Configure the PC with ip first

Pc1:

Ip 192.168.1.1

Subnet mask: 255.255.255.0

Gateway: 192.168.1.254

Pc2:

Ip 192.168.2.1

Subnet mask: 255.255.255.0

Gateway: 192.168.2.254

Pc3:

Ip 192.168.1.2

Subnet mask: 255.255.255.0

Gateway: 192.168.1.254

Pc4:

Ip 192.168.2.2

Subnet mask: 255.255.255.0

Gateway: 192.168.2.254

two。 Create a vlan on lsw8 and join the port

Vlan batch 10 20 create vlan10,20

Interface ge0/0/1 entry port

Port link-type access

Port default vlan10 adds vlan10 to the port

Interface ge0/0/3 entry port

Port link-type access

Port default vlan20 adds vlan20 to the port

Interface ge0/0/2

Port link-type trunk sets the ge0/0/2 port to trunk mode

Port trunk allow-pass vlan all allows all vlan to pass through

three。 Create a vlan on lsw9 and join the port

Vlan batch 10 20 create vlan10,20

Interface ge0/0/1 entry port

Port link-type access

Port default vlan10 adds vlan10 to the port

Interface ge0/0/3 entry port

Port link-type access

Port default vlan20 adds vlan20 to the port

Interface ge0/0/2

Port link-type trunk sets the ge0/0/2 port to trunk mode

Port trunk allow-pass vlan all allows all vlan to pass through

four。 Configure gateway settings trunk on lsw7

Set up the trunk:

Interface ge0/0/2

Port link-type trunk sets the ge0/0/1 port to trunk mode

Port trunk allow-pass vlan all allows all vlan to pass through

Interface ge0/0/2

Port link-type trunk sets the ge0/0/2 port to trunk mode

Port trunk allow-pass vlan all allows all vlan to pass through

Configure the gateway:

Vlan batch 10pr 20 to create vlan10,20

Interface vlan10 enters the virtual port of vlan10

Ip address 192.168.1.254 configure the gateway

Interface vlan20 enters the virtual port of vlan20

Ip address 192.168.2.254 configure the gateway

Because ip cannot be configured under the ge0/0/3 port, create a vlan30 and configure ip on the virtual port.

Vlan30 creates vlan30

Interface vlan 30 enters the virtual port of vlan10

Ip address 192.168.12.1 255.255.255.0 configure ip

five。 Configure ip to set up static routes on the router

Configure ip

Interface ge0/0/0 entry port

Ip address 192.168.12.2 255.255.255.0 configure ip

Set up static routes:

Because the router does not know which network segment to go to when returning the packet, it uses a Class B address to make it contain both 1.0 and 2.0 network segments, and then give it to its next hop 192.168.12.1

Ip rout-static 192.168.0.0 255.255.0.0 192.168.12.1

six。 Verification, test

Use any PC to access other network segments to achieve full Netcom (the prerequisite for creating DHCP)

seven。 Create a pool of DHCP addresses

An address pool can contain only one vlan

Create an address pool for vlan10

Ip pool vlan-10 creates an IP dhcp address pool

Network 192.168.1.0 mask 255.255.255.0 configure network segment

Gateway-list 192.168.1.254 configure the gateway

Dns-list 8.8.8.8 configure the DNS server

Lease day 3 configure lease duration

Create address pool for vlan20 ip pool vlan-20 create IP dhcp address pool; network 192.168.2.0 mask 255.255.255.0 configure network segment; gateway-list 192.168.2.254 configure gateway Dns-list 8.8.8.8 configure DNS server lease day 3 configure lease duration dhcp enable in global mode The virtual port dhcp select global that enables the DHCP service interface vlan10 to enter the vlan10 indicates that when the DHCP message is received on the port, go directly to the DHCP server and select an available IP address from the globally configured IP address pool. The virtual port dhcp select global of interface vlan20 entering vlan20 means that when the DHCP message is received on the port, it goes directly to the DHCP server to select an available IP address from the globally configured IP address pool. Configure trunking on lsw8 (use this technique when the DHCP server and the DHCP client are on different network segments. The DHCP request sent by the DHCP client can be forwarded to the DHCP server in a "unicast" manner.) Dhcp enable opens the DHCP service interface vlan10 in global mode to enter the virtual side of vlan10 dhcp select relay dhcp relay server-ip 192.168.20.1 this address represents the DHCP server address interface vlan 20 Enter vlan10's virtual port dhcp select relay dhcp relay server-ip 192.168.20.1 this address represents the DHCP server address 9. Verify, test, save set the PC to DHCP mode, as follows:

Then enter ipconfig on the command line in the PC, and the effect is as follows:

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

Servers

Wechat

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

12
Report