Multiple Ethernet - DNS not functional

Any Ideas how to get two nics working with DNS on the PI running emteria?

I tried this with a pi3 and a pi5. Once I setup the secondary NIC, I lose DNS resolution. I'm expecting that once I restore access to the 192.168.0.0/24 network that I would be able to reach the defined dns server (192.168.0.153), but this is not happening over either NIC.

(short version: I ran tcpdump on each NIC from external devices to watch what was happening with the traffic - once I got the second nic working, DNS stops working.)

I plug in a USB3 gigabit NIC to get eth1, where the built in nic is eth0. eth0 is DHCP:

This is how I setup the second nic by hand for now:

get an adb shell

adb shell

get root

sushell

I then give the gigabit nic an ip, using this trick of having to set it twice for it to take for some reason (this is true regardless of which method be it ifconfig, ip, or ndc):

for x in 1 2;do ndc interface setcfg eth1 192.168.2.1 24;sleep .2;done

show that the address took on eth1:

ip a s eth1

at this point I would expect to be able to ping things on the 192.168.2.0/24 network, but that is not functional.

this is what I am doing to get around that:

create a new network

ndc network create oem1
ndc network interface add oem1 eth1

eth1 table variant:

looking at "ip route show table 0", it will show eth0 has a table eth0, but not eth1.

so make the eth1 table:

ip route add 192.168.2.0/24 table eth1 dev eth1 proto static scope link

add the performance networks route - it must be on the eth1 table:

ip route add 198.18.0.0/15 via 192.168.2.10 table eth1 dev eth1

since we're using the eth1 table, add the eth0 routes

ip route add 192.168.0.0/24 table eth1 dev eth0
ip route add default via 192.168.0.1 table eth1

set the default network domain to 1 (normally 0), which will let android intiate over eth1:

ndc network default set oem1

make a static arp for the server

may have to ping first to do this (otherwise will get RNETLINK answers: No such file or directory)

ip neighbor change 192.168.2.10 lladdr 6e:2a:21:ab:cd:ef dev eth1

now the server can be pinged quickly

ping 192.168.2.10

but dns wont work - this will fail to resolve to an IP, but does work before I mangle the networking:

ping www.cisco.com

things I've tried:

originally the network was named eth1, I switched to calling it oem1 after digging through android source a bit and finding the special oemX network handling. Didn't seem to matter for this though.

I tried setting STATIC ip on eth0, where I could in theory change DNS, but for some reason emteria's app wont set static on the pi5

I tried lineageOS and it does nearly the same thing, except of course how it handles the static IP config on ethernet (wherein it just doesn't allow that, which is annoying.)

Sign In or Register to comment.