0

I have two networks, one being the main, with a network card eth1 (found on an Ubuntu Server 18.04 configured to be a router) and internal IP address 192.168.5.1 (with is the gateway) and another network in different location, but connected together via a link provided by the internet service provider, with an interface card named ethx1, also on an Ubuntu Machine configured to be a router, and an internal IP address 192.168.6.1 (which is equally the gateway). Each Ubuntu machine has a second network interface card. The Ubuntu machine resident on the main network has eth2 as the second NIC with an internal IP address of 192.168.5.2. The Ubuntu machine on the other network has ethx2 with an internal IP address of 192.168.6.2.

I would like to use iptables to forward packets between the two networks. How do I do this? Currently, I cannot ping into either network directly.

  • 1
    You need to describe your network morecflearly. Also, you may have an XY problem - why does this need to be done with iptables (which is the wrong tool for the job) – davidgo Aug 07 '20 at 09:12
  • Are you able to recommend a better tool for the job and how it can be achieve? Also, I can currently see move packets between the two points but only between the two gateways but not from either network to which each of the gateways are attached to. What details would be needed for better clarity? – Twambo Kalumba Aug 07 '20 at 09:42
  • If you can clarify the internal **and external** IP addresses and netmasks of the Linux routers/boxes, the route tables on them, traceroutes to 8.8.8.8 from each box if on the Internet or advice if this ISP link is only a peer to peer link (and if its Ethernet). – davidgo Aug 07 '20 at 11:03
  • 1
    Appropriate tools could include correcting your routing tables, setting up forwarding in the kernel, using a site-to-site VPN. – davidgo Aug 07 '20 at 11:04

0 Answers0