Configure Ksmbd SAMBA on two interfaces

I am trying to configure Ksmbd to provide network shares (SAMBA) over TWO interfaces, i.e. lan and wg0. It seems that Ksmbd is limited to a single interfaces, I can select either lan and have access at the local network only, or wg0 and have access remotely over wireguard VPN only. Do you know if this is possible, or it is just a limitation of the Ksmbd package? Would it be possible with some traffic forwarding rule to make the wg0 clients show up as originating from LAN?

If I use unspecified, I do not have access from either interface.

BTW, the Openwrt version is 21.02 RC2 (OpenWrt 21.02.0-rc2 r16122-c2139eef27) - I do not think the problem relates to RC2, for the time being I cannot upgrade to the recently released stable version.

Should be just a Luci limitation atm, we had a fix added for samba4 already to allow multiple interfaces. Seems we are still missing this for Ksmbd.

You can try this in the /etc/config/ksmbd

config globals
  option interface 'lan wg0'

Alternative directly edit the smb.conf.template line:
interfaces = |INTERFACES|
You need to get the actual interface names via ifconfig for this (br-lan wg0)!

1 Like

Hi Andy,
I have attempted doing something like this a while ago - I will give it a try later today and report back. Regarding the bridge (br-lan wg0 refers to a bridge, doesn't it? ), do I have to configure a bridge between the lan and wg0 interface?

No, but br-lan is the default "real" interface name of the UCI "LAN" interface. So anything that goes into /etc/config UCI files wants the abstract names (lan,wan), while the actual smb.conf.template files need the physical interface names, which can be checked via ifconfig. The init.d files normally do this logical-physical interface name lookup for you.

Hi Andy, the solution you proposed worked perfectly. Thanks a lot (and sorry for not responding earlier).

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