Need some help regarding networking using a Pi. I got two group of computers.
After some digging on the internet, I managed to get the secondary group of computer to access the internet via the Pi using dnsmasq and iptables. However, there is one small problem. I usually need to use remote desktop or ssh within these two group of computers and current setup does not allow that because they are using two different subnet and cannot reach each other. I had to ssh into the Pi first before I can reach the computer of either side.
Here is some details for both network.
- Primary group are computers connected via a wifi router and able to access internet.
- Secondary group are old computers only able to connected via LAN switch, no internet.
- They are physically separate from each other, and the wifi signal from primary group are too weak to reach secondary group of computers.
After some digging on the internet, I managed to get the secondary group of computer to access the internet via the Pi using dnsmasq and iptables. However, there is one small problem. I usually need to use remote desktop or ssh within these two group of computers and current setup does not allow that because they are using two different subnet and cannot reach each other. I had to ssh into the Pi first before I can reach the computer of either side.
Here is some details for both network.
- Primary group network subnet 10.128.9.0/24. I have no admin access to this network so I can't change anything on the wifi router.
- Secondary group network subnet 192.168.25.0/24.
- The Pi in between is installed with dnsmasq and provide IP address to the computers connected to the LAN switch.
- I run the iptables command below on the Pi to allow computers connected to secondary computer to access the internet.
Code:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADEiptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPTiptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
Statistics: Posted by rasp14 — Thu May 09, 2024 2:44 am