PPPoE server IP address assignment through a remote DHCP server configuration example

Network requirements

As shown in Figure 14, configure the PPPoE server as a DHCP relay agent to relay an IP address from the DHCP server to the host.

Figure 14: Network diagram

Configuration procedure

  1. Configure Router A as the PPPoE server:

    # Configure Virtual-Template 10 to use PAP for authentication and use a DHCP address pool for IP address assignment.

    <RouterA> system-view
    [RouterA] interface virtual-template 10
    [RouterA-Virtual-Template10] ppp authentication-mode pap
    [RouterA-Virtual-Template10] remote address pool pool1
    [RouterA-Virtual-Template10] quit
    

    # Enable the PPPoE server on GigabitEthernet 1/0/1, and bind the interface to Virtual-Template 10.

    [RouterA] interface gigabitethernet 1/0/1
    [RouterA-GigabitEthernet1/0/1] pppoe-server bind virtual-template 10
    [RouterA-GigabitEthernet1/0/1] quit
    

    # Enable DHCP.

    [RouterA] dhcp enable
    

    # Enable recording of relay entries on the relay agent.

    [RouterA] dhcp relay client-information record
    

    # Create DHCP relay address pool pool1.

    [RouterA] dhcp server ip-pool pool1
    

    # Specify a gateway address for the clients in pool1.

    [RouterA-dhcp-pool-pool1] gateway-list 2.2.2.2 export-route
    

    # Specify a DHCP server for pool1.

    [RouterA-dhcp-pool-pool1] remote-server 10.1.1.1
    [RouterA-dhcp-pool-pool1] quit
    

    # Specify an IP address for GigabitEthernet 1/0/2.

    [RouterA] interface gigabitethernet 1/0/2
    [RouterA-GigabitEthernet1/0/2] ip address 10.1.1.2 24
    [RouterA-GigabitEthernet1/0/2] quit
    

    # Create a PPPoE user.

    [RouterA] local-user user1 class network
    [RouterA-luser-network-user1] password simple pass1
    [RouterA-luser-network-user1] service-type ppp
    [RouterA-luser-network-user1] quit
    
  2. Configure Router B as a DHCP server:

    # Enable DHCP.

    <RouterB> system-view
    [RouterB] dhcp enable
    

    # Create DHCP address pool pool1, and specify a primary subnet and a gateway address for DHCP clients.

    [RouterB] dhcp server ip-pool pool1
    [RouterB-dhcp-pool-pool1] network 2.2.2.0 24
    [RouterB-dhcp-pool-pool1] gateway-list 2.2.2.1
    [RouterB-dhcp-pool-pool1] quit
    

    # Specify an IP address for GigabitEthernet 1/0/1.

    [RouterB] interface gigabitethernet 1/0/1
    [RouterB-GigabitEthernet1/0/1] ip address 10.1.1.1 24
    [RouterB-GigabitEthernet1/0/1] quit
    

    # Configure a static route to the PPPoE server.

    [RouterB] ip route-static 2.2.2.0 24 10.1.1.2
    

Verifying the configuration

# Log in to Router A by using username user1 and password pass1.

# Display relay entries on the DHCP relay agent on Router A.

[RouterA] display dhcp relay client-information
Total number of client-information items: 1
Total number of dynamic items: 1
Total number of temporary items: 0
IP address       MAC address      Type        Interface            VPN name
2.2.2.3          00e0-0000-0001   Dynamic     VA1                  N/A

# Display information about the assigned IP addresses on Router B.

[RouterB] display dhcp server ip-in-use
IP address       Client identifier/    Lease expiration      Type
                 Hardware address
2.2.2.3          00e0-0000-0001        Unlimited             Auto(C)

The output shows that Router B has assigned an IP address to the host.