assigning alias ip address

Jose Maria Lopez jkerouac at
Fri Sep 10 18:37:55 CEST 2004

El vie, 10 de 09 de 2004 a las 05:10, John Black escribió:
> How does assigning alias IP address work?
> I have one network jack coming into my server room. 
> eth0
> I have two servers with public IP address.
> this assigns them, right?
> ifconfig eth0:10 netmask
> ifconfig eth0:11 netmask
> iptables -t nat -A PREROUTING -d -i eth0 \
>                 -j DNAT --to-destination
> iptables -t nat -A PREROUTING -d -i eth0 \
>                 -j DNAT --to-destination
> When a mail or web request is made from the internet.  
> How does it know where the servers are?
> thanks
> John

The new kernel networking code named iproute2 doesn't make
any differences between IPs assigned to an interfaces or
aliased IPs. You can assign any number of IPs to an interface,
and this can be primary IPs or secundary IPs, but for the
kernel it's just another IP assigned to the machine (really
it's more complex, the IPs are assigned to services, not any
hardware in particular).

So when a request is made from the internet the routing code
just looks in it's tables what routes it have to use, and
as the IPs are assigned to the same machine it sends the
request to the machine you have assigned the IPs.

Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
jkerouac at
bgSEC Seguridad y Consultoria de Sistemas Informaticos

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
                -- Jack Kerouac, "On the Road"

More information about the netfilter mailing list