View previous topic :: View next topic |
Author |
Message |
eule n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Apr 2003 Posts: 46
|
Posted: Sat Mar 20, 2004 10:03 am Post subject: iptables help |
|
|
Hi all!
I need some help with ip tables and so forth...
what i have is: a cisco router with internal lan adress 172.16.0.1
a gentoo linux server with 2 nic's: eth0 outgoing (attached to the cisco with 172.16.0.2) and eth1 (192.168.1.1) which goes into my network!
the gentoo linux box is an accounting machine which logs all traffic of all network users!
Ok: everything worked fine with masquerading until someone wanted to buy an official ip adress: well well well... how to masquerade e. g. the ip 192.168.20.21 to an official ip adress!
192.168.20.21 -> gentoo -> cisco -> official address and vice versa:
official address -> cisco -> gentoo -> 192.168.20.21!
Thx a lot for your help
eule |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
neilhwatson l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/gallery/Futurama/cartoon_futurama_morbo.gif)
Joined: 06 Feb 2003 Posts: 719 Location: Canada
|
Posted: Sat Mar 20, 2004 1:31 pm Post subject: |
|
|
You need a nat rule on the POSTROUTING table to set SNAT ip address. Check the documentation. It should look something like this:
Code: |
$IPTABLES -t nat -A POSTROUTING -o $INTERFACE -j SNAT --to $MYIP
|
_________________ The true guru is a teacher.
Neil Watson |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
eule n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Apr 2003 Posts: 46
|
Posted: Sun Mar 21, 2004 12:45 am Post subject: |
|
|
hi!
can you explain a bit deeper?
simple this is what I want: packet from 192.168.40.40 (internal lan) comes to my gentoo box - has to go through my gentoo box and comes to my router which translates the adresses to several public ip adresses! I don't want to masquerade!!!! The IP address which comes to the router should still be 192.168.40.40
thx
eule |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|