How about this option for nmbd?

Andre Albsmeier andre.albsmeier at
Tue Jun 16 15:33:16 GMT 1998


please imagine the following scenario:

We have 4 local samba networks consisting of multiple
samba machines and Win95 and NT machines as well. They
all talk to each other and all works well. We have one
central (samba) WINS server for all 4 nets. These
4 nets are connected together and communicate to
the outside world through a firewall.

Now I want to connect to exactly one share on the other
side of the firewall. Let's assume the name of this machine
to be AA_BB and the name of the share APPS. The firewall
machine has a small program listening on port 139/tcp and
forwards all packets to port 139 on the AA_BB machine.

On a Win95 client I add AA_BB to the lmhosts file with
the IP address of the firewall machine (!). Now I can
connect to \\AA_BB\APPS and everything works great.
But since I am lazy, I don't want to add this entry to
all lmhost files. A name resolution by DNS is not possible
since AA_BB is not a valid hostname and the resolver under
FreeBSD discards it.

So my solution is now a small hack to the nmbd on the WINS
server which adds the IP address of AA_BB manually:

*** nmbd_winsserver.c.ORI	Sun Jun 14 19:04:45 1998
--- nmbd_winsserver.c	Sun Jun 14 19:51:32 1998
*** 126,131 ****
--- 126,137 ----
+   { struct in_addr  ip;
+     ip = *interpret_addr2( "" );
+     add_name_to_subnet( wins_server_subnet,
+                         "AA_BB", 0x0, 0x64, PERMANENT_TTL, REGISTER_NAME, 1, &ip );
+   }        
  #ifndef SYNC_DNS
    /* Setup the async dns. */

This works great since AA_BB is now resolved through the WINS

Now my question is:
Would it make sense to implement this as a global option
in smb.conf? It could be similiar to the following:

static wins address	=

This would add HOST1 with IP and HOST2 with
IP to the WINS database permanently.

What do you think of this? If you would like to see this
in the regular samba code, I would try to make a patch for
samba 1.9.18p8. If not, I will stay with my hack since it
works for me :-)



More information about the samba mailing list