Skip to contentSkip to conversation

ip route src

LARTC Ciprian Niculescu 3 participants 3 messages May 29, 2002 – May 31, 2002

lore
Share & tools
lore
#1 lore raw
Quoted 5 lines · Ciprian Niculescu

in LARTC at 4.2.1 Split access

we have: ip route add $net dev $if src $ip

i didn't understand what does the "src", if someone can explaint to me.

The 'src' specifies which source address to choose in case a packet matching that routing rule does not have a source address yet. This may not seem useful, until you realise that all outgoing packets generated on the local machine don't have a source address when routing...

Doei, Arthur.

Signature · 7 lines
  /\    / |      [email protected]      | Work like you don't need the money
 /__\  /  | A friend is someone with whom | Love like you have never been hurt
/    \/__ | you can dare to be yourself   | Dance like there's nobody watching

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Ciprian Niculescu
Quoted 2 lines · Arthur van Leeuwen

The 'src' specifies which source address to choose in case a packet matching that routing rule does not have a source address yet. This may not seem

Are you sure it is that general?
If I am correct, it only applies to local unbound traffic.

Quoted 2 lines

useful, until you realise that all outgoing packets generated on the local machine don't have a source address when routing...

That is also to general.
If you generate outgoing traffic, you have the option to bind the source to an IP address, instead of "give me something default".

So: the src option changes the default source ip address of outbound traffic going to the specified route.

If you have a multi homed system (meaning more than one ip address for the same system), you can do a:
wget -SHO /dev/null http://www.telegraaf.nl/
and linux will choose an apropriate source address.

But if you have certain arrangements with somebody that delivers content only to specific ip addressess, you can tell wget to use
a specific ip address:
wget --bind-address={a local ip address} -SHO /dev/null http://www.telegraaf.nl/
which will overrule the default address.

If you want to know what the default address will be for a certain destination you can do this:
ip route get {destination}

Signature · 7 lines
begin  ILOVEYOU.VBS 666
<[email protected]> Telegraaf Elektronische Media
Real geeks don't get viruses
end
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/