
Issue with routing
JanHolger opened this issue ยท 12 comments
Hey, i've been playing around with the mod the last 2 days and wanted to setup a simple routing lab. Since you added the side selection for network cards I thought this should be easy but net.ipv4.ip_forward doesn't seem to work in the stock kernel.
My setup has 2 clients on different subnets and a router in between.
Client 1:
# ip route
default via 10.1.0.1 dev eth0
10.1.0.0/24 dev eth0 scope link src 10.1.0.2
Client 2:
# ip route
default via 10.2.0.1 dev eth0
10.2.0.0/24 dev eth0 scope link src 10.2.0.2
Router:
# ip route
10.1.0.0/24 dev eth0 scope link src 10.1.0.1
10.2.0.0/24 dev eth1 scope link src 10.2.0.1
# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
The router can reach the clients but the clients can't reach each other because the router doesn't seem to forward packets.
Well normally turning net.ipv4.ip_forward on is sufficient for enabling packet forwarding under Linux. Unfortunately i'm not too familar with any internal kernel stuff so I'm not sure where the problem lies. I've seen somebody get it running on a custom kernel version but it would be good if it would also work on the stock kernel.
in order to do ip route you need net.ipv4.ip_forward enabled in the kernel and you will also need to run echo 1 > /proc/sys/net/ipv4/ip_forward
to tell the kernel you want to use it then your ip routing should work.
in order to do ip route you need net.ipv4.ip_forward enabled in the kernel and you will also need to run
echo 1 > /proc/sys/net/ipv4/ip_forward
to tell the kernel you want to use it then your ip routing should work.
As you see from the sysctl output, i've already enabled it but it still doesn't forward packets.
just opened up a test world and i found out that you cant have multiple Network Interface Cards in a single computer and have them work correctly but using link cards i was able to get this working without messing with any of the routes, i just set the ips for the 2 router interfaces and the 2 clients and just enable ip forwarding on the router and i got the two client able to talk to each other
Since #53 got resolved and network cards can now be configured to only work with specific sides, you can definitely have 2 network interfaces in a single computer and that on itself was working totally fine. The router was able to reach both devices, it just doesn't seem to forward between network cards. I just tested linked cards and they seem to be actually working so I guess it's an issue with the network card driver.
When using a linked card on one side and a network card on the other side it's working aswell just using network cards for both directions isn't.
When using a linked card on one side and a network card on the other side it's working aswell just using network cards for both directions isn't.
Wait what? Do I understand this correctly, the "router" has a network card and a tunnel card in it, and then routing works? That's very unexpected, because on the level Linux sees, both are the exact same device type (VirtIO Network Device). So there should be no difference to using NIC+NIC or NIC+NTC.
should of read the manual didnt know you can configure the sides of the network cards... but now knowing that i tested it with the network cards instead of link cards it still works
Just to confirm this worked for me on the curseforge build and the latest commit
I tried to repro this. Given the example above, i.e. two different nets with default route through the router, worked for me, also. Used regular network cards, configured to once connect to the left, once to the right. Please double-check your setup, and if it still fails, provide a more detailed, step by step repro, thanks!