0

I am trying to setup a simple network (refer to this image) on my new Clearfog Pro. I have a debian distro installed on this board. Right now I have one computer (pc2) connected to the Clearfog (pc1), but I am planning to add more.

My goal with this network is to connect pc2 to the internet and all the other computers in the lan and wan network. But I have a hard time achieving this goal.

The board has two interfaces:

  • Eth0: 192.168.178.201/24 connected to the main router and internet.
  • Eth1: 192.168.177.1/24. this board has 6 lan interfaces connected to it.

On pc1 I enabled ip forwarding and added routes like this:

ip route add default via 192.168.178.1 dev eth0
ip route add 192.168.178.0/24 via 192.168.178.201 dev eth0
ip route add 192.168.177.0/24 via 192.168.177.1 dev eth1

On pc2 I added a static ip and default gateway as shown in the picture.

I can ping 192.168.178.201 and 192.168.177.1. If ping 192.168.178.2 I can see that it hopped to 192.168.178.201 but then gets stuck.

On pc2 I cant ping the default gateway. I dont know if this is supposed to happen.

-----EDIT 1-----

I think there is something wrong with the configuration of the Clearfog Pro. Its blocking connections on eth1 but the leds are still showing something is going on.

1 Answer 1

2

First – your default route is wrong. The via needs to point at the next-hop gateway (from pc1 it's 192.168.178.1) but for some reason you're pointing it to pc1 itself. So the first line should look like:

ip route add default via 192.168.178.1 dev eth0

Actually, all your routes essentially translate to "forward this through myself". That's redundant (pc1 already got the packet, why would it loop it back through pc1 again?) and more importantly sounds like a recipe for infinite loops. Thus, in the 2nd and 3rd lines, first get rid of the via parameter:

ip route add 192.168.178.0/24 dev eth0

However, you're trying to add subnet routes identical to what the OS already has. That's the whole point behind having configured a "subnet mask" – if your IP address is 192.168.178.201/24 on eth0, then you automatically have a route for 192.168.178.0/24 via eth0.

In other words, for your current network you only need to manually the first (default) route. "Local subnet" routes will be added automatically.


Second – the gateway must have a route back to pc2 via pc1. Since the ping requests come from a different subnet, it doesn't automatically know where to send replies, therefore it also needs a static route added.

How to do it depends on the gateway's software, but in iproute2 terms it would look like:

ip route add 192.168.177.0/24 via 192.168.178.201

And as a side note, forget about those "network" and "bcast" parameters. They're already determined automatically from the /24. There's usually no need for configuring them by hand – only more opportunities to make typos and mistakes.

2
  • oh yeah the default gateway was a typo in the post i fixed that sorry. But it still didn't fix I was having. I think its a problem with pc2 not being able to ping its default gateway. I mean that should be possible right? Commented Sep 9, 2016 at 16:50
  • @MaartendeKlerk: Updated the reply; I'd forgotten half of it. Commented Sep 10, 2016 at 13:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .