Ethernet virtual-interfaces (Debian system)

If you need more than one ethernet interface on your machine, you need a virtual-interface!
An ethernet virtual interface it’s an autonomous interface with an IP address, that simulates a physical ethernet interface.

On a debian-based OS, for more ethernet interfaces on a single physical interface you must add these lines at the end of interfaces, assuming eth1 the default physical interfaces:

auto lo
iface lo inet loopback

auto eth1 eth1:0

iface eth1:0 inet static
address 192.168.1.71
        netmask 255.255.255.0
        gateway 192.168.1.1
iface eth1 inet static
        address 192.168.1.70
        netmask 255.255.255.0
        gateway 192.168.1.1

whit an IP address different from the IP of the interface of the system (note that here, I’m working on my personal LAN 192.168.1.0/24), and then restart the networking daemon:
$ sudo /etc/init.d/networking stop
$ sudo /etc/init.d/networking start

(If the networking daemon doesn’t restart correcly, do a system reboot)

So now, on your system you will have two ehternet interfaces (you can also create others virtual interfaces, in the same way).
To control your ethernet configuration, run the ifconfig command.

Enjoy!  😉

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: