NAME
Network::LinuxConf - Linux Conf Networking Module
SYNOPSIS
my $networking = new Network::LinuxConf(%vars);
if($networking->footprint()) {$networking->setup();}
my @fileschanged = $networking->files();
DESCRIPTION
METHODS
The following methods exist in this module:
- footprint()
-
This method returns 1 if LinuxConf networking was discovered on the machine, undef if it was not. The current test checks for the existance of $chroot/etc/sysconfig/network-scripts/ifup.
- setup_interface($interface)
-
This sets up the ifcfg-$dev files. It assumes that it has free reign of these files, which should be valid except for some fairly esoteric networking configurations.
It sets ONBOOT to yes, DEVICE to
$interface_device(as specified in the config file).If
$interface_typeis 'static', and$interface_ipexists, it will set up all the appropriate settings for static ip addresses. NETMASK will be either the value specified in$interface_netmask, or the appropriate default for the ip address specified.If
$interface_typeis 'bootp', the interface is setup of for bootp.Otherwise the interface is setup for dhcp.
- setup_global
-
setup_global sets up the default gatway, and the host/domain names via modification of /etc/sysconfig/network. It does not assume that it owns this file. If the file already exists it will move it to /etc/systconfig/network.scbak first, then create the new file by modifying the lines from the old file that it needs to.
If it creates a new file it will create a file with NETWORKING, FORWARD_IPV4, GATEWAY, HOSTNAME, and DOMAINNAME. NETWORKING will default to "yes" and FORWARD_IPV4 will default to "no".
AUTHOR
Sean Dague <[email protected]>
SEE ALSO
SystemConifg::Network, Net::Netmask, perl