Follow up on my earlier blog Run your wifi-dongle as Access Point (Soft-AP) 8188eu on Linux, about using your Wifi dongle as a Wireless Access Point.
We got the WIFI AP started. Next step is to share the Internet connection on the box (enabled via ethernet cable – interface
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
To set this up automatically on boot, edit the file /etc/sysctl.conf and add the following line to the bottom of the file:
Enable NAT in the kernel & rules to use ethernet interface via wifi interface.
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlx00e04c0876f5 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlx00e04c0876f5 -o eth0 -j ACCEPT
Finally persist the iptables configuration and restore it on reboot.
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
Now edit the file /etc/network/interfaces and add the following line to the bottom of the file:
up iptables-restore < /etc/iptables.ipv4.nat
That’s all folks!
Similarly, if you have a VPN running on the box. And you want to expose the VPN connection via the Wireless Access Point:
tun0 in the iptables above)
curl --interface tun0 freegeoip.net/json/
Or just hit the url freegeoip.net/json/ on your browser.
My RPi runs OSMC with SickRage, CouchPotato and Transmission-daemon.
I have been using transmission-daemon for sometime and it works great. Recently I had some I/O trouble with a big torrent and decided to install another BitTorrent client on the box – just in case.
I tried to look around but couldn’t get any other known torrent clients installed on the ARM box (absence of the binaries you can say). There are ways to get x86 utorrent binary installed on RPi but I didn’t want to go that far.
#Install the required packages
sudo apt-get install deluged deluge-web
#Set your auth credentials
sudo echo "osmc:osmc:10" >> /var/lib/deluged/config/auth
#Change various settings, seed-ratio; download directory etc
sudo vi /var/lib/deluged/config/core.conf
#restart the service to take effect
sudo service deluged restart
#check out if the service started OK
stty cols 2000
sudo service deluged status -l
#Create the web ui service
sudo vi /etc/systemd/system/deluge-web.service
Description=Deluge Bittorrent Client Web Interface
#Set the service to start upon system startup
sudo systemctl enable deluge-web.service
#Now start the service for the first time.
sudo service deluge-web restart
sudo systemctl start deluge-web
#Go to URL
#Enter the default password:
#Set a new password.
That’s all folks!