Update WINS Server Over OpenVPN

Hiya All,

I've setup my OpenWRT router as a WINS server as per these guides:
https://openwrt.org/docs/guide-user/services/nas/samba
https://openwrt.org/docs/guide-user/services/nas/cifs.server

And its working fine with clients on my LAN updating WINS entries and queries etc.

The problem I'm having is that my OpenVPN clients aren't updating WINS when they connect, even if I manually do nbtstat -RR when they are connected.
They are correctly receiving the pushed WINS address from the OpenVPN server config, and they can also query the server okay using nblookup.

At this point I'm thinking it's either a firewall or routing issue on the OpenWRT router?
Ive tried changing the firewall rules for SMB/WINS ports to allow from any zone but that didnt help.

I should add that my LAN is 10.0.0.x and my OpenVPN clients are 10.0.4.x and 10.0.5.x.

Here are some of my configs:
/etc/samba/smb.conf

[global]
        netbios name = OpenWrt
        display charset = UTF-8
        interfaces = lo br-lan
        server string = router
        unix charset = UTF-8
        workgroup = workgroup
        bind interfaces only = yes
        deadtime = 30
        enable core files = no
        invalid users = root
        local master = no
        map to guest = Bad User
        max protocol = SMB2
        min receivefile size = 16384
        null passwords = yes
        passdb backend = smbpasswd
        security = user
        smb passwd file = /etc/samba/smbpasswd
        use sendfile = yes
        domain master = yes
        local master = yes
        name resolve order = wins lmhosts hosts bcast

Here's whats not commented out in /etc/dnsmasq.conf

dhcp-option=44,10.0.0.1

Here's what I added as per guide above to /etc/config/firewall

config rule
        option proto 'udp'
        option dest_port '137-138'
        option target 'ACCEPT'
        option src 'lan'

config rule
        option proto 'tcp'
        option dest_port '139'
        option target 'ACCEPT'
        option src 'lan'

config rule
        option proto 'tcp'
        option dest_port '445'
        option target 'ACCEPT'
        option src 'lan'

Many thanks,

Is your tunnel Layer 2 or Layer 3?

It's a TUN adapter, so Layer 3.

[Solved] Accessing SMB share via WWAN

Thanks, just gave that a go but no joy still. :frowning:

So how are the broadcast packets traversing the tunnel?

1 Like

Good point, I was under the impression that it wouldn't matter about broadcasts as its going direct to a WINS + DNS server?

Do you think I can only get this working via a TAP Layer 2 adapter?

Maybe I need to do some more reading. -_-

Had a read, you are correct, WINS needs to broadcast.
I've had to switch to using TAP instead of TUN, and now its working correctly.
I wanted best performance so I wanted TUN, although I haven't actually looked at any real world benchmarks for this.

Thanks all for pointing me in the right direction. :slight_smile:

1 Like