NATing out going packets
Hello,
I have kind of a dumb question :)
Right now I have the following rule for NATing out going traffic.
$IPT -t nat -A POSTROUTING -o $EXT_FACE -s ! $EXT_IP -j SNAT --to-source $EXT_IP
I did not want to specify a source network because I have a few and wanted to only have one rule. It seems to be working fine ... any thoughts would be appreciated.
I guest I am sort of new to building my own rules and just want to make sure I am doing everything correctly. :)
Signature · 3 lines
Michael Gale Network Administrator Utilitran Corporation
Quoted 8 lines · Michael Gale
Hello,
I have kind of a dumb question :)
Right now I have the following rule for NATing out going traffic.
$IPT -t nat -A POSTROUTING -o $EXT_FACE -s ! $EXT_IP -j SNAT --to-source $EXT_IP
There is no point in specifying "-s ! $EXT_IP".
Either a packet has the source address $EXT_IP, or it doesn't.
If it does have that address, it won't match the above rule, and will exit the box with the source address $EXT_IP.
If it does not have that address, it will match the above rule, and will exit the box (after being SNATted) with the source address $EXT_IP.
Either way the end result is exactly the same, so keep the rule simpler and remove the "-s ! $EXT_IP".
Antony.
Signature · 8 lines
All matter in the Universe can be placed into one of two categories:
1. Things which need to be fixed.
2. Things which need to be fixed once you've had a few minutes to play with
them.
Please reply to the list;
please don't CC me.