lukicdarkoo / rpi-wifi

Configures simultaneous AP and Managed Mode Wifi on Raspberry Pi
GNU General Public License v3.0
532 stars 120 forks source link

which settings i need to change, to not rout internet to connected device #4

Closed futechiot closed 5 years ago

futechiot commented 5 years ago

Hello There, It's an amazing and very quick solution.

but i want something like this: mesh network -1

-->Rpi working on both mode AP+STA simultaneously, it's working with your script nicely.

-->Now esp8266 as a wifi client connects to the Rpi's access point and send sensor data to raspberry pi without internet over TCP communication between them. (here TCP server running on Rpi Static Ip ) and raspberry pi connected to home router in STA mode(in background) sending this data to server or MQTT. (I had Done this whole thing with ESP8266 as a wifi gateway and esp8266 as a client but to handle big network i want to use raspberry pi)

with your script Rpi working in AP+STA But it also rout the internet to connected device or it gives internet facility to each and every connected device, for my application this thing slowing down the internet connection if there is 5-6 devices. your script is making raspberry pi a INTERNET ROUTER"

So which lines i have to change to not rout the internet to connected devices?

lukicdarkoo commented 5 years ago

The script enables port forwarding and adds a postrouting rule in IP tables in order provide Internet access to clients.

Therefore, you have to delete the command which adds postrouting rule: https://github.com/lukicdarkoo/rpi-wifi/blob/72eb4ef0bf7479b57c833a279ba0a27eb7c47cc4/configure#L166 as well as port forwarding (line before).

Since you probably enabled port forwarding you may want to disable it:

sudo sysctl -w net.ipv4.ip_forward=0
futechiot commented 5 years ago

Yeah thanks, It's working nicely

But can you tell me using which command we can make a script and making this script run in background. so whenever i want to change something i can do on my own without disturbing you

which method you are using ? /etc/rc.local or crontab or chmod??

i dont know can you guide me please!!

Thanks

lukicdarkoo commented 5 years ago

The issue is solved in 66d3219e3c66324567760432b29a3a67a995f2f6

@fu-techiot crontab is used to run the script: https://github.com/lukicdarkoo/rpi-wifi/blob/master/configure#L191