Hello:
I’m trying to use Wireguard fron docker in CE 19.1-Matrix_rc1 (Stable) (X96 Max+; S905X3).
Docker installation:
docker create
–name=wireguard
–cap-add=NET_ADMIN
–cap-add=SYS_MODULE
-e PUID=1000
-e PGID=1000
-e TZ=Europe/Madrid
-e SERVERURL=mydomain.duckdns.org #optional
-e SERVERPORT=51820
-e PEERS=30 #optional
-e PEERDNS=8.8.8.8,1.1.1.1,1.0.0.1,8.8.4.4,176.103.130.130,176.103.130.131,208.67.222.222,208.67.220.220
-e INTERNAL_SUBNET=10.10.10.0
-e ALLOWEDIPS=0.0.0.0/0
-p 51820:51820/udp
-v /storage/.config/wireguard/config:/config
-v /lib/modules:/lib/modules
–sysctl=“net.ipv4.conf.all.src_valid_mark=1”
–restart unless-stopped
linuxserver/wireguard
My config in wg0.conf:
[Interface]
Address = 10.10.10.1
ListenPort = 51820
PrivateKey = mykey
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
peer1
PublicKey = key1
AllowedIPs = 10.10.10.2/32
[Peer]
peer2
PublicKey = key2
AllowedIPs = 10.10.10.3/32
[Peer]
peer3
PublicKey = key3
AllowedIPs = 10.10.10.4/32
etc.
Configs for the peers:
peer1.conf:
[Interface]
Address = 10.10.10.2
PrivateKey = key
ListenPort = 51820
DNS = 8.8.8.8,1.1.1.1,1.0.0.1,8.8.4.4,176.103.130.130,176.103.130.131,208.67.222.222,208.67.220.220
[Peer]
PublicKey = key
Endpoint = mydomain:51820
AllowedIPs = 0.0.0.0/0
OK.
I have configured 2 clients (1 with my smartphone, other with a PC using Windows 10).
Both (smartphone and PC) connect wit wireguard with no problem. I can do a ping to 10.10.10.1 (Wireguard server in CE) with no problem at all:
ping 10.10.10.1
Haciendo ping a 10.10.10.1 con 32 bytes de datos:
Respuesta desde 10.10.10.1: bytes=32 tiempo=1ms TTL=64
Respuesta desde 10.10.10.1: bytes=32 tiempo=15ms TTL=64
Respuesta desde 10.10.10.1: bytes=32 tiempo=1ms TTL=64
Respuesta desde 10.10.10.1: bytes=32 tiempo=15ms TTL=64
Estadísticas de ping para 10.10.10.1:
Paquetes: enviados = 4, recibidos = 4, perdidos = 0
(0% perdidos),
Tiempos aproximados de ida y vuelta en milisegundos:
Mínimo = 1ms, Máximo = 15ms, Media = 8ms
, BUT, when I try to connect using samba, ssh of sFTP:
\10.10.10.1
ssh root@10.10.10.1
I can’t connect to wireguard server at all:
ssh root@10.10.10.1
ssh: connect to host 10.10.10.1 port 22: Connection refused
Do you know if there is a bug, a bad configuration…?
P.D.: I have opened the port (51820) in the router.
Kind regards