[interfaceconfig] - macaddr, mtu and ifalias properties

This commit is contained in:
hagbard 2019-08-21 10:27:57 -07:00
parent eb5464fcca
commit ee2625a5c3

View File

@ -75,7 +75,6 @@ An interfaces ifalias variable is empty by default, but the variable is used for
interface_instance = Interface("eth2") interface_instance = Interface("eth2")
interface_instance.ifalias = "interface_alias" interface_instance.ifalias = "interface_alias"
print (interface_instance.ifalias) print (interface_instance.ifalias)
print (interface_instance.get_alias())
.. code-block:: sh .. code-block:: sh
@ -84,10 +83,6 @@ An interfaces ifalias variable is empty by default, but the variable is used for
link/ether 08:00:27:70:9c:a3 brd ff:ff:ff:ff:ff:ff link/ether 08:00:27:70:9c:a3 brd ff:ff:ff:ff:ff:ff
alias interface_alias alias interface_alias
get_alias()
~~~~~~~~~~~
Reads the ifalias variable directly from the /sys/class/net/<interface>/ifalias and can be used to determine in a config a new value and what value is set in in the system.
del_alias() del_alias()
~~~~~~~~~~~ ~~~~~~~~~~~
Removes any content from the ifalias variable. Removes any content from the ifalias variable.
@ -135,11 +130,9 @@ Sets the mac address on a network interface.
.. code-block:: sh .. code-block:: sh
interface_instance.linkstate = 'up' interface_instance.macaddr = '08:00:27:0e:6d:16'
''' show current mac address set on the interface '''
get_macaddr() print(interface_instance.macaddr)
~~~~~~~~~~~~~
Returns the mac address of a network interface.
Interface MTU Interface MTU
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
@ -148,11 +141,8 @@ Sets the MTU on a network interface.
.. code-block:: sh .. code-block:: sh
interface_instance.mtu = 9000 interface_instance.mtu = 9000
''' read mtu from interfacr
print(interface_instance.mtu)
get_mtu(self)
~~~~~~~~~~~~~
Returns the MTU of a network interface.
add_ipv4_addr(ipaddr=[]): add_ipv4_addr(ipaddr=[]):