On Sep 14, 3:38 pm, Allen Kistler <ackist... RemoveThis @oohay.moc> wrote:
> neune... RemoveThis @yahoo.fr wrote:
....
> > Now I want to do something more complicated...
>
> > I am renting a dedicated Linux server, at a fixed public IP, say at
> > IP 213.186.33.33 (just an example, it's not its real IP) which host,
> > amongst other things, my company's website / webapp.
>
> > I now want to access the Internet from my iMac while having the
> > trafic to appear to come from the dedicated server I'm renting.
>
> > How should I go about setting up such a scheme?
>
> Do you mean you want the traffic to go through the public server? Or
> you just want the iMac to have its address natted to a server at another
> site?
I guess the later but I'm not sure I understand the difference between
the two.
I'd like to have the dedicated Linux server I'm renting do to my iMac
what
my home Linux system is currently doing: any traffic emitted from my
iMac
appears to come from my home Linux machine. That home Linux machine,
because it is setup to do SNAT/masquerading, knows how to correctly
re-route incoming packet to the iMac.
So I'd like to set the public IP of the dedicated Linux server I'm
renting as
the router for the iMac.
Would a route like the following be doable on the iMac:
213.168.33.33 10.0.0.39 0.0.0.0 UG 0
0 0 eth0
0.0.0.0 213.168.33.33 0.0.0.0 UG 0
0 0 eth0
So that any traffic from the iMac to the Internet passes through
the Linux dedicated server (at 213.168.33.33) but then I can tell how
packets from my iMac can first reach 213.168.33.33 (through 10.0.0.39,
which is my home Linux 'router').
Is this technically doable? And if not why not?
> For the first, another poster suggested a proxy. You could also set up
> a VPN using something like OpenVPN or OpenSWAN.
>
> For the second, which is how I read your question, it won't work.
> Internet routers won't know to route your return traffic back to you.
> They'll send it to the other site.
By "the other site", do you mean the Linux dedicated server?
Because I can configure that one to do SNAT/masquerading and so
traffic could be re-routed to my iMac?
For example if my DSL router gets the public IP 85.62.90.182, I was
planning to do the following on the dedicated Linux server:
iptables -t nat -I POSTROUTING -s 85.62.90.182 -d ! 213.168.33.33 -j
MASQUERADE
I hoped I could do the following :
- iMac wants to send a packet to the Internet
- iMac looks at his route and see he must use 213.168.33.33 as the
router
- iMac looks at this route and see that to reach 213.168.33.33 he must
pass through 10.0.0.39
- 10.0.0.39/85.62.90.182 SNAT iMac's packet and sends it to
213.168.33.33
- 213.168.33.33 SNAT the packet from 85.62.90.182
- 213.168.33.33 sends the reply back to 85.62.90.182
- 10.0.0.39/85.62.90.182 sends the packet back to the iMac
Thanks a lot for helping me figuring this out, I'm no network guru
and thought it was "easy" to do such a thing
