Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables: howto forward to different gateways

Reply
Thread Tools Display Modes

iptables: howto forward to different gateways

 
 
cyberroadie@gmail.com
Guest
Posts: n/a

 
      06-02-2005, 12:58 PM
Hello,


I'm trying to route all trafic from a private (nat) network to an adsl
connection (214..),
the default gateway on my machine is 10.10.0.254 (of the corporate
network) because I need that for my normal desktop tasks
email/intranet/browsing.


Code:

NAT network My Machine
|192.168.0.10|-------|192.168.0.1|eth1:
|10.10.0.100|eth0:---corporate
mw/proxy---|gw:10.10.0.254|-->

|214.1.1.200|eth2:---adsl------------------|gw:214.1.1.81|-->


I'm using iptables to set this up and come up with this so far:

iptables -F
iptables -t nat -F

iptables -A FORWARD -i eth1 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE

But this forwarding is not working since my default gateway (on My
Machine) is pointing to the corporate network.

I don't want to change the default gateway, all trafic from 'my
machine' has to go via the corporate network (something todo with my
developer tools I'm using and other machines wich trafic are routed via
my machine, all that traffic has to go through the firewall/proxy).

I only want traffic _from_ eth1 forwarded _to_ eth2 . No other traffic
is allowed to use the adsl connection.

How can I configure this, do I need an extra iptable rule or do I need
to alter my routing table (and if so how)?

Cheers,


Olivier

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables port forward question Ken Williams Linux Networking 2 07-21-2006 08:55 PM
need help on port forward using iptables. jsuthan Linux Networking 7 01-21-2006 01:53 AM
Looking for iptables applications code (iptables.c) to run some rules to forward packets tvnaidu@yahoo.com Linux Networking 2 01-17-2005 05:01 PM
iptables: mac-source and FORWARD zacWonder Linux Networking 1 11-28-2003 03:14 PM
iptables - url forward soraya soch Linux Networking 0 11-02-2003 09:40 AM



1 2 3 4 5 6 7 8 9 10 11