I can't connect to the Internet

Posted by Ali 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Ali
I can't connect to the Internet
October 21, 2017 05:58PM
Hi. I wanted to install "nano" to my PirateBox.
* Official image
* MR 3040
* It works

I've run the commands from here: [piratebox.cc]
Quote

cp /etc/config/network /etc/config/network.backup
uci set network.wan=interface
uci set network.wan.ifname=$( uci get network.lan.ifname )
uci set network.wan.macaddr=$( uci get network.lan.macaddr ) ## this line is needed at VoCore
uci set network.wan.proto=dhcp
uci del network.lan.ifname
uci commit

But it said;
Quote

root@************:~# uci commit
uci: Invalid argument

Then I tried uci commit /etc/config/network and didn't get any output.

And then I've connected the PirateBox to my router with ethernet cable. Tried to ping my own website:

Quote

root@***:~# /etc/init.d/piratebox nodns
root@***:~# ping alisezisli.com.tr
PING alisezisli.com.tr (5.2.87.131): 56 data bytes
64 bytes from 5.2.87.131: seq=0 ttl=56 time=7.926 ms
64 bytes from 5.2.87.131: seq=1 ttl=55 time=8.162 ms
64 bytes from 5.2.87.131: seq=2 ttl=56 time=8.550 ms
64 bytes from 5.2.87.131: seq=3 ttl=56 time=8.317 ms
64 bytes from 5.2.87.131: seq=4 ttl=56 time=8.072 ms
^C
--- alisezisli.com.tr ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 7.926/8.205/8.550 ms

It seems OK because IP address is right. Then I run opkg update but it didn't work. See the output below.

Quote

root@***:~# opkg update
Downloading [downloads.openwrt.org].
Updated list of available packages in /var/opkg-lists/attitude_adjustment.
Downloading [stable.openwrt.piratebox.de].
Updated list of available packages in /var/opkg-lists/piratebox.
root@***:~# opkg install nano
Installing nano (2.2.6-1) to root...
Downloading [downloads.openwrt.org].
wget: bad address 'downloads.openwrt.org'
Collected errors:
* opkg_download: Failed to download [downloads.openwrt.org], wget returned 1.
* opkg_install_pkg: Failed to download nano. Perhaps you need to run 'opkg update'?
* opkg_install_cmd: Cannot install package nano.
root@***:~# opkg update
Downloading [downloads.openwrt.org].
wget: bad address 'downloads.openwrt.org'
Downloading [stable.openwrt.piratebox.de].
^C

Now I can't even ping locally. It's waiting forever. This may be a stupid question but I also wanted to ask this, how can I revert "nodns"?

I need help. I really want to connect the Internet get some packages.
Re: I can't connect to the Internet
October 21, 2017 06:46PM
Hi,
that is strange.
#1 uci commit is the correct command. Maybe there is a hidden special character, like a TAB key, which is causing trouble.

#2 opkg error
Seems that some bootup maybe wasn't finished, resulting that the resolv.conf was rewritting and pointing to 192.168.1.1 again. You would not be able to install nano (with a version number) without a proper "opkg update".
Check the /etc/resolv.conf , maybe change it back to your router or googles DNS ( 8.8.8.8 ) and then rerun the installation.

Strange,
best regards Matthias
Ali
Re: I can't connect to the Internet
October 21, 2017 07:00PM
First of all thanks for your answer.

Matthias Wrote:
-------------------------------------------------------
> Check the /etc/resolv.conf , maybe change it back
> to your router or googles DNS ( 8.8.8.8 ) and then
> rerun the installation.




But I didn't get this. My router's default DNS address are 208.67.222.222 and alternative is 8.8.8.8 (OpenDNS & Google DNS). What did you mean by "rerun the installation"?
Re: I can't connect to the Internet
October 22, 2017 07:05AM
I explain what might happen on the piratebox, not talking about your home router.

You run piratebox nodns -> resolv.conf fixed
you run "opkg update" -> ok
<< something is happening on resolv.conf >>
you run "opkg install" -> error bad address
you run "opkg update" -> error again

So I wanted to say, enter a valid dns address again to resolv.conf and retry with "opkg update" followed by "opkg install nano" again.
Ali
Re: I can't connect to the Internet
October 22, 2017 09:11AM
I see. Thanks for yor help.

I've no idea what happened. I've restored up my network conf again and tried over and over. Suddenly, it worked! I've successfully installed nano.

What was the proper way to do it? I only have one ethernet port. So I've to connect my device vie Wi-Fi. Should I connect it to my router at the beginning or at the end of the commands? Does this make any difference?

Also, again, what if I've run nodns and want to set it back to original? Should I just reboot? Or delete resolv.conf?


EDIT: I've wrote all the commands. Never copied. But still, uci commit says "invalid argument". I've run uci commit a few days ago successfully. But didn't have any connection at that time and couldn't try it. So I've just shutdown the device. Since then, uci commit always fails. So I just type uci commit /etc/config/network - I mean I give my configuration file as an argument and it says nothing. So I think it just executes the command...



Edited 1 time(s). Last edit at 10/22/2017 09:14AM by Ali.
Re: I can't connect to the Internet
October 22, 2017 12:15PM
Sometimes strange things just happen ;-)
The way you did is absolutely correct. You can also disable the firewall on the WAN port (etc/config/firewall change the WAN section to ALLOW ALLOW ALLOW , or something) with that you can access the piratebox from your home network. You only need to find out it's IP.

@ uci commit . Only run this command without a paramter. If you only want to commit network configuration, the correct CLI is
uci commit network
Do not use the complete path to the configuration file.

best regards Matthias