< Home

dhcpv6 relay source-interface

Function

The dhcpv6 relay source-interface command configures the IPv6 address of an interface as the source IPv6 address of packets.

The undo dhcpv6 relay source-interface command restores the default setting.

By default, the IPv6 address of an interface is not configured as the source IPv6 address of packets.

Format

dhcpv6 relay source-interface interface-type interface-number

undo dhcpv6 relay source-interface

Parameters

Parameter

Description

Value

interface-type interface-number

Specifies the interface type and number.
  • interface-type: specifies the interface type. Currently, only loopback interfaces are supported.
  • interface-number: specifies the interface number.

-

Views

System view, VBDIF interface view, VLANIF interface view, Eth-Trunk interface view, GE interface view, XGE interface view, 25GE interface view, MultiGE interface view, MultiGE sub-interface view, 40GE interface view, 100GE interface view, Eth-Trunk sub-interface view, GE sub-interface view, XGE sub-interface view, 25GE sub-interface view, 40GE sub-interface view, 100GE sub-interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When forwarding packets from a DHCPv6 client, a DHCPv6 relay agent uses the IPv6 address of the packet inbound interface as the source IPv6 address of the packets. Therefore, you need to configure an IPv6 address for each interface on the DHCPv6 relay agent. As a result, the configuration is complex and IPv6 addresses may be wasted. You can run the dhcpv6 relay source-interface interface-type interface-number command on the DHCPv6 relay agent to specify the IPv6 address of the loopback interface as the source IPv6 address of the DHCPv6 relayed packets, simplifying the configuration and saving IPv6 addresses.

In addition, VBDIF interfaces functioning as gateways on distributed gateway devices use the same IPv6 address. If Layer 3 VXLAN gateways are distributed gateways and the IPv6 address is used to communicate with the server, the response packets from the server are forwarded to the incorrect distributed gateways (devices that do not send DHCPv6 request packets). To resolve this issue, you need to run the dhcpv6 relay source-interface interface-type interface-number command on each distributed gateway to specify the IPv6 address of the loopback interface as the source IPv6 address of the DHCPv6 relayed packets for ensuring that response packets from the server can be forwarded to the correct distributed gateways.

Prerequisites

Before you run this command in the system view, the first four conditions must be met. Before you run this command in the interface view, all the following conditions must be met.

  • The device has been enabled to forward IPv6 unicast packets using the ipv6 command.

  • A loopback interface has been created using the interface loopback loopback-number command.

  • An IPv6 address has been configured for the loopback interface using the ipv6 address command.

  • DHCP has been enabled globally using the dhcp enable command.

  • In the interface view:

    • The IPv6 function has been enabled on the interface using the ipv6 enable command.

    • The DHCPv6 relay function has been enabled on the interface using the dhcpv6 relay { destination ipv6-address | interface interface-type interface-number } or dhcpv6 relay server-select group-name command.

Precautions

If an IPv6 address is configured for the inbound interface that receives packets from DHCPv6 clients, the IPv6 address is used as the source IPv6 address of packets.

This command takes effect on all interfaces of the device if it is configured in the system view, and takes effect only on an interface if it is configured in the interface view. If this command is configured in both the interface view and system view, the configuration in the interface view takes effect.

Example

# In the system view, configure the IPv6 address of a loopback interface as the source IPv6 address of packets.

<HUAWEI> system-view
[HUAWEI] ipv6
[HUAWEI] interface loopback 5
[HUAWEI-LoopBack5] ipv6 enable
[HUAWEI-LoopBack5] ipv6 address fc01:1::1/128
[HUAWEI-LoopBack5] quit
[HUAWEI] dhcp enable
[HUAWEI] dhcpv6 relay source-interface loopback 5

# On VLANIF100, configure the IPv6 address of a loopback interface as the source IPv6 address of packets.

<HUAWEI> system-view
[HUAWEI] ipv6
[HUAWEI] interface loopback 5
[HUAWEI-LoopBack5] ipv6 enable
[HUAWEI-LoopBack5] ipv6 address fc01:1::1/128
[HUAWEI-LoopBack5] quit
[HUAWEI] dhcp enable
[HUAWEI] interface Vlanif 100
[HUAWEI-Vlanif100] ipv6 enable
[HUAWEI-Vlanif100] dhcpv6 relay destination fc00:1::1
[HUAWEI-Vlanif100] dhcpv6 relay source-interface loopback 5
# On GE0/0/1, configure the IPv6 address of a loopback interface as the source IPv6 address of packets.
<HUAWEI> system-view
[HUAWEI] ipv6
[HUAWEI] interface loopback 5
[HUAWEI-LoopBack5] ipv6 enable
[HUAWEI-LoopBack5] ipv6 address fc01:1::1/128
[HUAWEI-LoopBack5] quit
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] ipv6 enable
[HUAWEI-GigabitEthernet0/0/1] dhcpv6 relay destination fc00:1::1
[HUAWEI-GigabitEthernet0/0/1] dhcpv6 relay source-interface loopback 5
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >