6
[SwitchB-vlan6] port gigabitEthernet 1/0/3
[SwitchB-vlan6] quit
# Configure GigabitEthernet 1/0/1 as a trunk port, and allow packets from all VLANs to pass
through the trunk port.
[SwitchB] interface gigabitEthernet 1/0/1
[SwitchB-GigabitEthernet1/0/1] port link-type trunk
[SwitchB-GigabitEthernet1/0/1] port trunk permit vlan all
[SwitchB-GigabitEthernet1/0/1] quit
2.
Configure Switch A.
# Enable DHCP.
<SwitchA> system-view
[SwitchA] dhcp enable
# Create VLAN 5, VLAN 6, and VLAN 7, and then assign GigabitEthernet 1/0/2 to VLAN 7.
[SwitchA] vlan 5 to 7
[SwitchA] interface GigabitEthernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port access vlan 7
[SwitchA-GigabitEthernet1/0/2] quit
# Configure GigabitEthernet 1/0/1 as a trunk port, and allow packets from all VLANs to pass
through the trunk port.
[SwitchA] interface gigabitEthernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
[SwitchA-GigabitEthernet1/0/1] port trunk permit vlan all
[SwitchA-GigabitEthernet1/0/1] quit
# Assign an IP address to VLAN 5, VLAN 6, and VLAN 7, respectively.
[SwitchA] interface vlan-interface 5
[SwitchA-Vlan-interface5] ip address 192.168.5.1 255.255.255.0
[SwitchA-Vlan-interface5] quit
[SwitchA] interface vlan-interface 6
[SwitchA-Vlan-interface6] ip address 192.168.6.1 255.255.255.0
[SwitchA-Vlan-interface6] quit
[SwitchA]interface vlan-interface 7
[SwitchA-Vlan-interface7] ip address 192.168.7.1 255.255.255.0
[SwitchA-Vlan-interface7] quit
# Enable the DHCP relay agent mode on VLAN-interface 5.
[SwitchA] interface vlan-interface 5
[SwitchA-Vlan-interface5] dhcp select relay
# Assign IP address 192.168.7.100 to the DHCP server.
[SwitchA-Vlan-interface5] dhcp relay server-address 192.168.7.100
# Enable the DHCP relay agent mode on VLAN-interface 6.
[SwitchA] interface vlan-interface 6
[SwitchA-Vlan-interface6] dhcp select relay
# Assign IP address 192.168.7.100 to the DHCP server.
[SwitchA-Vlan-interface6] dhcp relay server-address 192.168.7.100
3.
Configure DHCP server. Details are not shown.
# Assign IP address 192.168.7.100/24 to the NIC of the DHCP server.
# Configure IP address 192.168.7.1 as the gateway for the DHCP server.
# Make sure the DHCP server can ping 192.168.5.1 and 192.168.6.1.