Configuring a Network Interface during Linux Network Integration
Once you know the IP address, netmask, and gateway, configuration is as simple as filling out a form.
netcfg, the utility you use to set these parameters, makes this an easy process.
An important distinction
IP addresses label network interfaces, not the entire host on which the interface device sits.
A single host may have many interfaces that allow it to use different subnets and even facilitate communication among the many connected subnets.
For instance, your subnet gateway needs at least two interfaces: one into subnet and one out of subnet.
In the following Simulation, you will learn how to set up an Ethernet network interface.
Configuring Interface Simulation
In this Simulation, you saw how to configure a static IP interface.
If your subnet uses DHCP or BOOTP, simply indicate this with the Interface configuration protocol drop-down menu.
You will probably want to set the interface to start at boot time, just as you do for the static interface.
When you use DHCP or BOOTP, the remainder of the information is set dynamically each time you enable the interface.
In the next lesson, you will learn how to enable and disable network interfaces.
I am using netcfg to configure two interfaces in my archlinux VM. In VirtualBox I have set two active interfaces.
The first (eth0) is the NAT interface to provide the VM with Internet access.
The second (eth1) is a host-only network so I can access the VM directly from the host.
I have tried to configure eth0 with dhcp since it doesnt matter what IP-address it gets from the NAT. And I have tried to configure eth1 with a static IP in the host-only network.
Everything seems to work fine, but here is the thing. If I activate the eth1 interface (host-only) I am able to ping it from the host (as expected),
but if I then enable the eth0 interface (nat) I am not able to access the Internet (tried to ping 18.104.22.168). But, if I then disable eth1, eth0 suddenly works fine. Long story short:
The NAT interface wont work simultaneously with the host-only interface. The host-only interface seem to always work.
It is because of this I thought the problem existed in the configuration of eth1, since it obviously hindered eth0 to work properly. The configurations are very simplistic, but I have been unsuccessfull to identify the error.
Configuration of eth0 (nat)
DESCRIPTION="DHCP (NAT for Internet access"
Configuration of eth1 (host-only)
DESCRIPTION="Static IP (development)"