19
# Configure GigabitEthernet 1/0/1.100 to terminate packets whose Layer 1 ID is 100 and Layer
2 VLAN ID is 10 or 20.
[ProviderA-GigabitEthernet1/0/1.100] vlan-type dot1q vid 100 second-dot1q 10 20
# Enable GigabitEthernet 1/0/1.100 to transmit broadcast and multicast packets.
[ProviderA-GigabitEthernet1/0/1.100] vlan-termination broadcast enable
# Enable DHCP relay on GigabitEthernet 1/0/1.100 and specify 10.2.1.1 as the DHCP server
address.
[ProviderA-GigabitEthernet1/0/1.100] dhcp select relay
[ProviderA-GigabitEthernet1/0/1.100] dhcp relay server-address 10.2.1.1
# Assign an IP address to GigabitEthernet 1/0/1.100.
[ProviderA-GigabitEthernet1/0/1.100] ip address 192.168.1.1 24
[ProviderA-GigabitEthernet1/0/1.100] quit
# Enable recording of relay entries on the relay agent.
[ProviderA] dhcp relay client-information record
# Assign an IP address to the interface Serial 2/1/0.
[ProviderA] interface serial 2/1/0
[ProviderA-Serial2/1/0] ip address 10.1.1.1 24
[ProviderA-Serial2/1/0] quit
# Configure a static route to the DHCP server.
[ProviderA] ip route-static 10.2.1.1 24 10.1.1.1
2.
Configure the DHCP server Provider B:
# Assign an IP address to the DHCP server.
<ProviderB> system-view
[ProviderB] interface serial 2/1/0
[ProviderB-Serial2/1/0] ip address 10.2.1.1 24
[ProviderB-Serial2/1/0] quit
# Enable DHCP.
[ProviderB] dhcp enable
# Configure an IP address pool on the DHCP server.
[ProviderB] dhcp server ip-pool 1
[ProviderB-dhcp-pool-1] network 192.168.1.0 24
[ProviderB-dhcp-pool-1] gateway-list 192.168.1.1
[ProviderB-dhcp-pool-1] quit
# Configure a static route to GigabitEthernet 1/0/1.100.
[ProviderB] ip route-static 192.168.1.1 24 10.1.1.1
3.
Configure Switch A:
# Configure the uplink port GigabitEthernet 1/0/1 as a trunk port, and assign the port to VLAN
100.
<SwitchA> system-view
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
[SwitchA-GigabitEthernet1/0/1] port trunk permit vlan 100
[SwitchA-GigabitEthernet1/0/1] quit
# Configure the downlink port GigabitEthernet 1/0/2 as a trunk port, and assign the port to
VLANs 10 and 100.
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port link-type trunk
[SwitchA-GigabitEthernet1/0/2] port trunk permit vlan 10 100