-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
-
For Users
-
For Developers
-
Subgroups/Working Groups
-
Presentations
-
Join Us