Hello! weird wifi problem

Hello, great work and forum, congratulations.

I have some strange wifi problem. I set up a wifi client, the problem is it isn't replying to LAN requests.
by inspecting with tcpdump I can see it's working and sending and receiving it's ntp messages, but almost any LAN request is ignored, the exception being it replies, with some delay to arp requests.
I have disabled the firewall...

And, if I reconnect an ethernet cable, all interfaces start working correctly as they should, including the wifi, then it's possible to ssh and everything. disconnect ethernet, and the problem is back. so basically now im stuck having to use an ethernet cable.

some more details about my setup:

the wifi interface isn't fully detected on boot, got a mac full of zeros,
but I could activate it manually with:

ifconfig wlan0 hw ether 12:22:33:44:55:66
ifconfig wlan0 up
wpa_supplicant -iwlan0 -c ap.conf -B -Dnl80211
udhcpc -i wlan0

router: d-link dsl 2750b rev c1
firmware dlink dsl 2740 f1, 19.07 snapshot, compiled.
driver b43 - broadcom wifi

thanks for any help, have a good day
fangis

What are the contents of /etc/config/network, /etc/config/firewall, /etc/config/dhcp, and /etc/config/wireless ?

Redact any keys/passwords which may be visible.

hi, thank you for the quick reply. i'll post them:

/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd62:97e0:f124::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.15.21'
        option gateway '192.168.15.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 8t'
==========================
/etc/config/firewall

config defaults
        option syn_flood        1
        option input            ACCEPT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

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

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
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

# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        option src_ip           fc00::/6
        option dest_ip          fc00::/6
        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

# Allow essential incoming IPv6 ICMP traffic
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

# Allow essential forwarded IPv6 ICMP traffic
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

# include a file with users custom iptables rules
config include
        option path /etc/firewall.user


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option dest             wan
#       option proto    tcp
#       option target   REJECT

# block a specific mac on wan
#config rule
#       option dest             wan
#       option src_mac  00:11:22:33:44:66
#       option target   REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src              lan
#       option proto    ICMP
#       option target   DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                      wan
#       option src_dport        80
#       option dest                     lan
#       option dest_ip          192.168.16.235
#       option dest_port        80
#       option proto            tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src              wan
#       option src_dport        22001
#       option dest             lan
#       option dest_port        22
#       option proto            tcp

### FULL CONFIG SECTIONS
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00:11:22:33:44:55
#       option src_port 80
#       option dest             wan
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp
#       option target   REJECT

#config redirect
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00:11:22:33:44:55
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp
========================
/etc/config/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.auto'
        option nonwildcard '1'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'

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'

==========================

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0/bcma0:1'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'


A few observations:

You don't typically need to define a gateway on the LAN interface; the LAN interface is the gateway. However, there are scenarios (e.g. "dumb AP" and similar) where having a gateway might be needed.

You have a wan firewall zone, but have removed the corresponding interfaces from the network configuration. This won't necessarily break anything, depending of course on your desired objective, but it is untidy and will cause unnecessary errors.

Your instance of OpenWRT has an active DHCP server operating on the LAN interface. Could it be conflicting with another DHCP server on your network, or is this one meant to be the only one?

The wireless interface in OpenWRT is disabled.

This is for using OpenWRT as an Access Point that clients can connect to; it's not for using OpenWRT as a wireless client. Are you sure you configured OpenWRT to be a wireless client?

I need the gateway, that's another router where the actual internet access is coming from. the other configs are mostly the defaults.
If I try to change disabled to 0, then wlan0 disappears,
and I only was able to recreate it with
iw phy0 interface add wlan0 type managed

the idea was to use this old router as a print server, which is all working, except that I can't use it in a wifi-only mode.

you're right that lan dhcp might be conflicting, I think it's a default too of openwrt , I will try to remove that and see if it helps.

Are you looking to establish the connection from OpenWRT to the primary router via an Ethernet cable, or via Wi-Fi? And, in turn, are you looking for OpenWRT to provide Wi-Fi connectivity to other devices, e.g. your printer?

