0

Yes I know it's a duplicate of many questions but I can't find my solution to them. I have a host virtual machine (ubuntu 16.04) that has two network adapters. one of them is connected to the gateway(so it has internet). but another one is just connected to the same port group as the first one. so diagram is something like that:

ubuntu ---
         |
         | ens160(136._.222) ---gateway(136._.209)---> internet
         | ens192(148._.177) ----->

So the question is, How can route all requests from subnet ens192 to the internet?

UPDATE: I enabled IP forwarding with this line:

sysctl -w net.ipv4.ip_forward=1

and set route like this:

ip route add 148._.176/29 via 136._.209 dev ens160

or

ip route add 148._.176/29 via 136._.222 dev ens160

but I get this message: RTNETLINK answers:FILE EXIST

  • What is "the same port group"? Do you have any knowledge about routing? –  Aug 14 '21 at 13:13
  • port group on VMWare ESXi. you can define a virtual switch and connect some IPs virtually. A little about routing. what I want to do is for them to connect to the internet that is on the gateway ****209. – Hassan Yousefzadeh Aug 14 '21 at 13:28
  • You don't need additional route for different sources on the forwarding host. Rather you need that on the "gateway" for the replying traffic to get to those sources (with the forwarding host as the nexthop/gateway). – Tom Yan Aug 15 '21 at 10:25
  • I guess you don't get my mean .I need to route another NIC to that one that has internet – Hassan Yousefzadeh Aug 16 '21 at 18:08

0 Answers0