Skip to contentSkip to conversation

Problems with routes

LARTC Alexander Brill 2 participants 3 messages Jun 5, 2002 – Jun 6, 2002

lore
Share & tools
lore
#0 lore raw

Whenever I try to 'readd' a route I receive an error and I can't figure out why...

# Add some routes
ip route add $EXT via $INT
ip route add prio 320 from $INT nat $EXT # Delete them
ip route del from $INT nat $EXT
ip route del $EXT via $INT
# Add again
ip route add $EXT via $INT
ip route add prio 320 from $INT nat $EXT

The last command exits with exit-code '2' and the message:
RTNETLINK answers: Invalid argument

What am I doing wrong?

Signature · 3 lines
Alexander Brill <[email protected]>
http://www.project23.no
PGP-key: http://alexb.egil.org/key.pub
#1 lore raw

Hello,

Quoted 6 lines · Alexander Brill

Whenever I try to 'readd' a route I receive an error and I can't figure out why...

# Add some routes
ip route add $EXT via $INT
ip route add prio 320 from $INT nat $EXT

ip rule add prio 320 from $INT nat $EXT

Quoted 2 lines

# Delete them
ip route del from $INT nat $EXT

ip route del prio 320 from $INT nat $EXT

Quoted 4 lines

ip route del $EXT via $INT
# Add again
ip route add $EXT via $INT
ip route add prio 320 from $INT nat $EXT

ip rule add prio 320 from $INT nat $EXT

Quoted 2 lines

The last command exits with exit-code '2' and the message:
RTNETLINK answers: Invalid argument

May be not only the last one :)

Quoted 1 line

What am I doing wrong?

Use ip rules for SNAT and ip routes for DNAT

Regards

--
Julian Anastasov <[email protected]>

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#2 lore raw
In reply to Alexander Brill
Quoted 26 lines · Julian Anastasov

Hello,

Quoted 6 lines · Alexander Brill

Whenever I try to 'readd' a route I receive an error and I can't figure out why...

# Add some routes
ip route add $EXT via $INT
ip route add prio 320 from $INT nat $EXT

ip rule add prio 320 from $INT nat $EXT

Quoted 2 lines

# Delete them
ip route del from $INT nat $EXT

ip route del prio 320 from $INT nat $EXT

Quoted 4 lines

ip route del $EXT via $INT
# Add again
ip route add $EXT via $INT
ip route add prio 320 from $INT nat $EXT

ip rule add prio 320 from $INT nat $EXT

Quoted 9 lines
Quoted 2 lines

The last command exits with exit-code '2' and the message:
RTNETLINK answers: Invalid argument

May be not only the last one :)

Quoted 1 line

What am I doing wrong?

Use ip rules for SNAT and ip routes for DNAT

Thanks alot. Rather typical that you can't see your own typos ;)

Signature · 3 lines
Alexander Brill <[email protected]>
http://www.project23.no
PGP-key: http://alexb.egil.org/key.pub