4

I have an ISP billing system installed on Debian GNU/Linux 8, which has 3 NIC cards. The Server is connected to 3 Mikrotik routers. Each router is connected to different internet lines which means they have 3 different static public IP subnets.

Currently the server is connected to router1 172.10.1.1/24 directly via eth0. the other two routers are reachable via the internet, but we have issue reaching them sometimes due to internet outage.

This is the current network diagram:

enter image description here

I have configured eth1 and eth2 and connected directly to the router2 and router3 respectivly using the following answers/guides:

Is it possible to have multiple default gateways for outbound connections?

https://www.thomas-krenn.com/en/wiki/Two_Default_Gateways_on_One_System

I have configured them exactly according to the above links but I was not successful yet. All the 3 networks stopped communicating, even router1. I have been forced to rollback.

What I would like to achieve is connecting all three routers directly to the Server so that they can communicate locally.

1

To achieve what you want, which is allowing the tree routers to communicate locally via the server, you have to Enable IP Forwarding on that server so you can use it as a router to connect different networks together.

To do that (without rebooting the system):

sysctl -w net.ipv4.ip_forward=1

or

echo 1 > /proc/sys/net/ipv4/ip_forward

the setting is changed instantly; the result will not be preserved after rebooting the system.

Permanent setting using /etc/sysctl.conf

If we want to make this configuration permanent the best way to do it is using the file /etc/sysctl.conf where we can add a line containing net.ipv4.ip_forward = 1.

| improve this answer | |
  • Mhd thanks for your prompt answer. Should I implement first the above guideline and then enable IP forward? – Hirmoge Mar 11 '17 at 14:20
  • @Hirmoge you welcome, The answer is in general, to make the server work as a router no matter of what you want to do. – Wissam Roujoulah Mar 11 '17 at 14:30
  • I have enabled with out success. I cant ping either router1 or the other two when I add static IPs and enable ip forward. – Hirmoge Mar 12 '17 at 9:52

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.