Hi all, I am new to OpenWrt, networking and Docker in general but I decided to give a shot at installing OpenWrt on Portainer. I mostly followed this tutorial https://youtu.be/o_mPt7pWRes, however after I try access the interface on http://192.168.1.65 (IP) the browser cannot load the page. If anyone has time to try recreate the error, you can follow the video above.
Here are the steps I took to configure OpenWrt (connecting via console in Portainer):
- Changing the scripts to the correct IP
- Troubleshooting DNS
- Attempted running of LuCI
There is a wall of text coming up so if you would like to see my hypothesis, look at 3. (:
- Changing the scripts to the correct IP
# cd /etc/config
# cat network (ip is initially 192.168.123.100)
# nano network
I changed:
option ipaddr from '192.168.123.100' to '192.168.1.65'
The gateway and dns to '192.168.0.1' which is my home router.
Note my home router is on 192.168.0.1 and my computer that runs docker is connected to an AP (192.168.1.1), my computer runs on (192.168.1.26)(checked with $ if config
) and the IP of OpenWrt is (192.168.1.65). Would it be correct to run the gateway/dns on 192.168.0.1?
/etc/config/network file
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.1.65'
option gateway '192.168.0.1'
option dns '192.168.0.1'
config interface 'vpn0'
option ifname 'tun0'
option proto 'none'
Then I re-ran the script with # /etc/init.d/network restart
and checked the /config/network file # ifconfig
eth1 Link encap:Ethernet HWaddr 02:42:C0:A8:01:41
inet addr:192.168.1.65 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23871 errors:0 dropped:0 overruns:0 frame:0
TX packets:15479 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2592779 (2.4 MiB) TX bytes:988269 (965.1 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:12491 errors:0 dropped:0 overruns:0 frame:0
TX packets:12491 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1012073 (988.3 KiB) TX bytes:1012073 (988.3 KiB)
- Troubleshooting DNS
Next I try ping devices on the network: itself(192.168.1.65), the AP (192.168.1.1), router (192.168.0.1), cloudflare (1.1.1.1). They all work but for some reason I cannot ping the host device (192.168.1.26), any ideas?
I also try opkg update
and it fails, so does nslookup -query=a google.com
nslookup it is denied (is this a DHCP issue? If so what do I do to fix this?)
I initially had the gateway/dns on 192.168.1.1 but I changed it to 192.168.0.1, i'm unsure which is correct)
so I check
# nano /etc/resolv.conf
and it is empty so I add...
nameserver 1.1.1.1
Now both commands work and now I can run both commands as well as # opkg install luci
to make sure luCI is installed (even though this is not a snapshot).
Package luci (git-22.223.76261-af77cc5-1) installed in root is up to date.
- Attempted Running of LuCI
Well you already know the result
The browser cannot load the page http://192.168.1.65 (IP).
I provided* the firewall configuration on OpenWrt, traceroute to 1.1.1.1, 192.168.1.1, 192.168.1.26 within openWRT and traceroute to 192.168.1.65 from my host computer if that will help.
I think the error is that the host computer cannot reach the OpenWrt container and vice versa looking at the traceroute (!H error) BUT can reach the router... any solutions?
I am also aware on my # cat /etc/config/network
has only a lan... isn't there supposed to be a wan too?
Is it that my lan and wan are inproperly configured? The purpose of this install is to make OpenWrt my router so I have a nic for the WAN from the AP (192.168.1.1)(should I directly connect it to my home router instead and put it in modem mode?) and another nic for the LAN connected to a switch (that I have no idea how to configure...). Modem-Router-AP-(Router+Firewall?OpenWrt)-Switch is the topology. I am quite confused to how it works so if someone could give me some pointers and walk my through the process (such as a dm if possible - im quite available for these few days) I would appreciate it very much! I will post the solution if any ofc. I really want to get OpenWrt running so any advice will be very helpful.Thanks in advance :]
When troubleshooting DNS I can't remember but I think initially I could not even ping any other devices so on Portainer I enabled the bridge network too and I think I could ping. So now I have two networks running in OpenWRT, bridge and mymacvlan
. In the tutorial, the person removed the bridge network before starting OpenWRT so I am a bit confused.
Now my # ifconfig
looks like this:
eth1 Link encap:Ethernet HWaddr 02:42:C0:A8:01:41
inet addr:192.168.1.65 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24929 errors:0 dropped:0 overruns:0 frame:0
TX packets:15664 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2706334 (2.5 MiB) TX bytes:996583 (973.2 KiB)
eth3 Link encap:Ethernet HWaddr 02:42:AC:11:00:03
inet addr:172.17.0.3 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1719 (1.6 KiB) TX bytes:174 (174.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:12497 errors:0 dropped:0 overruns:0 frame:0
TX packets:12497 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1012745 (989.0 KiB) TX bytes:1012745 (989.0 KiB)
firewall configuration # nano /etc/config/firewall
- though I have not touched it
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option flow_offloading '0'
option flow_offloading_hw '0'
option fullcone '0'
config zone
option name 'lan'
list network 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
config zone
option name 'wan'
list network 'wan'
list network 'wan6'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'fe80::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option target 'ACCEPT'
config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'
config include
option path '/etc/firewall.user'
config include 'zerotier'
option type 'script'
option path '/etc/zerotier.start'
option reload '1'
config include 'gowebdav'
option type 'script'
option path '/var/etc/gowebdav.include'
option reload '1'
config include 'openclash'
option type 'script'
option path '/var/etc/openclash.include'
option reload '1'
config include 'passwall'
option type 'script'
option path '/var/etc/passwall.include'
option reload '1'
config include 'passwall_server'
option type 'script'
option path '/var/etc/passwall_server.include'
option reload '1'
config include 'softethervpn'
option type 'script'
option path '/usr/share/softethervpn/firewall.include'
option reload '1'
config include 'shadowsocksr'
option type 'script'
option path '/var/etc/shadowsocksr.include'
option reload '1'
# traceroute 1.1.1.1 from OpenWrt
bash-5.1# traceroute 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 46 byte packets
1 172.17.0.1 (172.17.0.1) 0.021 ms 0.016 ms 0.016 ms
2 192.168.1.1 (192.168.1.1) 3.609 ms 3.446 ms 3.433 ms
3 192.168.0.1 (192.168.0.1) 4.708 ms 4.403 ms 4.673 ms
4 * * *
... :]
etc
# traceroute 192.168.1.1 to AP from OpenWrt
bash-5.1# traceroute 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 30 hops max, 46 byte packets
1 192.168.1.1 (192.168.1.1) 2.955 ms 2.378 ms 3.402 ms
# traceroute 192.168.1.26 to Host Computer from OpenWrt
bash-5.1# traceroute 192.168.1.26
traceroute to 192.168.1.26 (192.168.1.26), 30 hops max, 46 byte packets
1 b49ca3301e1e (192.168.1.65) 3092.207 ms !H 3119.375 ms !H 3119.656 ms !H
# traceroute 192.168.1.65 from Host Computer
$ traceroute 192.168.1.65
traceroute to 192.168.1.65 (192.168.1.65), 30 hops max, 60 byte packets
1 hostpc (192.168.1.26) 3106.625 ms !H 3106.486 ms !H 3106.463 ms !H
!H meaning host/network/protocol being unreacahable