# samba dont wants to listen on tun0

## Treborius

i have a little router here, and i want to connect to my samba share via vpn from the internet

but if i try to make samba listen to the open-vpn interface tun0, samba dont wants to

this is the smb.conf i used till now :

```

interfaces = wlan0, lo

bind interfaces only = yes

```

everything is working as expected :

netstat -apn | grep -i listen | grep smb

```

tcp        0      0 192.168.XXX.XXX:139     0.0.0.0:*               LISTEN      30889/smbd          

tcp        0      0 127.0.0.1:139           0.0.0.0:*               LISTEN      30889/smbd          

tcp        0      0 192.168.XXX.XXX:445     0.0.0.0:*               LISTEN      30889/smbd          

tcp        0      0 127.0.0.1:445           0.0.0.0:*               LISTEN      30889/smbd          

```

samba is listing only on my wlan interface, if i try to add the tun0 interface,

```

interfaces = wlan0, tun0, lo

bind interfaces only = yes

```

nothing happens, samba is still listening only on wlan0

i tried all combinations

-interfaces = tun0

-interfaces = 10.9.115.0/255.255.255.0 # subnet of the vpn

-interfaces = 10.9.115.0/24 

everything results in samba listening on nothing :

netstat -apn | grep -i listen | grep smb

```

```

----------

## audiodef

I don't know if this will help, but someone suggested I use NFS instead of Samba if my network is Linux only. This worked perfectly and is a LOT less complicated. Maybe you could look into it.

----------

## s_bernstein

Your setup looks correct to me. But one thing, you did start your openvpn server before starting samba, right?

On the ohter hand, I think it should read: 

```
interfaces = wlan tun0 lo
```

----------

## Treborius

 *s_bernstein wrote:*   

> Your setup looks correct to me. But one thing, you did start your openvpn server before starting samba, right?
> 
> On the ohter hand, I think it should read: 
> 
> ```
> ...

 

tried that, no result

openvpn is started (tun0 wont exist if it wanst started)

i think i will switch to nfs over openvpn and drop samba next weekend

----------

## audiodef

Now that I've switched from Samba to NFS, I'm inclined to think there's no reason to use Samba unless you need to share with Windows or share printers. NFS is so much simpler and easier than Samba if you just need to share data between *nix machines.

----------

