Wifi does not connect or goes down

Sorry you are locked out. What did you change? The lan (especially the Ethernet ports) should not be affected by a change to the wan/wwan or the WiFi radio configuration, so it sounds like something else might be going on.

1 Like

I tried scanning for a network to connect to but while I was connected to said network. I was connected via wireless because of this issue with the lan settings.

Here is the default interfaces file, which works:


config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

Default wifi

config interface 'wwan'
	option proto 'dhcp'

in the interfaces file

Please post the complete config files (the full contents of all 4 of the requested files). There isn’t enough information here to help you.

1 Like

dhcp


config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'
	option ednspacket_max '1232'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option ignore '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

firewall

config defaults
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option synflood_protect '1'

config zone 'lan'
	option name 'lan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	list network 'lan'
	list device 'tun+'

config zone 'wan'
	option name 'wan'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'
	list network 'wan'
	list network 'wan6'
	list network 'wwan'
	option input 'ACCEPT'

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 rule 'ovpn'
	option name 'Allow-OpenVPN'
	option src 'wan'
	option dest_port '1190'
	option proto 'udp'
	option target 'ACCEPT'

network


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd8a:8fad:fb8b::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.2.1'
	option gateway '10.1.1.4'
	option broadcast '192.168.2.255'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

config interface 'wwan'
	option proto 'static'
	option device 'wlan0'
	option ipaddr '10.1.1.4'
	option netmask '255.255.255.0'
	option gateway '10.1.1.1'
	option broadcast '10.1.1.255'
	list dns '10.1.1.1'

wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'platform/18000000.wmac'
	option band '2g'
	option htmode 'HT20'
	option channel 'auto'
	option country 'AU'
	option cell_density '0'

config wifi-iface 'wifinet1'
	option device 'radio0'
	option mode 'sta'
	option network 'wwan'
	option ssid 'ssid'
	option bssid 'bssid'
	option encryption 'psk2'
	option key 'password'

Edit:

Figured out why the lan interface was not working! For some reason it needs DHCP enabled to function even if it is set to a static ip address.

I recommend removing the gateway and broadcast addresses from the lan network interface definition. Those will happen automatically in the background.

I also recommend removing broadcast from the wan (again, it'll happen automatically). This shouldn't cause a problem, but it's just cleaner without.

You had disabled the dhcp server which was the problem. This should be disabled if you have a DHCP server already on a given subnet, but in the vast majority of cases, it should be enabled. In this case, you disabled the DHCP on your lan subnet, so there was nothing to provide DHCP addresses to the hosts on that network. (DHCP is not absolutely required for a network to function, of course. But without it, you must set all of the downstream devices with static IPs (manually configured on each device; some devices don't even have a user interface to let you do this))

Why does it have those sections if they shouldn't be edited? In regard to the gateway it says "10.1.1.1" which, is the ip address on the main router when I had manually set it to "10.1.1.4" the address of the wifi interface. I would have thought it would need the wifi interface address?

They are there so that you can override defaults or make special configurations where needed. But the defaults are usually good for the vast majority of users. It is only necessary to change them if you are doing something that is a bit more custom. It's like the defaults on so many systems these days (ranging from your car to your TV to your computer and everything in between) -- yes, you can change lots of settings, but they're configured with default states that are appropriate for a very large part of the user base.

the gateway is the address of the device that connects to the "next" network (i.e. the internet in many cases). The nominally correct address for the gateway is actually 10.1.1.1 because that is the address of the actual upstream gateway. 10.1.1.4 is held by the router, it's not actually the gateway, but I think this actually works because that address has an associated gateway, but is not technically correct to use it this way. Further, normally the gateway must be defined within the same subnet, and this is not... although it does work because you're defining a gateway that the routing table already understands, it looks strange.

In many cases with this type of normal routed configuration, it is best to omit the gateway because it will cause all routing to break if the wan's network is changed. When omitted, the router will use the default gateway to route traffic from the lan to the upstream (i.e. internet) networks... that default gateway is the address on the wan and is automatically populated in the routing table.

Ah ok. Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.