Re: NAT problems
Tobias Geijersson <firstname.lastname@example.org> writes:
> The problem is that when I add the rule for masqurading it translates
> all 192.168.10.1/24 to eth0's 192.168.2.254 before routed to my ip
> provider, and that adress is a private one and will not work!
> How do I solve this in kernel 2.2?
I'm not sure I entirely understand your dilema but it should be possible
under 2.2. You need to use the iproute2 package and have an appropriately
compiled Linux kernel.
I've used policy routing in a few places and it enables you to masquerade/NAT
as any address you like.
ip rule add from 192.168.10.0/24 nat 220.127.116.11
If you router's default gateway is on an interface other than the one to
which you wish to NAT then you may have to set up a custom routing table for
ip route add default via 18.104.22.168 table 192
ip rule add from 192.168.10.0/24 lookup table 192 nat 22.214.171.124
This has the effect of routing all your externally destined packets arriving
from the 192.168.10.0/24 network to your 126.96.36.199 router with a source address
of 188.8.131.52 ... 184.108.40.206 must actually be an address assigned to you Linux box.
Note you will probably have to add throw routes for your local networks to
the new routing table you created so that local traffic works correctly.
We use this in a location with 4 different Internet connections (DSL/T1) and
route different private IP servers out the different gateways ... it works
fraser campbell <email@example.com> starnix inc.
tollfree: (905) 771-0017 thornhill, ontario, canada
http://www.starnix.com/ professional linux services & products
- NAT problems
- From: Tobias Geijersson <firstname.lastname@example.org>