Score:0

Routing issue between linux machine

tn flag

Hi I have 3 linux servers deployed on Openstack cloud on same network.

Server A -----> Server B ------> Server C

  • Each server private IP address range is 192.168.10.x/24.

All 3 servers are communicating to each other on 192.168.10.x IP range. I want Server A should forward the traffic to Server B if it belongs to Server C and vice versa.

For that I made a static route on Server A that If a destination is Server C sent it via Server B and for that traffic created the same reverse route on Server C.

The issue is, if we add this specific route, communication between Server A and Server C stops. I can see the packets on Server B but it is not going trough to Server C.

I tried to enable IP forwarding on each server but the issue remain same.

[root@serverB ~]# cat /proc/sys/net/ipv4/ip_forward
1
[root@serverB ~]#
vidarlo avatar
ar flag
You don't route when hosts are in the same subnet. What you need is switching.
A.B avatar
cl flag
A.B
I reproduced your setup successfully using 4 network namespaces (the 4th being a bridge to link the other 3 for A B and C). This shouldn't be done, but it should work. Server B will route/forward packets *and* issue back ICMP redirect packets because it detects it shouldn't be used to route two nodes in the same LAN. So if your server B doesn't do this, there's something else involved, either on B, or on the openstack environment. You should add the exact way you set things up in your question so it can be reproduced. And of course, here being serverfault, explain WHY you'd do this.
Rohit Singh avatar
tn flag
I understand your point because all servers are in the same subnet due to this, server B not able to route the packets properly. But I tried to change the routes and IP address which is mentioned in trail discussion but it also not worked, Ideally with the new IP and route setup there should be no issue between server A to Server C communication . I believe either the logical switch on openstack is causing some issue or there will be some additional configuration require at Server B end.
Score:0
us flag

You need to put server B and server C into their own subnet 192.168.11.0/24.

Server A and server B remain in 192.168.10.0/24.

For this, you need to have two interfaces in server B, which are connected to two different Ethernet networks.

After this, you can set up B to forward packets between A and C.

You also need to set up routing tables accordingly on A and C:

  • On A, you need to configure that packets going to 192.168.11.0/24 should be sent via B.
  • On C, you need to configure that packets going to 192.168.10.0/24 should be sent via B.
Rohit Singh avatar
tn flag
I tried to put Server B and Server C in in different network `192.168.24.0/24` but still Not getting the communication through between Server A and Server C . Here is my server configuration. `Server A (ETH1 - 192.168.10.24) ----> (ETH1 - 192.168.10.26) Server B (ETH2 - 192.168.24.17)------>ServerC (ETH2 -192.168.24.8)` Routing on `Server A -->192.168.24.0/24 via 192.168.10.26 dev eth1` Routing on `Server C -->192.168.16.0/24 via 192.168.24.17 dev eth2`
Rohit Singh avatar
tn flag
One more thing which I would like to highlight that I disabled firewall on each server and enable IP forwarding on Server B.
us flag
Route on server C is for `192.168.16.0/24` network, but server A is in `192.168.10.0/24` network.
Rohit Singh avatar
tn flag
Sorry my bad, it was typo error correct routing on Server C is `192.168.10.0/24 via 192.168.24.17 dev eth2`
Rohit Singh avatar
tn flag
One more thing, Server A should ideally ping the interface IP `192.168.24.17` of Server B if I made a route on server A for `192.168.24.0/24` network, but it is also not happening.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.