7.1 Network configuration

Network settings are located in /etc/conf.d/net.

Initial setup

Before editing configuration, make sure that you have a symlink to /etc/init.d/net.lo with the interface name in _/etc/init.d (in this manual, we will be configuring a eth0 interface).

If we obtain settings by DHCP, then the config will be:

config_eth0=( "dhcp" )

When a static ip is used:

#for interface _eth0_ set ip from 24th network
#NOTE. Here 
config_eth0="192.168.0.7/24" 
#set the default gateway
routes_eth0="default via 192.168.0.1" 

If not set in the config, an attempt will be made to get the network settings by DHCP.

Also, when your system starts, you could see a message like this:

"Bringing up interface eth0
Starting ifplugd on eth0
Backgrounding.....
WARNING: net.eth0 has started, but is inactive" 

No worry. The network starts up all right, but it does not want to slow the system load. In some cases it is convenient, sometimes it is not. If you do not need it, add something like that in /etc/conf.d/net :

modules_eth0=( "!plug" )

Next time you run the network, it will have to wait until the end of the booting process.

Advanced network configuratiion

Sometimes you might want to work in multiple networks, though you have only one network card. This can be done by assigning multiple addresses to one network interface. For instance:

# obtain the basic settings by DHCP, and assign a static IP manually
config_eth0="dhcp" "10.0.0.17/24" 
# make the packages for the network 10.0.0.0/24 be forwarded not through the gateway 
# we obtained by DHCP, but through 10.0.0.1
routes_eth0="10.0.0.0/24 via 10.0.0.1" 

You do not have to use DHCP for basic network settings, they can be set statically:

# set several static addresses to network interface
config_eth0="192.168.0.17/24" "10.0.0.17/24" 
# specify the default gateway and an additional one
routes_eth0="default via 192.168.0.1" "10.0.0.0/24 via 10.0.0.1" 

MTU for the interface should be set like this (important for DSL modems; most of the times it would be set to 1000):

mtu_eth0="1500" 

DNS interface settings

# specify the domain used in network
dns_domain_eth0="your.domain" 
# list DNS servers in traversal order
dns_servers_eth0="192.168.0.2 192.168.0.3" 

If these settings are not available, DNS settings are taken from /etc/resolv.conf.

Configuring synchronization with server time (NTP):

# List the servers for synchronization
ntp_servers_eth0="192.168.0.2 192.168.0.3" 

Change the MAC-address:

# specify the required MAC-address
mac_eth0="01:23:45:67:89:AB" 

Thank you!