ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
4.17k stars 514 forks source link

UI can not be accessed when using the latest Linuxserver WG Image #609

Open nextcloudfan opened 3 months ago

nextcloudfan commented 3 months ago

With the latest linuxserver wiregaurd image it is not possible the the WG UI. See here: https://forum.openmediavault.org/index.php?thread/50500-if-you-are-experiencing-difficulties-connecting-to-the-wireguard-ui-or-encounter/

You have to use an old image of linuxserver wireguard. When do you plan to update wireguard UI to handle this?

yangsongjiang commented 2 months ago

@nextcloudfan thank you very much

Bojo67 commented 2 months ago

Oui, l'image fournit dans docker compose ne fonctionne pas, l'interface reste inaccessible, j'utilise celle-ci qui fonctionne : linuxserver/wireguard:v1.0.20210914-ls6

ilium007 commented 1 month ago

Not working with:

Linuxserver.io version: 1.0.20210914-r4-ls52
wireguard     | Build-date: 2024-09-19T11:23:35+00:00
paranic commented 1 month ago

I am not sure but i think i have the same issue here with the latest image. it can only be accessed through ipv6 address of the host machine. eg [ipv6adress]:5000

as a workaround i set network_mode: host and ports:

paranic commented 1 month ago

as i think it is like this by design you cannot set host to listen on 0.0.0.0 by default it works only on 127.0.0.1:5000 and you are supposed to setup an http proxy to expose the service.

kangdu commented 4 weeks ago

Linuxserver.io has a section in their readme abou this. You'll need to have below post up and predown in your config to allow access.

https://github.com/linuxserver/docker-wireguard?tab=readme-ov-file#maintaining-local-access-to-attached-services Maintaining local access to attached services ** Note: This is not a supported configuration by Linuxserver.io - use at your own risk.

When routing via Wireguard from another container using the service option in docker, you might lose access to the containers webUI locally. To avoid this, exclude the docker subnet from being routed via Wireguard by modifying your wg0.conf like so (modifying the subnets as you require):

[Interface] PrivateKey = Address = 9.8.7.6/32 DNS = 8.8.8.8 PostUp = DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route add $HOMENET3 via $DROUTE;ip route add $HOMENET2 via $DROUTE; ip route add $HOMENET via $DROUTE;iptables -I OUTPUT -d $HOMENET -j ACCEPT;iptables -A OUTPUT -d $HOMENET2 -j ACCEPT; iptables -A OUTPUT -d $HOMENET3 -j ACCEPT; iptables -A OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT PreDown = DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route del $HOMENET3 via $DROUTE;ip route del $HOMENET2 via $DROUTE; ip route del $HOMENET via $DROUTE; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -d $HOMENET -j ACCEPT; iptables -D OUTPUT -d $HOMENET2 -j ACCEPT; iptables -D OUTPUT -d $HOMENET3 -j ACCEPT