PDA

Bekijk de volledige versie : Making computers from behind the router accessible on the internet.



lordbone
24-07-2008, 16:19
Hi there.

I know the topic sounds a bit strange, but here is what i want to do. Let's say, for example, that i have 3 external internet ip`s (xxx.xxx.192.15 / xxx.xxx.192.16 / xxx.xxx.192.17 ), and 3 computers -> Windows / Linux / FreeBSD.

Ok, i set up the router with the ip xxx.xxx.192.15, but now all my computers (Windows, Linux, FreeBSD) have ip`s in the range of 192.168.1.0/24 . The idea is that I need the xxx.xxx.192.16 ip forwarded to the linux box, and xxx.xxx.192.17 to the Windows box, and the rest (FreeBSD box + Other wireless devices on DHCP via the router's external IP in the private class of 192.168.1.0/24.

Thing is that port forwarding to the machines is not enough. I don`t really know static routing that much, but the way I figured it, I`ve got two options:

1. Either i put a switch with no management in front of the router with 3 ports (for Linux, Windows, Router), but I wouldn`t want to use this, unless I can`t find another option.

2. Transporting my internet provider`s VLAN through the router to the Linux & Windows boxes, which, sadly, I don`t know how to do that yet.

So.. any1 got any ideas on how to do this, a link, a tutorial, an idea, anything ??
Anything would be appreciated.

Cheers...

darius
24-07-2008, 18:19
Hi,

mayby you can test

iptables -t mangle -A PREROUTING -s 192.168.1.0/24 -j NETMAP --to 10.5.6.0/24

mapping private with public addresses (got it now from the net)

You can try to run this rule from command line


another option

Option --to-ports
Example iptables -t nat -A POSTROUTING -p TCP -j MASQUERADE --to-ports 1024-31000
Explanation The --to-ports option is used to set the source port or ports to use on outgoing packets. Either you can specify a single port like --to-ports 1025 or you may specify a port range as --to-ports 1024-3000. In other words, the lower port range delimiter and the upper port range delimiter separated with a hyphen. This alters the default SNAT port-selection as described in the SNAT target section. The --to-ports option is only valid if the rule match section specifies the TCP or UDP protocols with the --protocol match.

darius



Hi there.

I know the topic sounds a bit strange, but here is what i want to do. Let's say, for example, that i have 3 external internet ip`s (xxx.xxx.192.15 / xxx.xxx.192.16 / xxx.xxx.192.17 ), and 3 computers -> Windows / Linux / FreeBSD.

Ok, i set up the router with the ip xxx.xxx.192.15, but now all my computers (Windows, Linux, FreeBSD) have ip`s in the range of 192.168.1.0/24 . The idea is that I need the xxx.xxx.192.16 ip forwarded to the linux box, and xxx.xxx.192.17 to the Windows box, and the rest (FreeBSD box + Other wireless devices on DHCP via the router's external IP in the private class of 192.168.1.0/24.

Thing is that port forwarding to the machines is not enough. I don`t really know static routing that much, but the way I figured it, I`ve got two options:

1. Either i put a switch with no management in front of the router with 3 ports (for Linux, Windows, Router), but I wouldn`t want to use this, unless I can`t find another option.

2. Transporting my internet provider`s VLAN through the router to the Linux & Windows boxes, which, sadly, I don`t know how to do that yet.

So.. any1 got any ideas on how to do this, a link, a tutorial, an idea, anything ??
Anything would be appreciated.

Cheers...

lordbone
24-07-2008, 19:49
Thanks for replying.

That's the thing though, I don`t wanna do NAT, i want to do ip forwarding. Question is how to do it on oleg`s firmware ? Don`t know if iptables can.