leomos / dwgd

Docker WireGuard Driver
MIT License
117 stars 2 forks source link

Document the `dwgd.route` option in the readme #4

Open pcouy opened 3 months ago

pcouy commented 3 months ago

Hi ! After coming up with my own hacky solution to use the wireguard interface as the default route inside the containers, I looked into properly adding it to your plugin. That's when I noticed the dwgd.route option in your code.

Do I understand correctly that adding the following line to my docker-compose.yml will route all traffic that is not local to the default docker network through my wireguard peer ?

networks:
  wgnet:
    driver: dwgd
    driver_opts:
      dwgd.route: 0.0.0.0/0
      [...other options documented in the readme]

If you confirm this is correct, I will submit a pull request to document this in the README.

leomos commented 3 months ago

Hello,

you are correct and can send a pull request.

Just to be super-pedantic, the route can be anything: if you set that value to 192.168.0.1/24 it would route every packet destined to that subnet over the wireguard interface.

Unfortunately as of today it is not possible to add more than one route; but it should be easy enough to implement this feature if needed.

Thanks a lot for filing this!