LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   SLES 10 as a router (https://www.linuxquestions.org/questions/linux-networking-3/sles-10-as-a-router-758916/)

tapke 10-01-2009 04:33 AM

SLES 10 as a router
 
Okey. here's my problem.

I have a server with SLES 10 SP2 in it. Two ethernets (eth0 and eth2).

I've googled for tons of manuals, tutorials and forums. However something's just not right.

Ok. Firstly, eth0 has to be external with dhcp. So it has ant IP 192.168.25.something. The server is already inside a lan, so I'm trying to make some kind of a sublan. The main lan is 192.168.10.x-192.168.255.255. The sublan is 192.168.1.0/24. The eth2 has static 192.168.1.1.

So here's what i've got:

I've enabled routing to default gw 192.168.25.1 (main lan gw).
I've connected a laptop to eth2 (for testing).
Maquerades are on (i suppose. i've edited the SuSEfirewall2 at sysconfig).
The laptop gets it's DHCP lease.
The server can freely connect to anywhere (only when eth2 is down)
But the laptop, can't even ping anything except 192.168.1.0/24

So I suppose the routing just doesn't work.

Here are some config's of the server:

http://p.defau.lt/?5GPcIrAT_CQqMq81SsVIXA
http://p.defau.lt/?mt0HAQFnA5DUMZ3K9BSUZw
http://p.defau.lt/?B6ditS7d4pokxSLJU2iSqg

Please, help me with it. i just can't find what's wrong.

___ edit __

i've changed the routing table that the default is on dev eth0 and the 192.168.0.0/16 dev eth2 to 192.168.1.0/24 dev eth0

DrLove73 10-01-2009 05:39 AM

First of all, you need to enable Ip forwarding to have routing in Linux. Read this post to learn how.

Next, if you plan on using routing with DHCP for "outside" connection, you need to use dynamic routing like RIP od OSFP, etc. on both your main gateway and SLES 10 (router), and maybe even on all "private" routers between you and last router/firewall that converts private IP's to public ones, or if you are not able to do so, only thing you can do is to masquerade (SNAT) your laptop (laptop will be registered as it is SLES 10, but no outside connection will access laptop if you do not redirect needed ports).

Also, only static route your SLES 10 needs to have is default route, delete all others, since he will know by default where to find your laptop. So basicaly, your problem is not with SLES or laptop, but with upstream routers know knowing where to find you. You are sending requests without returning address (as far as they are concerned).

Another warning: Using 192.168.1.0/24, the subnet that zillion users use daily is not very wise. If main gateway or some upstream router knows about some other 192.168.1.0/24 subnet, you will have real problem.

tapke 10-01-2009 06:17 AM

gh
 
the the main problem was, that I told dhcp server to assing users a /16 mask.

my external network was 192.168.10.1-192.168.255.255
and the internal 192.168.1.0/24

coputer simply didn't try to go trough router, because it thought my pinged IP was in it's subnet and all I could see was ARP's.

fixed the netmask and everything works.

Problem solved. Thank you.


All times are GMT -5. The time now is 12:42 AM.