-
Notifications
You must be signed in to change notification settings - Fork 1.1k
L2 Switch mode
SONiC switches are normally operated in Layer 3 Switch mode, however, they could also be operated as L2 Switch. This document will describe the basic features supported in L2 Switch mode.
Below is a sample command line. Please replace the eth0 and gwaddr values with correct management IP address and default gateway address.
cat <<EOF | sudo config reload /dev/stdin -y
{
"MGMT_INTERFACE": {
"eth0|10.3.147.46/23": {
"gwaddr": "10.3.146.1"
}
},
"DEVICE_METADATA": {
"localhost": {
"hostname": "sonic"
}
}
}
EOF
sudo sonic-cfggen -H --write-to-db
Below is a sample command line. User should provide a SKU parameter. The output file is stdout for validation purpose.
sonic-cfggen -t /usr/local/lib/python2.7/dist-packages/usr/share/sonic/templates/l2switch.j2 -p -k Mellanox-SN2700-D48C8
Existing ConfigDB will be overwritten.
sonic-cfggen -t /usr/local/lib/python2.7/dist-packages/usr/share/sonic/templates/l2switch.j2 -p -k Mellanox-SN2700-D48C8 | sudo config load /dev/stdin -y
sudo config save -y
sudo systemctl restart swss
Port speed is initially specified in the minigraph or generated in L2 switch mode and load into ConfigDB. During runtime, we could config port speed by CLI. Below is a sample.
sudo config interface speed Ethernet0 40000
We could verify the port speed by CLI.
show interface status
Sample command line output:
admin@sonic:~$ show interface status
Interface Lanes Speed MTU Alias Oper Admin
----------- --------------- ------- ----- ------- ------ -------
Ethernet0 0,1,2,3 40G 9100 etp1 up up
Ethernet4 4,5,6,7 40G 9100 etp2 up up
Ethernet8 8,9,10,11 40G 9100 etp3 up up
Ethernet12 12,13,14,15 40G 9100 etp4 up up
Ethernet16 16,17,18,19 40G 9100 etp5 up up
Ethernet20 20,21,22,23 40G 9100 etp6 up up
Ethernet24 24,25,26,27 40G 9100 etp7 up up
Ethernet28 28,29,30,31 40G 9100 etp8 up up
Ethernet32 32,33,34,35 40G 9100 etp9 up up
Ethernet36 36,37,38,39 40G 9100 etp10 up up
Ethernet40 40,41,42,43 40G 9100 etp11 up up
Ethernet44 44,45,46,47 40G 9100 etp12 up up
Ethernet48 48,49,50,51 40G 9100 etp13 up up
Ethernet52 52,53,54,55 40G 9100 etp14 up up
Ethernet56 56,57,58,59 40G 9100 etp15 up up
Ethernet60 60,61,62,63 40G 9100 etp16 up up
Ethernet64 64,65,66,67 40G 9100 etp17 up up
Ethernet68 68,69,70,71 40G 9100 etp18 up up
Ethernet72 72,73,74,75 40G 9100 etp19 up up
Ethernet76 76,77,78,79 40G 9100 etp20 up up
Ethernet80 80,81,82,83 40G 9100 etp21 up up
Ethernet84 84,85,86,87 40G 9100 etp22 up up
Ethernet88 88,89,90,91 40G 9100 etp23 up up
Ethernet92 92,93,94,95 40G 9100 etp24 up up
Ethernet96 96,97,98,99 40G 9100 etp25 up up
Ethernet100 100,101,102,103 40G 9100 etp26 up up
Ethernet104 104,105,106,107 40G 9100 etp27 up up
Ethernet108 108,109,110,111 40G 9100 etp28 up up
Ethernet112 112,113,114,115 40G 9100 etp29 up up
Ethernet116 116,117,118,119 40G 9100 etp30 up up
Ethernet120 120,121,122,123 40G 9100 etp31 up up
Ethernet124 124,125,126,127 40G 9100 etp32 up up
If you want to know the port number of one interface, normally you can find it in the 'Alias' column. For example the interface Ethernet0 has port number 1.
-
For Users
-
For Developers
-
Subgroups/Working Groups
-
Presentations
-
Join Us