Python WiFi Bridge
table
sudo apt update
Update App Package
sudo apt upgrade
Upgrade App Package
sudo apt-get install dnsmasq iptables
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={ ssid="networkname" psk="pswd" }
sudo nano /etc/dhcpcd.conf
interface eth0 | |
---|---|
static ip | 192.168.10.100 |
router | 192.168.10.100 |
This table is for refrence only!!!
interface eth0 static ip_address=192.168.220.1/24 static routers=192.168.220.0
sudo service dhcpd restart
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo nano /etc/dnsmasq.conf
item | value | description |
---|---|---|
interface | eth0 | use interface eth0 |
listen-address | 192.168.xx.xx | adress to listen on |
bind-dynamic | - | bind to the interface |
server | 8.8.8.8 | use google |
domain-needed | - | dont forward short names |
bogus-priv | - | drop the non-routed address spaces |
dhcp-range | 192.168.xxx.xx 192.168.xxx.xx 12H | IP Range lease tim in hours |
sudo nano /etc/sysctl.conf
#net.ipv4.ip_forward=1
Replace With
net.ipv4.ip_forward=1
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
sudo nano /etc/rc.local
find exit 0
add aboveexit 0
iptables-restore < /etc/iptables.ipv4.nat
sudo service dnsmasq start
sudo apt install unzip wget php apache2 mysql-server php-zip php-mysql php-dom php-mbstring php-gd php-curl
sudo mkdir -p /nas/data/nextcloud