Samba port 139/445 not available

I connected with my second router with wlan ( wwan ) to my main router. On my second wlan router, I have installed a samba server. The wwan get an ip from my main router. The lan IP of my second router is 192.168.1.1 and when I use nmap on 192.168.1.1, I can see, samba ports are open. Thats good.
But when I use nmap to wwan ip, I see samba ports are close. The ssh port are open on 192.168.1.1 and the wwan ip.
I have disabled my firewall on the second router but I have still the same issue, samba ports are only available.

By default, samba only listens on the lan interface. If you need to access the service through another interface, you must set it in the configuration file, e.g.

option interface 'lan wg0'
[global]
	netbios name = OpenWrt 
	display charset = UTF-8
# 	interfaces = lo br-lan 
	interfaces = lo br-lan wwan

That makes no difference.

nmap -p 139,445,22 192.168.1.1
Starting Nmap 7.93 ( https://nmap.org ) at 2024-09-13 18:28 CEST
Nmap scan report for 192.168.1.1
Host is up (0.0020s latency).

PORT    STATE    SERVICE
22/tcp  filtered ssh
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds
MAC Address: 34:31:C4:E7:E8:27 (AVM GmbH)
nmap -p 139,445,22 openwrtdach
Starting Nmap 7.93 ( https://nmap.org ) at 2024-09-13 18:28 CEST
Nmap scan report for openwrtdach (192.168.10.155)
Host is up (0.0025s latency).
rDNS record for 192.168.10.155: OpenWrtDach.lan

PORT    STATE  SERVICE
22/tcp  open   ssh
139/tcp closed netbios-ssn
445/tcp closed microsoft-ds

By the way ... there is a relayd bridge ...

Modify /etc/samba/smb.conf.template like this

[global]
        netbios name = |NAME|
        #interfaces = |INTERFACES|
        interfaces = br-lan 192.168.10.155/24
        server string = |DESCRIPTION|
        unix charset = |CHARSET|
        workgroup = |WORKGROUP|

and restart the service.

Check the listening interfaces.

netstat -nlp | grep '\:139\|\:445'

On the device 192.168.10.155:

root@OpenWrtDach:~# netstat -nlp | grep '\:139\|\:445'
tcp        0      0 127.0.0.1:445           0.0.0.0:*               LISTEN      14175/smbd
tcp        0      0 192.168.1.1:445         0.0.0.0:*               LISTEN      14175/smbd
tcp        0      0 127.0.0.1:139           0.0.0.0:*               LISTEN      14175/smbd
tcp        0      0 192.168.1.1:139         0.0.0.0:*               LISTEN      14175/smbd
tcp        0      0 fe80::3631:c4ff:fee7:e827:445 :::*                    LISTEN      14175/smbd
tcp        0      0 fd91:f152:16be::1:445   :::*                    LISTEN      14175/smbd
tcp        0      0 ::1:445                 :::*                    LISTEN      14175/smbd
tcp        0      0 fe80::3631:c4ff:fee7:e827:139 :::*                    LISTEN      14175/smbd
tcp        0      0 fd91:f152:16be::1:139   :::*                    LISTEN      14175/smbd
tcp        0      0 ::1:139                 :::*                    LISTEN      14175/smbd

In my case, thats the trick:

interfaces = lo br-lan 192.168.10.0/24

restart the samba service:

service samba restart

and u can see:

netstat -nlp | grep '\:139\|\:445'
tcp        0      0 127.0.0.1:445           0.0.0.0:*               LISTEN      2333/smbd
tcp        0      0 192.168.1.1:445         0.0.0.0:*               LISTEN      2333/smbd
tcp        0      0 192.168.10.155:445      0.0.0.0:*               LISTEN      2333/smbd
tcp        0      0 127.0.0.1:139           0.0.0.0:*               LISTEN      2333/smbd
tcp        0      0 192.168.1.1:139         0.0.0.0:*               LISTEN      2333/smbd
tcp        0      0 192.168.10.155:139      0.0.0.0:*               LISTEN      2333/smbd
tcp        0      0 fe80::3631:c4ff:fee7:e827:445 :::*                    LISTEN      2333/smbd
tcp        0      0 fd91:f152:16be::1:445   :::*                    LISTEN      2333/smbd
tcp        0      0 ::1:445                 :::*                    LISTEN      2333/smbd
tcp        0      0 fe80::3631:c4ff:fee7:e827:139 :::*                    LISTEN      2333/smbd
tcp        0      0 fd91:f152:16be::1:139   :::*                    LISTEN      2333/smbd
tcp        0      0 ::1:139                 :::*                    LISTEN      2333/smbd

Thanks for helping ...

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.