Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Serious Iptables/routing question
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
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Thu Jun 29, 2006 5:30 pm    Post subject: Serious Iptables/routing question Reply with quote

Hi,

I wonder if anyone could help me with the following question I have.

http://img407.imageshack.us/img407/7796/problem7on.jpg

Facts:
=====
Firewalls Default route is 196.23.0.1
The Servers default gateway is 192.168.0.1
By default, incoming traffic will come over the diginet line.

What I want to achive:
===============
if incoming traffic has the destination IP 196.23.0.12, NAT to 192.168.0.20
the reply packets will obviously be sent back out through the diginet line.

If the server makes its own internet request (say u open a page on the server using lynx)
The firewall must push the connection out via the adsl line and NOT the diginet line.

or even better

if the server makes a connection to a specific host or network on the internet,
the firewall must route that connection out via the adsl, and not over the diginet line.

Whats working already:
===============
Now I have the diginet line side of things working already, its the adsl side of things that i need some help with?

thanks
Dave
Back to top
View user's profile Send private message
expat_iain
Guru
Guru


Joined: 09 Jan 2004
Posts: 361
Location: Malta GC

PostPosted: Thu Jun 29, 2006 5:49 pm    Post subject: Reply with quote

You need to tell the firewall to set the next hop address to 192.2.0.1 for traffic originating from 192.168.0.20 to destination w.x.y.z. Take a look at iproute2.

Iain.
Back to top
View user's profile Send private message
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Thu Jun 29, 2006 6:18 pm    Post subject: Reply with quote

normally i would do it like that,

but i was thinking of using the geoip patch and the route patch and doing something like this:

iptables -A PREROUTING -t mangle -m geoip --dst-cc US -i LAN -s 192.168.0.20 --j ROUTE --gw 196.2.0.1

would that work?

or would it stuff up any incoming packets that are coming into the server over the diginet line?
Back to top
View user's profile Send private message
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Sat Jul 01, 2006 8:20 am    Post subject: Reply with quote

no body have an idea about this?
Back to top
View user's profile Send private message
expat_iain
Guru
Guru


Joined: 09 Jan 2004
Posts: 361
Location: Malta GC

PostPosted: Sat Jul 01, 2006 9:20 am    Post subject: Reply with quote

Try it out.
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