libioc.NetworkInterface module

Model if an iocage jails network interface.

class libioc.NetworkInterface.NetworkInterface(name='vnet0', create=False, ipv4_addresses=[], ipv6_addresses=[], mac=None, mtu=None, description=None, rename=None, group=None, addm=None, vnet=None, jail=None, extra_settings=None, destroy=False, auto_apply=True, logger=None)[source]

Bases: object

Model if an iocage jails network interface.

NetworkInterface abstracts interface configurations and commands executed on the host or within jails. This class is internally used by Network.

apply()[source]

Apply the interface settings and configure IP address.

Return type

None

apply_addresses()[source]

Apply the configured IP addresses.

Return type

None

apply_settings()[source]

Apply the interface settings only.

Return type

None

property current_nic_name

Return the current NIC reference for usage in shell scripts.

Return type

str

destroy_interface()[source]

Destroy the interface.

Return type

None

dhclient_command = '/sbin/dhclient'
ifconfig_command = '/sbin/ifconfig'
rtsold_command = '/usr/sbin/rtsold'