updates to sdn ovs service to use ip instead of deprecated ifconfig

This commit is contained in:
Blake Harnden 2020-01-09 13:52:36 -08:00
parent 6042c6fed9
commit 834ceea55d

View file

@ -42,7 +42,7 @@ class OvsService(SdnService):
cfg += "# auto-generated by OvsService (OvsService.py)\n" cfg += "# auto-generated by OvsService (OvsService.py)\n"
cfg += "/etc/init.d/openvswitch-switch start < /dev/null\n" cfg += "/etc/init.d/openvswitch-switch start < /dev/null\n"
cfg += "ovs-vsctl add-br ovsbr0 -- set Bridge ovsbr0 fail-mode=secure\n" cfg += "ovs-vsctl add-br ovsbr0 -- set Bridge ovsbr0 fail-mode=secure\n"
cfg += "ifconfig ovsbr0 up\n" cfg += "ip link set dev ovsbr0 up\n"
for ifc in node.netifs(): for ifc in node.netifs():
if hasattr(ifc, "control") and ifc.control is True: if hasattr(ifc, "control") and ifc.control is True:
@ -52,8 +52,8 @@ class OvsService(SdnService):
# create virtual interfaces # create virtual interfaces
cfg += "ip link add rtr%s type veth peer name sw%s\n" % (ifnum, ifnum) cfg += "ip link add rtr%s type veth peer name sw%s\n" % (ifnum, ifnum)
cfg += "ifconfig rtr%s up\n" % ifnum cfg += "ip link set dev rtr%s up\n" % ifnum
cfg += "ifconfig sw%s up\n" % ifnum cfg += "ip link set dev sw%s up\n" % ifnum
# remove ip address of eths because quagga/zebra will assign same IPs to rtr interfaces # remove ip address of eths because quagga/zebra will assign same IPs to rtr interfaces
# or assign them manually to rtr interfaces if zebra is not running # or assign them manually to rtr interfaces if zebra is not running