LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Sharing a connection with a router. (https://www.linuxquestions.org/questions/suse-opensuse-60/sharing-a-connection-with-a-router-267108/)

KohlyKohl 12-16-2004 01:02 PM

Sharing a connection with a router.
 
Is it possible to share a dial up internet connection through a router? I recently switched to a wireless router from a switch, and the setup I had for that doesn't work anymore.

cjcox 12-20-2004 10:39 AM

I would think so. The router would reference the Linux box as the gateway.

So... 1st verify you can setup your Linux box as a gateway (between ppp0 and eth0 for example). Your ethernet cable would be plugged into your router (depending on the router you might need a crossover cable.. but likely a normal cable will suffice).

You can either give your router a static IP on the Linux side or you could even run dhcp (but that might be overkill since the router is likely the only thing that'll use it).

On the Linux gateway you'll have to have IP forwarding enabled and you'll probably have to masquerade (or NAT) thru the PPP interface.

It's likely that you can do most all of this through YaST with the SUSE firewall package (I think). I haven't tried to this with PPP, but I know I've done this establishing a router/gateway between ethernet segments.

KohlyKohl 12-20-2004 12:08 PM

Thanks for the help, but I was right what I was doing, but I mistyped an IP on the gateway computer. Really all you have to do is point your gateway to the computer with the dial-up internet and not use DHCP.

gd2shoe 12-21-2004 02:15 AM

There are two slightly different ways to do this. You are each talking about one of them.

One way (the way I would do it), would be to plug the linux box into the WAN port of the router. This is cjcox's method. Set the router's external IP address to something on the same subnet as the linux box's eth0, then set the router's gateway to point to your linux bridge (you probably would also need to enter your ISP's dns servers). Anything on the inside could then use DHCP easily.

The other way is to just do every thing on the LAN. Using the LAN ports, just set up everything as static. This is what KohlyKohl is doing. Point everything at the linux box instead of the router. In this setup, the router isn't routing, but is just acting as a switch (and wireless bridge).

The reason I would go for the first one is ease of adjustment and security. If I had more than 2 computers, or a friend brought over a labtop, I think it would be a little less hassle to add additional machines. Besides, if the internal machine is a MS Windows box, having NAT protection at the router would help keep some of the viruses out (the second solution doesn't use NAT, the first usually does, depends on the router). There are arguments to be made though, to not having them separated by NAT (file sharing gets trickier).

KohlyKohl 12-21-2004 11:58 AM

Yeah I would do it that way if I was worried about security. See as I live in the country and dont' keep my computers on and use dial up, I have almost nothing to worry about. If I lived in the city i'd take more precautions.


All times are GMT -5. The time now is 10:27 PM.