[plug] NAT on a linux box

Mike Holland myk at plug.linux.org.au
Mon Feb 17 22:44:15 WST 2003


On Mon, 17 Feb 2003, Daniel Pearson wrote:

> Hi Mike,
> The reason I want such a script is so that I can just start it and stop it
> whenever I want (don't ask why, sometimes I get bored ;) -- possibly even if
> I want to shutdown the NAT while i'm connected, etc.. All I need to do now,
> is find a IPTables solution, only something very simple that does the job
> well -- any ideas?

Hi Daniel,
in that case, those one-liners I gave earlier should do the job fine.
Its really simple.

start-nat.sh :
  ipchains -F forward
  ipchains -A forward -j MASQ -s 192.168.1.0/24 -d 0.0.0.0/0

stop-nat.sh :
  ipchains -F forward

Thats it, on a simple LAN, where 192.168.1.0 is you network address.
One line to add the NAT rule, one line to flush the 'forwarding' table.
Add some incoming and outgoing filters for local security if needed.

Is that all you needed? 

-- 
You ain't seen nothing yet.  - Miguel de Cervantes



More information about the plug mailing list