If you want OpenWRT to connect to your main router via Wi-Fi then you'll need to reconfigure the wireless settings to behave as a client, not as an AP. This is possibly easiest to accomplish using LuCI (the web-based configuration).

Just spotted this. 19.07 is quite old. You may find upgrading to the current version might be beneficial. At the very least, there'll be bug fixes and security patches included.

https://openwrt.org/toh/views/toh_fwdownload?dataflt[Model*~]=dsl-2750 suggests that 22.03.5 may be supported on your device.

I'm not familiar with 19 series. In more modern you can enable a empty bridge to start with option bridge_empty '1'.

Wild guess though.

Blockquote
Are you looking to establish the connection from OpenWRT to the primary router via an Ethernet cable, or via Wi-Fi? And, in turn, are you looking for OpenWRT to provide Wi-Fi connectivity to other devices, e.g. your printer?

No, I would like to connect to the primary router via wifi. Then p910nd is there on the openwrt router and should be available to the other lan computers. no need to share the connection.
I am now trying to reconfigure as client in the wireless settings. I have also disabled dnsmasq and the odhcpd service, but it didnt change anything.

hello, sure I will try this too.

How is the p910nd connected to OpenWRT? Is it connected via Ethernet, Wi-Fi, USB, or some other means?

p910nd is a print server program, it opens port 9100 and forwards traffic to the printer. So the openwrt router has to be available on lan to the clients on that port.

I'll post my progress, here's my updated files:

/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd62:97e0:f124::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.15.21'
        option gateway '192.168.15.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wlan'
        option type 'sta'
        option ifname 'wlan0'
        option proto 'static'
        option ipaddr '192.168.15.20'
        option gateway '192.168.15.1'
        option netmask '255.255.255.0'
        option macaddr '12:22:33:44:55:66'


config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 8t'
==========================
/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0/bcma0:1'
        option disabled '0'


config wifi-iface 'default_radio0'
        option device 'radio0'
        option mode 'sta'
        option ssid 'fangis'
        option encryption 'psk2'
        option key 'some_password'
        option network 'wlan'
        option macaddr '12:22:33:44:55:66'

With these new configs the router starts the interfaces correctly, however, as before, as soon as I unplug ethernet, wlan becomes unreachable by ping, then if I plug ethernet again, wlan is back.

It would.

You've got two separate interfaces in the same subnet. You'd be better off bridging them.

First, try removing this section:

Then amend this line:
option network 'wlan'

to:

option network 'lan'

Caveat: I haven't touched 19.07 in a long time. It's possible that some of this advice may not be applicable to 19.07, but would be fine on 22.03.5, for example.

that's ok, what matters is you're trying to help.
In fact, that change you propose goes back to how it was before. I have added this interface now, thinking it would help, but so far no change.
maybe it's a driver problem ? or mac address related... to me it's strange really.

I have a spare device buried somewhere, which I know can run 19.07. If upgrading to 22.03.5 is a non-starter then I might be able to fish it out and fiddle with the configuration directly rather than offering barely-remembered speculation.

b43 support for BCMA based wireless chipsets and BCM4321 is very, very, very limited, so there isn't much to be expected here (and the device being below minimum system requirements (4/32) and accordingly on an old/ EOL/ insecure version of OpenWrt doesn't help either).

Hooray, it works ! ! :grinning: :sunglasses: :sunglasses: :sunglasses:

The winner idea was from 'iplaywithtoys' who suggested using different subnets. My new setup is,

ethernet interface, 192.168.1.1
wlan, 192.168.15.20

and wlan in station mode. All good now.

Thanks everyone for the ideas, this is a forum where people actually try to help you, some other forums are like a desert. The only part I didn't like that much is the forum forces you to use updated browsers, some people, read: me, like to use older devices and browsers, so I had to use my woman's windows pc, eeew. have a good day all.

1 Like

Excellent. Glad you got it working. I hadn't had a chance to hunt for my spare device yet, so you beat me to it.