rpi3 cannot connect to internet

hi,

my rpi 3 i flash a new volumio2 version 0.979.
after install, i can connect with web gui.

the problem is, my rpi3 work as a hotspot. so no internet connected to him.
how to config the rpi3 and volumio to connect to internet?

i use a wifi dongle, i assume it work because it can work as hotspot (can do ssh connection also)

i have other issues. but this a 1st thing i need to solve.

thank in advance.

Connect your device or computer to the hotspot and in volumio network menu you should see other network. Select the one you want to connect to and configure it. Save and reboot.

when i do this, then i cannot access the webUI.

the reboot you mention is automatic or physically turn off the main power?

Here is how I did for mine. By default any http request seems to redirect to volumio. This solution allows you to navigate internet and use volumio as an internet hotspot as well as using it.

Edit /etc/dhcp/dhcpd.conf and change the DNS to 8.8.8.8

Edit iptables to look as following (read bellow for howto)

-A PREROUTING -d YourLANIP/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3000  #More specific rule to redirect to volumio from LAN
-A PREROUTING -d 192.168.211.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3000 #More specific rule to redirect to volumio from WLAN
-A POSTROUTING -o eth0 -j MASQUERADE

-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT # Internet way back for hotspot clients
-A FORWARD -i wlan0 -o eth0 -j ACCEPT # Internet forward for hotspot clients
  • iptables-save > /etc/iptables.rules #to persist the rules
  • iptables -A INPUT… #to add manually INPUT rule
  • iptables -A FORWARD … #to add manually FORWARD rule
  • iptables -t nat -A PREROUTING #to add manually PREROUTING rule
  • iptables -t nat -A POSTROUTING #to add manually POSTROUTING rule
  • Replace -A by -D to remove a rule.
  • iptables-save to list current rules

hello,

this is my dhcpd.conf

ddns-update-style none;
#default-lease-time 600;
#max-lease-time 7200;
log-facility local7;
subnet 192.168.211.0 netmask 255.255.255.0 {
range 192.168.211.2 192.168.211.100;
option routers 192.168.211.1;
option domain-name “.local”;
option domain-name-servers 192.168.211.1;
}

where should i put the DNS ?

iptable.rules i already update.
should i put you code before “COMMIT”

option domain-name-servers 192.168.211.1;

This line provide the DNS configuration to your connected clients . It means that every device will ask this IP (Volumio Wifi IP = 192.168.211.1 by default) to translate web address to IP address.

If you change volumio IP 192.168.211.1 by 8.8.8.8 (google public DNS) or any prefere DNS it will sort you out.

FYI to apply it you need to restart the DHCP service : sudo service dhcpd restart
or restart volumio

Don’t forget to persist the iptables rules to keep them after reboot
sudo iptables-save > /etc/iptables.rules

If you modify the file manually you need to reboot or reload the file into iptables.
The best is to run the iptables command which will work straight away. When it’s working you can save them to the file for next reboot

thank for your guide.

i do change the ip table as per below.

Generated by iptables-save v1.4.21 on Sat Aug 20 16:46:40 2016

*nat
:stuck_out_tongue:REROUTING ACCEPT [6:399]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [1:260]
:stuck_out_tongue:OSTROUTING ACCEPT [1:260]
-A PREROUTING -d 192.168.1.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports$
-A PREROUTING -d 192.168.211.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-por$
-A POSTROUTING -o eth0 -j MASQUERADE

-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT # In$
-A FORWARD -i wlan0 -o eth0 -j ACCEPT # Internet forward for hotspot clients
COMMIT

Completed on Sat Aug 20 16:46:40 2016

then after finish it, i run sudo iptables-save

and here is my dhcpd.conf
ddns-update-style none;
#default-lease-time 600;
#max-lease-time 7200;
log-facility local7;
subnet 192.168.211.0 netmask 255.255.255.0 {
range 192.168.211.2 192.168.211.100;
option routers 192.168.211.1;
option domain-name “.local”;
option domain-name-servers 8.8.8.8;
}

am i correct?

iptables should look like that :

[code]*nat
:PREROUTING ACCEPT [186:26852]
:INPUT ACCEPT [36:3895]
:OUTPUT ACCEPT [72:27170]
:POSTROUTING ACCEPT [16:1324]
-A PREROUTING -d 192.168.1.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3000
-A PREROUTING -d 192.168.211.1/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3000
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT

Completed on Fri Aug 19 11:01:28 2016

Generated by iptables-save v1.4.21 on Fri Aug 19 11:01:28 2016

*filter
:INPUT ACCEPT [144:81076]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [143:11589]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT[/code]

Make sure 192.168.1.1 is the ethernet IP of volumio and not your router.

You should be able to access volumio with eth0IPAddressOfVolumio

The rest will go to the internet

i try your iptables.
seem my berry only work as hotspot and still cannot link to internet.

:frowning:

might need to enable ip forwarding, don’t know if it comes by default

in /etc/sysctl.conf

net.ipv4.ip_forward=1