summaryrefslogtreecommitdiff
path: root/src/conf_mode/interface-ethernet.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 22:15:22 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 22:15:22 +0200
commitfc5e0d7ee59c6ca35c7cb53bb6ed9bcbdfb73034 (patch)
treeb6c2a3a124441ab0d3d3a216638c803979cd1505 /src/conf_mode/interface-ethernet.py
parenta7908d8340072d353e3bd75626a209f45e037989 (diff)
parentfe8cd98c92b5f51fecace373ad18f8dfa3727f8b (diff)
downloadvyos-1x-fc5e0d7ee59c6ca35c7cb53bb6ed9bcbdfb73034.tar.gz
vyos-1x-fc5e0d7ee59c6ca35c7cb53bb6ed9bcbdfb73034.zip
Merge branch 'current' of github.com:vyos/vyos-1x into equuleus
* 'current' of github.com:vyos/vyos-1x: (31 commits) Jenkins: rely on the global defined label for Docker executors Python/ifconfig: T1557: add STPIf class (spanning tree) bridge member Python/ifconfig: T1557: bugfix removing Q-in-Q VLAN interfaces openvpn: T1548: setup interface alias Python/ifconfig: T1557: refactor BondIf 'mode' property to set_mode() Python/ifconfig: T1557: refactor BondIf 'arp_interval' property to set_arp_interval() Python/ifconfig: T1557: refactor BondIf 'arp_ip_target' property to set_arp_ip_target()/get_arp_ip_target() Python/ifconfig: T1557: refactor BondIf 'arp_interval' property to set_arp_interval() Python/ifconfig: T1557: refactor BondIf 'xmit_hash_policy' property to set_hash_policy() Python/ifconfig: T1557: remove unused has_autoneg() from EthernetIf Python/ifconfig: T1557: refactor Interface 'state' property to set_state()/get_state() Python/ifconfig: T1557: refactor Interface 'arp_cache_tmo' property to set_set_arp_cache_tmo() Python/ifconfig: T1557: refactor Interface 'proxy_arp_pvlan' property to set_proxy_arp_pvlan() Python/ifconfig: T1557: refactor Interface 'proxy_arp' property to set_proxy_arp() Python/ifconfig: T1557: loopback: implement derived remove() Python/ifconfig: T1557: refactor Interface 'ifalias' property to set_alias() Python/ifconfig: T1557: refactor Interface 'link_detect' property to set_link_detect() Python/ifconfig: T1557: refactor BridgeIf 'stp_state' property to set_stp() Python/ifconfig: T1557: refactor BridgeIf 'priority' property to set_priority() Python/ifconfig: T1557: refactor BridgeIf 'ageing_time' property to set_ageing_time() ...
Diffstat (limited to 'src/conf_mode/interface-ethernet.py')
-rwxr-xr-xsrc/conf_mode/interface-ethernet.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/conf_mode/interface-ethernet.py b/src/conf_mode/interface-ethernet.py
index f82105847..99450b19e 100755
--- a/src/conf_mode/interface-ethernet.py
+++ b/src/conf_mode/interface-ethernet.py
@@ -67,20 +67,20 @@ def apply_vlan_config(vlan, config):
raise TypeError()
# update interface description used e.g. within SNMP
- vlan.ifalias = config['description']
+ vlan.set_alias(config['description'])
# ignore link state changes
- vlan.link_detect = config['disable_link_detect']
+ vlan.set_link_detect(config['disable_link_detect'])
# Maximum Transmission Unit (MTU)
- vlan.mtu = config['mtu']
+ vlan.set_mtu(config['mtu'])
# Change VLAN interface MAC address
if config['mac']:
- vlan.mac = config['mac']
+ vlan.set_mac(config['mac'])
# enable/disable VLAN interface
if config['disable']:
- vlan.state = 'down'
+ vlan.set_state('down')
else:
- vlan.state = 'up'
+ vlan.set_state('up')
# Configure interface address(es)
# - not longer required addresses get removed first
@@ -271,32 +271,32 @@ def apply(eth):
e.remove()
else:
# update interface description used e.g. within SNMP
- e.ifalias = eth['description']
+ e.set_alias(eth['description'])
#
# missing DHCP/DHCPv6 options go here
#
# ignore link state changes
- e.link_detect = eth['disable_link_detect']
+ e.set_link_detect(eth['disable_link_detect'])
# disable ethernet flow control (pause frames)
e.set_flow_control(eth['flow_control'])
# configure ARP cache timeout in milliseconds
- e.arp_cache_tmo = eth['ip_arp_cache_tmo']
+ e.set_arp_cache_tmo(eth['ip_arp_cache_tmo'])
# Enable proxy-arp on this interface
- e.proxy_arp = eth['ip_proxy_arp']
+ e.set_proxy_arp(eth['ip_proxy_arp'])
# Enable private VLAN proxy ARP on this interface
- e.proxy_arp_pvlan = eth['ip_proxy_arp_pvlan']
+ e.set_proxy_arp_pvlan(eth['ip_proxy_arp_pvlan'])
# Change interface MAC address - re-set to real hardware address (hw-id)
# if custom mac is removed
if eth['mac']:
- e.mac = eth['mac']
+ e.set_mac(eth['mac'])
else:
- e.mac = eth['hw_id']
+ e.set_mac(eth['hw_id'])
# Maximum Transmission Unit (MTU)
- e.mtu = eth['mtu']
+ e.set_mtu(eth['mtu'])
# GRO (generic receive offload)
e.set_gro(eth['offload_gro'])
@@ -316,6 +316,12 @@ def apply(eth):
# Set physical interface speed and duplex
e.set_speed_duplex(eth['speed'], eth['duplex'])
+ # Enable/Disable interface
+ if eth['disable']:
+ e.set_state('down')
+ else:
+ e.set_state('up')
+
# Configure interface address(es)
# - not longer required addresses get removed first
# - newly addresses will be added second
@@ -324,12 +330,6 @@ def apply(eth):
for addr in eth['address']:
e.add_addr(addr)
- # Enable/Disable interface
- if eth['disable']:
- e.state = 'down'
- else:
- e.state = 'up'
-
# remove no longer required service VLAN interfaces (vif-s)
for vif_s in eth['vif_s_remove']:
e.del_vlan(vif_s)