June 23rd, 2004, 09:45 PM
Close ports 137 and 138 samba server?
I have a linux box with samba server and two network interface. One
interface for internet and another for local network. I used the samba
bind interface only true
And the samba stop to listen on internet interface on port 139, but it
continue listening on ports 137 and 138 on both interface. How to stop
listen on this ports on internet interface only?
I´m using iptables to filter this ports, but i´d like to close this
ports on interface.
Thanks in advance!
June 23rd, 2004, 11:46 PM
To listen to only one port on an interface, you should just be able to specify it in /etc/samba/smb.conf, ie:
To listen on a specific interface only, specify it in /etc/samba/smb.conf by its name or IP:
These commands can go at the top in your global section.
interfaces = 192.168.0.5
June 24th, 2004, 12:50 PM
Thanks by help, but i tried to use interface = eth1, but don´t resolve the problem. The linux continue with ports 137 (udp) and 138 (udp) open on interface eth0.
June 28th, 2004, 02:53 PM
You'll need to set the interfaces option like KeyserSoze said but you also need to add this option:
Setting the interfaces option only tells Samba which interface to use when sending data. The bind interfaces only options tells it to also listen on that interface.
bind interfaces only = yes
You can find more information in Using Samba, Chapter 4.
Experience is something you don't get until just after you need it.