Score:0

How to relay packets for another network to that interface (not a gateway or bridge)

cn flag

I have a server on two separate LANs: enp3s0 (10.0.0.5/24) and tun0 (10.8.0.5/24, openvpn client). I've configured the gateways on both networks to forward packets addressed to the other network to this server. How can I get this server to relay those packet to the other (correct) interface? I've tried all of the iptables stuff I can find.

The server is running Ubuntu Server 20.04.

in flag
The routing table is the main factor, see `ip route` if you need more fancy things you can also use `ip rule` but that is unlikely to be needed in your case.
Score:1
it flag

Did you activate kernel forwarding?

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

or

sysctl -w net.ipv4.ip_forward=1

Your box will act as a router, not as a workstation, and this behaviour is disabled by default, for security reasons! Be sure to permit forward for only legit network ranges from both of your nets using iptables.

jkoop avatar
cn flag
Yes, I activated kernel forwarding, but I never restarted the server. Maybe that's a problem?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.