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