[Edgecore SONiC] DHCP Relay Follow
Tested model & firmware version:
- Switch model name:
AS7726-32X
- Edgecore SONiC version:
202012.2
Topology:
Pre-configuration:
- 202012 branch
- Ethernet4 breakout to 4x10G.(refer Dynamic Port Breakout)
admin@sonic:~$ show interface status Ethernet4-7
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC Oper Speed
----------- ------- ------- ----- ----- ------------- ------ ------ ------- -------------- ---------- ------------
Ethernet4 5 10G 9100 none Eth2/1(Port2) trunk up up QSFP+ or later N/A 10G
Ethernet5 6 10G 9100 none Eth2/2(Port2) trunk up up QSFP+ or later N/A 10G
Ethernet6 7 10G 9100 none Eth2/3(Port2) routed up up QSFP+ or later N/A 10G
Ethernet7 8 10G 9100 none Eth2/4(Port2) routed down up QSFP+ or later N/A 10G
- VLAN configuration is as topology.(refer to VLAN & Inter-VLAN Routing)
admin@sonic:~$ show vlan brief
+-----------+--------------+-----------+----------------+---------------+---------------+-------------+-------------+
| VLAN ID | IP Address | Ports | Port Tagging | DHCP Helper | DHCP Source | DHCP Link | Proxy ARP |
| | | | | Address | Interface | Selection | |
+===========+==============+===========+================+===============+===============+=============+=============+
| 10 | | Ethernet4 | untagged | | | | disabled |
+-----------+--------------+-----------+----------------+---------------+---------------+-------------+-------------+
| 20 | | Ethernet5 | untagged | | | | disabled |
+-----------+--------------+-----------+----------------+---------------+---------------+-------------+-------------+
- IP binding is as topology.(refer to Management and front port IPv4/IPv6 Address)
admin@sonic:~$ show ip interfaces
Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP
----------- -------- ------------------- ------------ -------------- -------------
Loopback0 1.1.1.1/32 up/up N/A N/A
Vlan10 192.168.10.1/24 up/up N/A N/A
Vlan20 192.168.20.1/24 up/up N/A N/A
docker0 240.127.1.1/24 up/down N/A N/A
eth0 192.168.254.1/24 up/up N/A N/A
lo 127.0.0.1/16 up/up N/A N/A
Expect result:
DHCP client will get IP from DHCP server. DHCP server will get DHCP request from DHCP client which source IP is Loopback interface IP.
Procedure:
Steps 1. Modify the type of DEVICE_METADATA to "ToRRouter" in /etc/sonic/config_db.json.
admin@sonic:~$ sudo sed -i 's/LeafRouter/ToRRouter/g' /etc/sonic/config_db.json
Steps 2. Reboot device to apply the configuration.
admin@sonic:~$ sudo reboot
Steps 3. Enable DHCP relay on VLAN10
admin@sonic:~$ sudo config vlan dhcp_relay add 10 192.168.20.100
Added DHCP relay destination address 192.168.20.100 to Vlan10
Restarting DHCP relay service...
Steps 4. Modify the src_intf to change the source IP of DHCP relay agent.
admin@sonic:~$ sudo config vlan dhcp_relay src_intf add 10 Loopback0
Added DHCP relay source interface Loopback0 for Vlan10
Restarting DHCP relay service...
Steps 5. Check switch can reach to DHCP server and the arp table has been correctly learned.
admin@sonic:~$ show vlan brief
+-----------+-----------------+-----------+----------------+----------------+---------------+-------------+-------------+
| VLAN ID | IP Address | Ports | Port Tagging | DHCP Helper | DHCP Source | DHCP Link | Proxy ARP |
| | | | | Address | Interface | Selection | |
+===========+=================+===========+================+================+===============+=============+=============+
| 10 | 192.168.10.1/24 | Ethernet4 | untagged | 192.168.20.100 | Loopback0 | | disabled |
+-----------+-----------------+-----------+----------------+----------------+---------------+-------------+-------------+
| 20 | 192.168.20.1/24 | Ethernet5 | untagged | | | | disabled |
+-----------+-----------------+-----------+----------------+----------------+---------------+-------------+-------------+
admin@sonic:~$ show arp
Address MacAddress Iface Vlan
--------------- ----------------- --------- ------
192.168.20.100 8c:ea:1b:30:da:51 Ethernet5 20
Total number of entries 1
Result:
As expect result.
- Packet capture
Comments
0 comments
Please sign in to leave a comment.