egc DD-WRT Guru
Joined: 18 Mar 2014 Posts: 12837 Location: Netherlands
|
Posted: Sat Apr 22, 2017 8:55 Post subject: Using Samba as WINS server to resolve NETBIOS names |
|
Background:
I have a setup with one main router and a second router setup as WAP. This WAP has the OpenVPN client and when I set the WAP as gateway I have a working VPN.
This WAP als has an unbridged VAP, everything from this unbridged VAP is automatically routed through the VPN.
But now I have 2 subnets: main 192.168.0.0 and the subnet of my unbridged VAP: 192.168.2.0
Problem: Connecting both subnets so that clients (including windows) can see each other.
First step is to open up router 2 (WAP/VAP) by adding the following to my firewall: Code: | iptables -I FORWARD -i wl0.1 -m state --state NEW -j ACCEPT |
That works, windows shares are advertised but can not be found other then by IP address (after opening up the windows firewall for bothe subnets), that is expected, Master Browsing is only on the same subnet, so I need a WINS server. I have used my NAS as WINS server which works , but I want to use the SAMBA of my second router to be the WINS server.
now the question: How to easily setup Samba as WINS server? @Eibgrad pointed to using Tomato but guys there must be a DDWRT solution.
I have cobbled up the following workaround: in short copying the smb.conf to my samba share, hacking this smb.conf, killing SMB and restarting, this works but it is a clumsy workaround, so suggestions to streamline this are more then welcome.
The best solution is to expand the GUI with the options to do it for us.
Here is my clumsy solution:
Quote: | Copy the smb.conf to /opt/etc/samba
mkdir -p /opt/etc/samba/
cp -a /tmp/smb.conf /opt/etc/samba/
Add these lines to the global section of the smb.conf:
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
wins support = yes
# What naming service and in what order should we use to resolve host names
# to IP addresses
name resolve order = wins lmhosts host bcast
# name resolve order = host wins bcast
Add these lines to startup script:
killall smbd
killall nmbd
smbd -s /opt/etc/samba/smb.conf
nmbd -s /opt/etc/samba/smb.conf
Reboot Router (to implement startup script)
Reboot all clients
|
I am looking forward to your suggestions, improvements and much smarter solutions _________________ Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087 |
|