Getting internet via the RDNIS connection

As much as I love linux, I hate linux networking. I’m trying to get my Duo connect to the internet via the RDNIS and sharing my laptop wifi connection. What I’m looking for is a simple way to do get it done. I’ve used nftables once on my server but that was a year ago and I havn’t touched it since. My laptop is using iptables-nft or UFW and it says not to edit the nftables anyway. After getting lost in iptables I installed UFW hoping it would be straight forward. Is UFW a good approch to avoid getting elbows deep into iptables/nftable? With the routes I added below I can ping my laptop at the wifi card IP (192.168.0.122) but I can’t ping my wifi router (192.168.0.1) or anywhere beond that from the Duo.

I set these UFW rules on my laptop . (debian)

Status: active

     To                         Action      From
     --                         ------      ----
[ 1] Anywhere on wlp2s0         ALLOW FWD   Anywhere on enx3eebd35d9958
[ 2] Anywhere on enx3eebd35d9958 ALLOW FWD   Anywhere on wlp2s0        
[ 3] Anywhere (v6) on wlp2s0    ALLOW FWD   Anywhere (v6) on enx3eebd35d9958
[ 4] Anywhere (v6) on enx3eebd35d9958 ALLOW FWD   Anywhere (v6) on wlp2s0

and on the Duo

[root@milkv-duo]~# ip route 
default dev eth0 scope link  src 169.254.93.130  metric 1001002 
169.254.0.0/16 dev eth0 scope link  src 169.254.93.130  metric 1002 
192.168.0.1 via 192.168.0.122 dev eth0 
192.168.0.122 via 192.168.42.1 dev usb0 
192.168.42.0/24 dev usb0 scope link  src 192.168.42.1 
192.168.42.1 via 192.168.0.122 dev eth0 

```   [root@milkv-duo]~# ip route 
default dev eth0 scope link  src 169.254.93.130  metric 1001002 
169.254.0.0/16 dev eth0 scope link  src 169.254.93.130  metric 1002 
192.168.0.1 via 192.168.0.122 dev eth0 
192.168.0.122 via 192.168.42.1 dev usb0 
192.168.42.0/24 dev usb0 scope link  src 192.168.42.1 
192.168.42.1 via 192.168.0.122 dev eth0 

At a high level there are two things you need.

  1. Default route on Duo to point to laptop (i.e. dev usb0 rather than eth0).
  2. Routing enabled on laptop.

Firstly fix the default route (which is currently over Ethernet). Then test and fix the next problem, if any.

1 Like

I get that I need to set routing on the laptop and the Duo at a high level. At a low level I have no idea and I keep just throwing things at to see if somthing sticks. Should I be using UFW, Networkmanager, ip tables, nftables to do the routing on the computer side? What addresses do I use in the ip route command on the duo? Do I use my comper rdnis address, wifi address, the duo rdnis addres, my wifi router address? Like I said my networking skill in linux arn’t that great and I could use some more detail in your answer.

2 Likes

Get the Duo working first with, e.g.

ip route del default
ip route add default via 192.168.42.122 dev usb0

However it would be a much simpler solution to use the Ethernet on the Duo.

1 Like

Your replies are about as useful as a bag of sand on Mars. Your first reply added no new information that I didn’t already know, at a “high level”. That’s like if someone asked you how to fly and you said “at a high level you need to build a plane” with no information on what a plane is. Of course, Ethernet would be simpler, but I didn’t ask what would be simpler; I didn’t ask how to use Ethernet, and maybe just maybe I DON’T WANT TO USE ETHERNET. I thought I made myself clear about what I was asking for and that was getting internet over RDNIS and that my Linux networking wasn’t great so I may need some hand-holding. I think I posted enough information that someone could formulate a clear answer.

In your second reply, you did give the route for the Duo, cool that helps, but it doesn’t fix my problem of the iptables on the computer. You only gave me a third of the answer. If you don’t know the answer, then DON’T reply. You don’t get points for posting, you get points for knowing the answer. If you knew, you wouldn’t have given such useless replies. I know I ask hard questions, and I usually get no responses or useless replies like yours because some people feel the need to chime in despite the lack of knowledge to actually answer the question. Like always, I solved it myself in the end. Here is what a big boy answer looks like:

You don’t need ufw; a simple IP table will work. Don’t make it more complicated with other tools. The iptables on the computer need a NAT rule to send the packets from the Duo subnet to the Wi-Fi interface on the computer. The commands on the computer are sudo iptables -t nat -A POSTROUTING -s 192.168.42.0/24 -o wlp2s0 -j MASQUERADE and make sure that the policy for forwarding packets is accept. sudo iptables -P FORWARD ACCEPT for the route on the Duo it should connect default to the IP of the computer’s RDNIS address. ip route add default via ADDRES_OF_COMPUTER_RDNIS dev usb0.

2 Likes