[Enterprise SONiC] Management and front port IPv4/IPv6 Address Follow
- Configure IP address on management port "eth0"
- Configure IP address on front port (aka physical interface)
- Configure IP address on port channel interface
- Configure IP address on loopback interface.
- Frequently Asked Question
Tested model & firmware version:
- Switch model name:
DCS203 (AS7326-56X)
- Edgecore SONiC version:
202006.4
202012.0 ~ 202012.7
202111.0 ~ 202111.8
Restriction:
- Default setting:
- DHCP address on management port"eth0"
- All of management port on Edgecore model will be "eth0"
- [202012] Known issue:
- [SONIC-3300] Set the IP and default gateway using the command "config interface ip add eth0 <ip / mask> <gw>", the default route is not displayed with "ip route show" or "show ip route".
- This is a display issue and the default route is still valid.
- (Workaround) Use "ip route show table default" instead of "show ip route". Here is an example shown below,
-
admin@sonic:~$ sudo config interface ip add eth0 192.168.1.10/24 192.168.1.254
admin@sonic:~$ ip route
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10
240.127.1.0/24 dev docker0 proto kernel scope link src 240.127.1.1 linkdown
admin@sonic:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
f - OpenFabric,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
C>* 192.168.1.0/24 is directly connected, eth0, 00:00:11
admin@sonic:~$ ip route show table default
default via 192.168.1.254 dev eth0 metric 201
192.168.1.0/24 dev eth0 scope link
- [SONIC-3300] Set the IP and default gateway using the command "config interface ip add eth0 <ip / mask> <gw>", the default route is not displayed with "ip route show" or "show ip route".
- [202111] Known issue:
- [SONIC-6278] [AS4630-54TE/PE/NPE] Fix the issue where the management port (eth0) was not functioning due to an out-of-date BIOS date/time. (This is fixed in 202111.3)
Configure IP address on management port "eth0"
Procedure :
Steps 1. Configure IP address on management port "eth0"
admin@sonic:~$ sudo config interface ip add eth0 188.188.97.16/16 188.188.1.1
admin@sonic:~$ sudo config interface ip add eth0 2001::8/64 2001::1
Steps 2. Check IP address
admin@sonic:~$ show ip interfaces
Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor
----------- -------- ------------------- ------------ -------------- ---------
Loopback0 10.1.0.1/32 up/up N/A N/A
docker0 240.127.1.1/24 up/down N/A N/A
eth0 188.188.97.16/16 up/up N/A N/A
lo 127.0.0.1/8 up/up N/A N/A
admin@sonic:~$ show ipv6 interfaces
Interface Master IPv6 address/mask Admin/Oper BGP Neighbor Neighbor IP
----------- -------- --------------------------------------- ------------ -------------- -------------
Bridge fe80::4020:6aff:fee4:b0a3%Bridge/64 up/down N/A N/A
Ethernet0 fe80::ba6a:97ff:fee2:479c%Ethernet0/64 up/up N/A N/A
Ethernet1 fe80::ba6a:97ff:fee2:479c%Ethernet1/64 up/up N/A N/A
Ethernet48 fe80::ba6a:97ff:fee2:479c%Ethernet48/64 up/up N/A N/A
Ethernet52 fe80::ba6a:97ff:fee2:479c%Ethernet52/64 up/up N/A N/A
Loopback0 fe80::243e:e6ff:fee7:5ca1%Loopback0/64 up/up N/A N/A
eth0 2001::8/64 up/up N/A N/A
fe80::ba6a:97ff:fee2:479c%eth0/64
lo ::1/128 up/up N/A N/A
admin@sonic:~$ show management_interface address
Management IP address = 188.188.97.16/16
Management Network Default Gateway = 188.188.1.1
Management IP address = 2001::8/64
Management Network Default Gateway = 2001::1
Caution: "BGP Neighbor" and "Neighbor IP" won't support on 202006 branch.
Steps 3. Save the setting to config_db.json
admin@sonic:~$ sudo config save -y
Steps 4. Check IP address setting on config_db.json
admin@sonic:/etc/sonic$ sudo vi config_db.json
{
...omitted
"MGMT_INTERFACE": {
"eth0|188.188.97.16/16": {
"gwaddr": "188.188.1.1"
},
"eth0|2001::8/64": {
"gwaddr": "2001::1"
}
},
...omitted
}
Configure IP address on front port (aka physical interface).
Procedure :
Steps 1. Configure IP address on front port. i.e Ethernet0
admin@sonic:~$ sudo config interface ip add Ethernet0 192.168.1.1/24
admin@sonic:~$ sudo config interface ip add Ethernet0 2002::1/64
Steps 2. Check IP address
admin@sonic:~$ show ip interfaces Interface IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP ----------- ------------------- ------------ -------------- ------------- Ethernet0 192.168.1.1/24 up/down N/A N/A
docker0 240.127.1.1/24 up/down N/A N/A eth0 188.188.97.32/16 up/up N/A N/A lo 127.0.0.1/8 up/up N/A N/A 10.1.0.1/32 admin@sonic:~$ show ipv6 interfaces Interface IPv6 address/mask Admin/Oper BGP Neighbor Neighbor IP ----------- -------------------------------------- ------------ -------------- ------------- Bridge fe80::f4f6:a4ff:fe97:3c88%Bridge/64 up/up N/A N/A
Ethernet0 2002::1/64 up/down N/A N/A dummy fe80::90cd:eff:fe7b:359f%dummy/64 up/up N/A N/A eth0 fe80::aa2b:b5ff:fe9d:d7db%eth0/64 up/up N/A N/A lo ::1/128 up/up N/A N/A
Steps 3. Save the setting to config_db.json
admin@sonic:~$ sudo config save -y
Steps 4. Check IP address setting on config_db.json
admin@sonic:/etc/sonic$ sudo vi config_db.json { ...omitted
"INTERFACE": {
"Ethernet0": {},
"Ethernet0|192.168.1.1/24": {},
"Ethernet0|2002::1/64": {}
},
...omitted
}
Configure IP address on port channel interface.
Procedure :
Steps 1. Create PortChannel01 and append member.(Please refer to LAG)
Steps 2. Configure IP address on portchannel. i.e PortChannel01
Steps 3. Check IP address
Steps 4. Save the setting to config_db.json
Steps 5. Check IP address setting on config_db.json
Configure IP address on loopback interface.
Procedure :
Steps 1. Configure IP address to loopback interface i.e Loopback0
Steps 2. Check IP address
Steps 3. Save the setting to config_db.json
Steps 4. Check IP address setting on config_db.json
Frequently Asked Question
Why cannot set the management IP after typing the correct command?
Tested model & firmware version:
- Switch model name:
DCS203 (AS7326-56X) - Edgecore SONiC version:
202111.0
Problem description:
admin@sonic:~$ sudo config interface ip add eth0 188.188.36.123/16
admin@sonic:~$ show ip int
Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP
----------- -------- ------------------- ------------ -------------- -------------
docker0 240.127.1.1/24 up/down N/A N/A
lo 127.0.0.1/16 up/up N/A N/A
This problem will happen on the 202111 version.
Solution:
Step 1: Make sure there's a "config_db.json" at /etc/sonic.
admin@sonic:~$ ls /etc/sonic/
asic_config_checksum fast-reboot_order sonic-environment
config_db.json frr sonic_version.yml
constants.yml generated_services.conf swss_dependent
copp_cfg.json init_cfg.json updategraph.conf
core_analyzer.rc.json remote_ctr.config.json warm-reboot_order
dhcp_relay_reconcile snmp.yml
Note:
There's no "config_db.json" after installing the SONiC from ONIE, so it needs to generate a new one.
Step 2: Generate a "config_db.json", please follow this article.
Step 3: After generating the default "config_db.json", then it could set the management IP.
Comments
0 comments
Please sign in to leave a comment.