Re: Source address selection

From: Julian Anastasov (ja@ssi.bg)
Date: Thu Dec 14 2000 - 04:28:22 EST


        Hello,

Chris Dunlop wrote:

> using the IPs on the aliases as source addresses, except of course when
> an application binds to that address.
>
> Is there a way to do this ?

ip addr add 192.168.0.1/24 brd + dev eth0 scope host
                                          ^^^^^^^^^^
default is "scope global" (achieved with ifconfig too). There
is a "scope link" too.

Such address (scope host):

- will not be autoselected for the ARP probes (only scope link and global)
- will be answered/used in ARP replies (hidden=1 stops this)
- will not be autoselected in IP talks with neighbours on the links
and with talks to external hosts
- the programs can bind to it and to talk with everyone

The rule is to set the proper scope for the addresses and to add
preferred source addresses in your routes using the "ip" command,
especially for the default gateway:

ip route add ... src SRC_IP

hidden=1 is the next step to hide an IP address but it is not needed
for your setup. It is needed when many hosts share same IP address
or for other ARP filtering purposes.

Regards

--
Julian Anastasov <ja@ssi.bg>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Dec 15 2000 - 21:00:28 EST