Re: About two eth alias in single ethernet !!!

Björn Mattsson <[email protected]> Thu, 31 Jan 2013 21:17:57 +0100
Newsgroups gmane.linux.debian.devel.firewall
Message-ID <[email protected]>
On 02/01/2013 04:17 AM, Lic. Néstor Rodríguez-Triana Domínguez wrote:
> Hello everybody:
>
>   Enybody can tellme how to setup al eth alias (like eth0:0) in a 
> debian box with a sigle ethernet?

One way doing it if you are looking for mutiple ipnumbers on eth0


cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0

iface eth0 inet static
     address xx.xx.xx.11
     netmask 255.255.255.0
     network xx.xx.xx.0
     broadcast xx.xx.xx.255
     post-up /etc/firewall/eth0_route_up
     pre-down /etc/firewall/eth0_route_down
     gateway xx.xx.xx.1
     # dns-* options are implemented by the resolvconf package, if installed
     dns-nameservers xx.xx.yy.11
     dns-search xxx.se

cat /etc/firewall/eth0_route_up
#!/bin/bash
ip a add xx.xx.xx.12/24 dev eth0
ip a add xx.xx.xx.13/24 dev eth0


cat /etc/firewall/eth0_route_down
#!/bin/bash
ip a del xx.xx.xx.12/24 dev eth0
ip a del xx.xx.xx.13/24 dev eth0


// Björn M.


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]