0

I have a machine (machin-A (Ubuntu 18.04)) with two NIC's. one is eth0 and the other eth1. eth0 connected to the company subnet. eth1 connected to a second Linux machine (Machine-B) . both physical machines.

i need to traffic information from machine-B to machine-C that is also connected to company subnet

How can i do that?

  • We need way more information about the network topology here to be able to answer properly. Specifically how these subnets relate to access to other networks/internet. – hardillb Nov 04 '20 at 13:39
  • 1
    Also you probably should not be extending your companies network without talking to who ever manages that network. – hardillb Nov 04 '20 at 13:46
  • i just want to add a route inside machine-A, so machine-B which directly connected to eth1 on machine-A can ping machine-C via eth0 of machine-A. i hope its clear because its sounds confusing – koby058 Nov 04 '20 at 14:16

1 Answers1

1

Simplest is to set up NAT on machine A, but that assumes that C doesn't need to start a connection to B. This means that any traffic from B will look like it's coming from A to any machine on the company network.

To do this you need to allow IPv4 routing (net.ipv4_ip_forwarding = 1) and setup MASQUADE with iptables.

The other option is to bridge eth0/eth1 then B will appear on the same network as both A & C.

hardillb
  • 1,552
  • 2
  • 12
  • 23