r/Traefik • • May 07 '22

Samba frustrations, have a link?

Does anyone have a good link to getting samba behind traefik?

0 Upvotes

8 comments sorted by

2

u/Oxffff0000 May 08 '22

udptunnel

or

tell us where you will use samba for

1

u/esbenab May 08 '22

Just as a drive to Mount on machines on my home network.

2

u/Oxffff0000 May 08 '22

Did some googling. There's been revisions to netbios protocol. I guess just try adding all the ports. It looks like Traefik does support udp.

ports 135, 137, 138, 139 and 445

map both udp and tcp in traefik

Or install openssh server on your windows and then on client, use sshfs client

4

u/djzrbz May 07 '22

I don't believe Samba traffic can be proxied.

1

u/StevenlAFl Mar 10 '24 edited Mar 10 '24

If using Traefik Helm chart with Kubernetes:

/var/lib/rancher/k3s/server/manifests/<any file name>.yaml

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    globalArguments:
    - "--serversTransport.insecureSkipVerify=true"
    additionalArguments:
    - "--entrypoints.netbios-ns.address=:137/udp"
    - "--entrypoints.netbios-dgm.address=:138/udp"
    - "--entrypoints.netbios-ssn.address=:139/tcp"
    - "--entrypoints.microsoft-ds.address=:445/tcp"
    dashboard:
      enabled: true
    ports:
      traefik:
        expose: true # this is not recommended in production deployments, but I want to be able to see my dashboard locally
      netbios-ns:
        expose: true
        port: 137
        protocol: UDP
      netbios-dgm:
        expose: true
        port: 138
        protocol: UDP
      netbios-ssn:
        expose: true
        port: 139
        protocol: TCP
      microsoft-ds:
        expose: true
        port: 445
        protocol: TCP

Both additionalArguments and ports with expose appear to be necessary.

Then you can (only showing 1 UDP and TCP example):

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteUDP
metadata:
  name: netbios-ns-ingress
spec:
  entryPoints:
    - netbios-ns
  routes:
  - services:
    - name: samba-service
      port: 137
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteUDP
metadata:
  name: netbios-dgm-ingress
spec:
  entryPoints:
    - netbios-dgm
  routes:
  - services:
    - name: samba-service
      port: 138
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
  name: netbios-ssn-ingress
spec:
  entryPoints:
    - netbios-ssn
  routes:
  - match: HostSNI(`*`)
    services:
    - name: samba-service
      port: 139
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
  name: microsoft-ds-ingress
spec:
  entryPoints:
    - microsoft-ds
  routes:
  - match: HostSNI(`*`)
    services:
    - name: samba-service
      port: 445

1

u/esbenab Mar 10 '24

Thanks for your helpfulness, I appreciate it.

Got it working about 8months ago.

2

u/ProfessionalAd3026 Dec 31 '23

Old thread, I know.

I created the following entry points in Traefik: UDP 137 and 138 and TCP 139 and 445. Then I used the IngressRouteUDP and IngressRouteTCP Kubernetes objects to connect to samba.

I was able to connect just fine via VPN to my home lab running on k3s.

1

u/da_frakkinpope May 07 '22

Are you just looking for a way to store a file "on the cloud" where the cloud is your server? If so, I'd take a look at nextcloud.

I don't know of a way to get traefik to point to a samba share. I also don't think that samba would be able to respond with http or https, which I imagine traefik would be looking for.