Hello,
does anyone have a setup similar to mine:
container1:80 -> wireguard-container -> VPS -> public internet
and are willing to share their config? I can’t get mine working.
What’s you issue? It seems you are very deep into your topic, but for others it might not be so obvious. What is container1:80? An application connecting to the internet? A proxy server?
An application connecting to the internet
my issue is that my application doesn’t seem to be forwarded
I’ve only tested it on my local machine as the server and I cannot connect on 10.0.0.1,10.0.0.2 or localhost
(no errors show up when i start the wireguard-container)
server.conf:
[Interface]
Address = 10.0.0.1/24
PrivateKey = aaaaaaaa
ListenPort = 51820
PostUp = iptables -A INPUT -p tcp -d 10.0.0.2 --dport 80 -j ACCEPT
PostUp = iptables -i eth0 -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.0.0.2
PostUp = iptables -t nat -A POSTROUTING -p tcp -d 10.0.0.2 --dport 80 -j MASQUERADE
#PostDown
#PostDown
#PostDown
[Peer]
PublicKey = bbbbbbbb
AllowedIPs = 10.0.0.2/32
client.conf
[Interface]
PrivateKey = cccccccc
Address = 10.0.0.2/24
[Peer]
PublicKey = ddddddd
Endpoint = ip:51820
AllowedIPs = 10.0.0.1/24
PersistentKeepalive = 25
docker-compose (client):
wireguard:
image: lscr.io/linuxserver/wireguard:latest
network:
- app-network
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
PUID: 1000
PGID: 1000
ports:
- 51820:51820/udp
sysctls:
- net.ipv4.ip_forward=1
volumes:
- ./config:/config
- /lib/modules:/lib/modules
- /sys:/sys:rw
networks:
- app-network:
driver: bridge
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.