nmatt0 / mitmrouter

Bash script to automate setup of Linux router useful for IoT device traffic analysis and SSL mitm
MIT License
243 stars 37 forks source link

Rpi 5 not forwarding DNS requests from LAN eth1 upstream to WAN eth0 #5

Open mjmeans opened 2 months ago

mjmeans commented 2 months ago

I'm trying this on Rpi 5 x64 4GB. It's built in interfaces are eth0 and wlan0. I add a USB dongle for eth1. So no script changes there since the names are all the same.

Of the prerequisites you mentioned, Rpi 5 already includes dnsmasq and net-tools. It does not include hostapd or bridge-utils so those needed to be added.

Rpi 5, however, also doesn't include iptables, so that clearly also needed to be installed.

I started mitmrouter.sh as is. I saw nothing that needed to be changed.

I started wireshark on br0 and attached an old DLink IP camera to eth1. I can see the camera talking. I see a DNS query from it sent to 1.1.1.1 but there is never a response. I think it's not forwarding anything to the eth0 wan. I'm wondering if there is some other prerequisite that is missing.

My setup is:

# update rpi
sudo apt update
sudo apt full-uprade

# manually set the default WLAN country and to turn on VNC
sudo raspi-config

# install prereqs
sudo apt-get install hostapd
sudo apt-get install bridge-utils
sudo apt-get install iptables

image

mjmeans commented 2 months ago

I found the problem. sysctl -w net.ipv4.ip_forward=1

It works fine on RPi 5. Nice little mitm.