0

I have 4 nodes, each nodes have 4 ports. I want connect them without switch like a ring. My topology is looks like: enter image description here The eth2 and eth3 is down.

My problem is,

if I am in node2, I can ping node1, but I can't ping node3;

if I am in node3, I can ping node4, but I can't ping node2;

if I am in node4, I can ping node3, but I can't ping node1;

if I am in node1, I can ping node2, but I can't ping node4;

Here are my configurations: System: CentOS 6.5 Full installation

I use /etc/sysconfig/network-scripts/ifcfg-eth0 to set static ip for port 0 and so on.

`DEVICE=eth0
TYPE=Ethernet
UUID=xxxxxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=10.0.0.101
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no
HWADDR=xxxxxxxxxxxx
IPV4_FAILURE_FATAL=yes
NAME="System eth0"`

The IP for node 1 is 10.0.0.101, 10.0.0.102, 10.0.0.103, 10.0.0.104
       for node 2 is 10.0.0.105, 10.0.0.106, 10.0.0.107, 10.0.0.108
       for node 3 is 10.0.0.109, 10.0.0.110, 10.0.0.111, 10.0.0.112
       for node 4 is 10.0.0.113, 10.0.0.114, 10.0.0.115, 10.0.0.116

And my routing table is like:

10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth2
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth3
169.254.0.0     0.0.0.0         255.255.0.0     U     1004   0        0 eth2
169.254.0.0     0.0.0.0         255.255.0.0     U     1005   0        0 eth3

And my /etc/sysctl.conf

net.ipv4.ip_forward = 1

net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.all.rp_filter = 2

net.ipv4.conf.default.accept_source_route = 2
net.ipv4.conf.all.accept_source_route = 2

The error message of ping is "Destination host unreachable",

  • 1
    I am at a lose for words. "IT. DOESN'T. WORK. LIKE. THAT." Is so totally inadequate. You appear to have the impression everything is a bridge. (it's not, until you configure it to be.) – Ricky Beam Jul 22 '16 at 20:23
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 14 '17 at 22:21
7

You have all your interfaces in the same subnet. That is not going to work. Your computer can't figure out which interface to use to send to each host because it believes they are reachable from any interface.

If you insist on this configuration, make each link a different subnet. For the node 1-2 link, use 10.0.1.0/24; for the node 2-3 link, use 10.0.2.0/24; etc.

| improve this answer | |
  • His physical setup will work, yet this wrong answer is voted up pretty highly. Notice my answer, the correct one is voted down pretty low...? Telling isn't it. – Ronnie Royston Jul 22 '16 at 18:05
  • 3
    @RonRoyston Your answer was long after the other two, simply repeats what they said, and adds in irrelevant nonsense about Cisco IRB (where in any of the question was Cisco ever mentioned?) And then provide two links of debatable value. – Ricky Beam Jul 22 '16 at 20:28
  • I never saw any other answer and the unix.stackexchange.com/questions/86056/… link tell the guy how to do it. Stop trolling bro. This answer is wrong. Telling the guy about Cisco IRB points him to info relating to the concept. – Ronnie Royston Jul 22 '16 at 20:58
  • Where in the U.SE does it tell him how to setup a bridge? How does Cisco IRB help him setup a bridge ON LINUX? Your answer came 6hrs and 2hrs later, so don't try to tell me you "didn't see any other answer". (SE tells you when an answer is posted while entering your own answer.) – Ricky Beam Jul 25 '16 at 20:11
5

If You need all nodes to work in one subnet and one L2 broadcast domain,

add bridge interface, enable rstp on it, assign IP on bridge interface and add physical interfaces to bridge.

/etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=br0
TYPE=Bridge
STP=on
MACADDR=xxxxxxxxxxxx
IPADDR=x.x.x.x
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=static
USERCTL=no
NM_CONTROLLED=no
DELAY=0
IPV6INIT=yes
IPV6_AUTOCONF=yes

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=xxxxxxxxxxxx
TYPE=Ethernet
UUID=xxxxxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
USERCTL=no
PEERDNS=yes
IPV6INIT=no
BRIDGE=br0

In ring topology RSTP is much better. STP in ring topology can enter in infinite topology rebuilding. RSTP in linux supported as rstpd daemon, but Im not sure it well supported and newer configure in in generic Linux. In Linux kernel based RouterOS, RSTP work perfectly.

| improve this answer | |
-3

You need to enable bridging. On Cisco devices Integrated Routing and Bridging would be the fix here. You'll have to check your OS documentation but looks like linux should be able to do it.

https://unix.stackexchange.com/questions/86056/why-does-linux-require-moving-ip-from-eth-interface-to-bridge-interface

https://wiki.linuxfoundation.org/networking/bridge

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.