This section describes how to configure an EVC to transmit DHCP relay services in a typical Layer 2 accessing Layer 3 EVC networking scenario.
In Figure 1, the DHCP clients belong to VLAN 100. The CE connects to the PE through a sub-interface. The PE communicates with the DHCP server through a Layer 3 network. To allow the DHCP clients to automatically apply for IP addresses from the DHCP server, create a VBDIF interface on the PE, and configure the DHCP relay function on the VBDIF interface.
<HUAWEI> system-view [~HUAWEI] sysname CE [*HUAWEI] commit [~CE] vlan 100 [*CE-vlan100] quit [*CE] interface gigabitethernet0/1/1 [*CE-GigabitEthernet0/1/1] undo shutdown [*CE-GigabitEthernet0/1/1] portswitch [*CE-GigabitEthernet0/1/1] port link-type access [*CE-GigabitEthernet0/1/1] port default vlan 100 [*CE-GigabitEthernet0/1/1] quit [*CE] interface gigabitethernet0/1/2 [*CE-GigabitEthernet0/1/2] undo shutdown [*CE-GigabitEthernet0/1/2] portswitch [*CE-GigabitEthernet0/1/2] port link-type trunk [*CE-GigabitEthernet0/1/2] port trunk allow-pass vlan 100 [*CE-GigabitEthernet0/1/2] quit [*CE] commit
<HUAWEI> system-view [~HUAWEI] sysname PE [*HUAWEI] commit [~PE] vlan 100 [*PE-vlan100] quit [*PE] bridge-domain 10 [*PE-bd10] quit [*PE] interface gigabitethernet0/1/1.1 mode l2 [*PE-gigabitethernet0/1/1.1] undo shutdown [*PE-gigabitethernet0/1/1.1] encapsulation dot1q vid 100 [*PE-gigabitethernet0/1/1.1] rewrite pop single [*PE-gigabitethernet0/1/1.1] bridge-domain 10 [*PE-gigabitethernet0/1/1.1] quit [*PE] commit [~PE] interface vbdif10 [*PE-vbdif10] ip address 1.1.1.1 255.255.255.0 [*PE-vbdif10] commit
[~PE-vbdif10] dhcp select relay [*PE-vbdif10] ip relay address 2.2.2.2 [*PE-vbdif10] commit
Run the display bridge-domain command on the PE. The command output shows the BD to which the Layer 2 EVC sub-interface is added and the BD status.
[~PE] display bridge-domain -------------------------------------------------------------------------------- MAC_LRN: MAC learning; STAT: Statistics; SPLIT: Split-horizon; BC: Broadcast; MC: Unknown multicast; UC: Unknown unicast; *down: Administratively down; FWD: Forward; DSD: Discard; U: Up; D: Down; -------------------------------------------------------------------------------- BDID Ports -------------------------------------------------------------------------------- 10 Eth0/1/1.1(U) BDID State MAC-LRN STAT BC MC UC SPLIT Description -------------------------------------------------------------------------------- 10 up enable disable FWD FWD FWD disable
Run the display dhcp relay address command on the PE. The command output shows the IP addresses of the DHCP relay agent and DHCP server.
[~PE] display dhcp relay address all
** Vbdif10 DHCP Relay Address **
Dhcp Option Relay Agent IP Server IP
* - 2.2.2.2
PE configuration file
#
sysname PE
#
vlan batch 100
#
bridge-domain 10
#
interface Vbdif10
ip address 1.1.1.1 255.255.255.0
dhcp select relay
ip relay address 2.2.2.2
#
interface Ethernet0/1/1.1 mode l2
encapsulation dot1q vid 100
rewrite pop single
bridge-domain 10
#
CE configuration file
# sysname CE # vlan batch 100 # interface Ethernet0/1/1 portswitch undo shutdown port link-type access port default vlan 100 # interface Ethernet0/1/2 portswitch undo shutdown port link-type trunk port trunk allow-pass vlan 100 #