Using Network Virtual Interfaces

You might use network virtual interfaces when there are several networks range (completely different) on the same network structure. You have:

ISP modem
Router, Switch or Hub (at least one)

the non-virtual network structure is: – Network – Gateway – Broadcast – 254 – Clients

There are three computers that want to be comunicated privately or separated from the network but in the same structure of network. (There are several cases in which you can use virtual interfaces, this is just an example)

The virtual structure is: – Network – Broadcast – Clients
(There’s no gateway in this case but if you want you might have some one, it can be another router (connected to the first) or another computer that has the NAT function configured)

To set the configuration permanent on a Debian’s based system you write /etc/network/interfaces file:

auto eth0
iface nvirtual inet static
auto eth0:1
iface virtual inet static

Close and save.

Now you have to restart networking daemon:

# /etc/init.d/networking restart

Make this with at least two computers and make ping between them using “nvirtual” and “virtual” interfaces.

For make this temporaly, type on at least two computers:

# ifconfig eth0 netmask up
# ifconfig eth0:1 netmask up
# route add default gw
# nano /etc/resolv.conf
namesevers xx.xx.xx.xx
save and close
# ping -c 5 ; ping -c 5 #another computer virtual interface address

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s