Skip to content

Useful OpenSwitch commands

Ilya Schepin edited this page Aug 26, 2016 · 1 revision

How to connect to Docker image:

Default GW: 172.17.0.1
First openswitch: ssh admin@172.17.0.2
Second openswitch: ssh admin@172.17.0.3

How to connect using docker command:

docker exec -it <CONTAINER_ID> bash

How to check information about openswitch interfaces:

/sbin/ip netns exec swns ifconfig
/sbin/ip netns exec swns ip route

How to sniff traffic:

/sbin/ip netns exec swns /usr/sbin/tcpdump -nvli <eth_name>
/sbin/ip netns exec swns /usr/sbin/tcpdump -vvv -i

How to check ports inside the bridge:

/opt/openvswitch/bin/ovs-vsctl list port bridge_normal

How to check mac aging:

/opt/openvswitch/bin/ovs-appctl -t /run/openvswitch-sim/ovs-vswitchd-sim..ctl fdb/show bridge_normal
/opt/openvswitch/bin/ovs-ofctl dump-ports bridge_normal
/opt/openvswitch/bin/ovs-ofctl show bridge_normal

How to check openflow flows:

/opt/openvswitch/bin/ovs-appctl -t /run/openvswitch-sim/ovs-vswitchd-sim.<>.ctl dpif/dump-flows bridge_normal

How to check information inside specific table:

/opt/openvswitch/bin/ovs-vsctl/list

Another way to inspect OVSDB tables:

/usr/bin/ovsdb-client dump OpenSwitch tablename

How to change logging levels for OpenSwitch daemons:

  1. Go to ops-build/yocto directory
  2. Find the required .service file, for example for zebra it is ops-zebra.service
  3. Modify ExecStart parameters: vFILE:DBG will provide maximum level of logging into separate log file, specified by parameter --log-file=path-to-log-file
  4. Rebuild the image