Get the App
SLTechnology News&Howtos  ›  Servers  › 

DHCP trunk link assignment ip interworking between different vlan pc

Shulou Source: shulou.com Published: 2022-06-02 23:29:27 09月11日 Update

Lab Topology:

3. Experimental requirements: configure trunk link between switches configure routing function of layer 3 switch configure DHCP trunk link 4 PCs automatically obtain address backup link 4 from DHCP server. Experimental procedure

First change the ip address acquisition mode of PC to dhcp mode.

Configure switch sw1,sw2,sw3,sw4

Establish vlan10,vlan20,vlan30,vlan40

Switch (config) # vlan 10, other same configuration

Configure access Link

Sw1:01 and port 02:

Switch (config-if) # switchport mode access

Switch (config-if) # switchport access vlan 10

Sw2: 01 and 02 ports:

Switch (config-if) # switchport mode access

Switch (config-if) # switchport access vlan 10

Configure trunk Link

Port 03 04 05 of Sw1,sw2 and all ports of sw3,sw4de are configured with trunk links

Sw1:03 04 05 port:

Switch (config-if) # switchport mode trunk

Switch (config-if) # switchport trunk allowed vlan all

Everything else is configured with the same trunk link.

Configure layer 3 switches:

Set up vlan10,20,30,40 and configure SVI with ip address

Switch (config) # vlan 10

Switch (config) # interface vlan 10

Switch (config-if) # no shutdown

Switch (config-if) # ip add 192.168.10.254 255.255.255.0

SVI of other vlan is also configured with ip address

Vlan 20 SVI ip:192.168.20.254 255.255.255.0

Vlan 30 SVI ip:192.168.30.254 255.255.255.0

Vlan 40 SVI ip:192.168.40.254 255.255.255.0

Configure forwarding commands in each vlan:

Switch (config) # interface vlan 10

Switch (config-if) # ip helper-address 192.168.60.1 (points to the DHCP server ip address)

The same configuration commands for SVI in other vlan

Go to port 0ax 3 to configure the ip address:

Switch (config) # interface fastethernet 0amp 3

Switch (config-if) # no shutdown

Switch (config-if) # no switchport (shut down the switch port)

Switch (config-if) # ip address 192.168.50.1 255.255.255.0

Configure the next hop:

Switch (config) # ip route 192.168.60.0 255.255.255.0 192.168.50.2

At this time, because the ip address of the routing interface has not been configured, it does not appear in the routing table of the layer 3 switch (the destination address is reachable, so it will be displayed in the routing table).

Configure the router:

Gi 0ax 0 port: Router (config) # interface gigabitethernet 0Universe 0

Router (config-if) # no shutdown

Router (config-if) # ip address 192.168.50.2 255.255.255.0 (to be the same as the next hop destination ip that was previously configured with layer 3 switch routing)

Gi 0ax 1 port: Router (config) # interface gigabitethernet 0max 1

Router (config-if) # no shutdown

Router (config-if) # ip address 192.168.60.254 255.255.255.0 (this is the gateway of the DHCP server)

The network segment of the PC is not directly connected, so configure the next hop of the router:

There is only one path to other network segments, so static routes can be configured, or one by one to the next hop of the PC network segment

Router (config) # ip route 0.0.0.0 0.0.0.0 192.168.50.1 (destination port is fa0/3 of layer 3 switch)

Configure the DHCP server:

Configure ip address and gateway as shown in the figure: *

Configure the ip address pool as shown in the figure:

Remember to turn on DHCP

Verify: turn on the PC and see if you have obtained the ip address

Experimental questions and summary:

* 1. There are many Vlan and corresponding ports, which should be corresponded one by one.

All Trunk links should be configured correctly, layer 2 switches do not need to choose mode, and layer 3 switches should choose mode.

On the Switchport trunk encapsulation dot1q switch sw3,sw4, the vlan needs to establish four layer 3 switches. The next two ports of the layer 3 switch do not need to be set up. The port connected to the route of the layer 3 switch of the trunk switch should be configured with an ip address, and the vlan of the next hop layer 3 switch should be configured with the forwarding command, that is, the trunk link configuration. *

If you have any suggestions, I hope you can put forward them and discuss them together.

Tags: Configuration switch port address route link server mode lab service command target network segment trunk gateway router as shown in figure selection consistency one-to-one correspondence Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux Shulou Information MariaDB vpn