Problem routing internet though another pc

Hi all,

I have got problem when trying to route the internet though another pc, but i know its just me not doing something right. I did this on windows which was easy but cant work it out on opensuse/linux.

Heres what i got:-

two pc, one has windows(my mums) and one has opensuse (mine) and they connect to a switch which inturn is connect to one ethernet card (internal) on a pc which has a second ethernet card which is inturn connected to a router which that is connect to a cable modem then the internet.

This is what i done so far:-

router ip and the two ethernet card in the other pc are (from the router) and as the internal to the switch.

I know its something to do with the routing but cant work it out. What i tried is (one pc on switch) has the ip and the gateway is then gateway is then gateway is but it didnt work has no internet went though to the pc on the switch and its not the firewall has i have turned it off till i get it working.

If anyone can help, it will be great.


I can not help you route. But The first step would be to check your network from the linux side is working properly. You can do this easily from the Konsole or any terminal emulator.

As root:

Type: ifstatus

This will tell you if your network on the linux pc is up and running. You will get information about your IP’s etc and if they are configured properly.

For routing problems, you need to post both the IP addresses and the subnet mask, as IP address combinations which don’t work with one subnet mask could work with another subnet mask. Secondly, it would help to know how far down your network you can ping.

In short, your pc and your mother’s pc and the other pc’s ethernet card all on the switch should all be on one subnet eg ip = mask = [Note the 0 in the subnet mask aligns with the xxx bit of the IP address which you can choose for each connection to the switch. Also xxx must be greater than 0 and less than 255] Do this bit first and ensure that you can ping from each PC to both the others on the switch. Don’t go any further until this works.

Now repeat the exercise on the pc connected to the router and the router itself. Use a different subnet where xxx is as before, and yyy is different from the other subnet - ie not 10. Make sure that you can ping the router from the 2 ethernet pc at least. Again, don’t go any further until this works.

Now you can start to route. Turn on IP forwarding in the 2 ethernet pc and check that you can ping the router from both your pc and your mother’s [This pc itself is now a router, but we will still call it the 2 ethernet pc to avoid confusion]. Again, don’t go any further until this works.

You should now be able to set up the router if this is required. Now, on your pc and your mother’s, set the gateway to the IP address of the 2 ethernet pc, and on the 2 ethernet pc, set the gateway to the IP of your router. You should be able to surf.

This should be complete enough to get you going. Note that if you set the gateway on your pc and your mother’s to the IP address of the router, it can’t work, because these pc’s only know how to route to the immediate subnet,, so their gateway must be on this subnet. [Someone will be along to say that you could put a route to the gateway in the routing tables of your pc and your mother’s - which is true - but I am trying to do this with the most basic configuration requirements].

That’s a very detailed how to and will help paulie123 to fix his problem for sure. In addition whenever another system else will be connected to the switch the default gateway has to be defined and everything will work