0

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 ~]#
  • You don't route when hosts are in the same subnet. What you need is switching. – vidarlo Jan 29 '22 at 08:41
  • 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. – A.B Jan 29 '22 at 22:19
  • 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. – Rohit Singh Jan 30 '22 at 06:02

1 Answers1

0

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.
Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • 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 Jan 29 '22 at 11:26
  • One more thing which I would like to highlight that I disabled firewall on each server and enable IP forwarding on Server B. – Rohit Singh Jan 29 '22 at 11:31
  • Route on server C is for `192.168.16.0/24` network, but server A is in `192.168.10.0/24` network. – Tero Kilkanen Jan 29 '22 at 12:26
  • 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 Jan 29 '22 at 12:55
  • 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. – Rohit Singh Jan 29 '22 at 12:58