Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
eule
n00b
n00b


Joined: 10 Apr 2003
Posts: 46

PostPosted: Sat Mar 20, 2004 10:03 am    Post subject: iptables help Reply with quote

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
View user's profile Send private message
neilhwatson
l33t
l33t


Joined: 06 Feb 2003
Posts: 719
Location: Canada

PostPosted: Sat Mar 20, 2004 1:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
eule
n00b
n00b


Joined: 10 Apr 2003
Posts: 46

PostPosted: Sun Mar 21, 2004 12:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum