
This will try to save the current settings into /etc/. If the ipaddr is valid (currently being used by the interface) Save current interface IP Address to the system configuration file. Interface then it copies backup file to interface file in /sysfs path. This method checks if a backup version is available for given It successfully, otherwise it will return False. True or False, True if it found the VLAN interface and removed This method will try to remove the VLAN tag of this interface. Remove the VLAN of the interface by tag number. You must have sudo permissions to run this method on a host. Interface will no more be listed with ‘ip a’ and if fails it This method will try to delete the virtual device link and the This method will try to remove the address from this interface Removes an IP address from this interface. Remove any config files that is created as a part of the test remove_ipaddr ( ipaddr, netmask ) ¶ If it fails, the method will raise a NWException. This method will remove all the VLAN interfaces associated by the Method will try to ping the peer and if fails it will raise a You should provide a IPv4 or IPV6 that would like to ping. This method will try to ping a peer address (IPv4 or IPv6). Ping_check ( peer_ip, count=2, options=None ) ¶ True if operational link state is LOWER_UP, Link state is up otherwise will return False.Ĭheck Operational link state is up or not. This method checks if the interface is a bonding device or not.Ĭheck if the interface is up or not. This method checks if the interface is available. True or False, True if network interface state is ‘UP’ is_admin_link_up ( ) ¶Ĭheck the admin link state is up or not. This method will try to get the current MTU value, if fails will Return the current MTU value of this interface. Version – Address Family Version (4 or 6). List with all addresses on this interface. Interfaces can hold multiple IP addresses. Get the IP addresses from a network interface. This method will try to get the address and if fails it will raise a Get the Hardware Address (MAC) of this interface. This method will try to flush the ip address from this interfaceĪnd if fails it will raise a NWException.

config_file_path ¶ config_filename ¶ flush_ipaddr ( ) ¶įlush all the IP address for this interface.

This method will try to add a new ipaddr/netmask this interface, if add_ipaddr ( ipaddr, netmask ) ¶Īdd an IP Address (with netmask) to the interface. Here you will find a few methods to perform basic operations on a NIC. If a RemoteHost then all commands will beĮxecuted on a remote_session (host.remote_session). This class represents a network card interface (NIC).Īn “NetworkInterface” is attached to some host.

NetworkInterface ( if_name, host, if_type='Ethernet' ) ¶
