Close ports 137 and 138 samba server?
Results 1 to 4 of 4

Thread: Close ports 137 and 138 samba server?

  1. #1
    Junior Member
    Join Date
    Aug 2003
    Posts
    25

    Close ports 137 and 138 samba server?

    Hi,

    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
    commands:
    bind interface only true
    interfaces 192.168.10.1/24

    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?
    Im using iptables to filter this ports, but id like to close this
    ports on interface.

    Thanks in advance!

  2. #2
    Senior Member
    Join Date
    Mar 2003
    Posts
    135
    To listen to only one port on an interface, you should just be able to specify it in /etc/samba/smb.conf, ie:

    Code:
    smb ports = 139
    To listen on a specific interface only, specify it in /etc/samba/smb.conf by its name or IP:

    Code:
    interfaces = eth0
    or
    Code:
    interfaces = 192.168.0.5
    These commands can go at the top in your global section.

  3. #3
    Junior Member
    Join Date
    Aug 2003
    Posts
    25
    Thanks by help, but i tried to use interface = eth1, but dont resolve the problem. The linux continue with ports 137 (udp) and 138 (udp) open on interface eth0.

    Thanks again

  4. #4
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,403
    You'll need to set the interfaces option like KeyserSoze said but you also need to add this option:
    Code:
    bind interfaces only = yes
    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.


    You can find more information in Using Samba, Chapter 4.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •