From 9f3c9ce503a1f983ee8fffeb6f1eaf571b976ca0 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Fri, 13 Mar 2026 09:19:04 +0000
Subject: [PATCH] Move gw4/gw6 options to network level (with optional overrides)

---
 README.md |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md
index ff65675..aa1a02a 100644
--- a/README.md
+++ b/README.md
@@ -57,6 +57,37 @@
 
 Disable assignment of IPv6 gateway IP.
 
+`gw4=IP`
+
+`gw6=IP`
+
+Forces assignment of a specified gateway (only if one is not provided by the IPAM module)
+when creating the interface. Useful for [pyipam](https://github.com/jacekkow/docker-plugin-pyipam)
+with `ptp=1` option and `nogw=1`/`nogw4=1`/`nogw6=1` here.
+
+Using these would add routes like:
+```
+default via IP dev eth0
+IP dev eth0 scope link
+```
+
+## Container creation options
+
+To use these options add `--network name=network_name,driver-opt=option=value,driver-opt=option=value`
+to the `docker run` invocation:
+
+```bash
+docker run -i -t --rm --network name=test,ip=192.168.1.1,driver-opt=gw4=192.168.0.1,driver-opt=gw6=fe80:: alpine
+```
+
+Available options:
+
+`gw4=IP`
+
+`gw6=IP`
+
+Overrides network-level gw4/gw6 options.
+
 ## Manual packaging
 
 In order to test this module in development environment, you can build it

--
Gitblit v1.10.0