summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/ethernet4
-rw-r--r--examples/ethernet-static3
-rw-r--r--src/connections/ethernet11
3 files changed, 8 insertions, 10 deletions
diff --git a/docs/ethernet b/docs/ethernet
index d2166ad..09877c8 100644
--- a/docs/ethernet
+++ b/docs/ethernet
@@ -28,11 +28,9 @@ IFOPTS (deprecated, requires IP of 'static')
IP6 (required for IPv6)
: Either 'dhcp', 'dhcp-noaddr', 'stateless', 'static'.
ADDR6 (required for IP6=static)
-: An IPv6 address or subnet.
+: An array of IPv6 addresses: prefix length may be specified via '1234:bcd::11/64' syntax.
GATEWAY6 (for IP6=static)
: The gateway address for IPv6 routing.
-PREFIXLEN (for IP6=static)
-: The netmask for the interface address.
ROUTES6
: An array of custom routes (<address range> via <gateway>)
### DNS
diff --git a/examples/ethernet-static b/examples/ethernet-static
index 2712888..250896d 100644
--- a/examples/ethernet-static
+++ b/examples/ethernet-static
@@ -9,7 +9,6 @@ DNS=('192.168.1.1')
## For IPv6 static address configuration
#IP6='static'
-#ADDR6='1234:5678:9abc:def::1'
-#PREFIXLEN=64
+#ADDR6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
#ROUTES6=('abcd::1234')
#GATEWAY6='1234:0:123::abcd'
diff --git a/src/connections/ethernet b/src/connections/ethernet
index 902b603..a792922 100644
--- a/src/connections/ethernet
+++ b/src/connections/ethernet
@@ -149,11 +149,12 @@ ethernet_up() {
static)
sysctl -q -w net.ipv6.conf.$INTERFACE.accept_ra=0
if [[ -n "$ADDR6" ]]; then
- [[ -z $PREFIXLEN ]] && PREFIXLEN=64
- report_debug ethernet_iproute_up ip -6 addr add "$ADDR6/$PREFIXLEN" dev "$INTERFACE"
- if ! ip -6 addr add "$ADDR6/$PREFIXLEN" dev "$INTERFACE"; then
- report_iproute "Could not configure interface"
- fi
+ for addr in "${ADDR6[@]}"; do
+ report_debug ethernet_iproute_up ip -6 addr add "$addr" dev "$INTERFACE"
+ if ! ip -6 addr add "$addr" dev "$INTERFACE"; then
+ report_iproute "Could not add address $addr to interface"
+ fi
+ done
fi
if [[ -n "$GATEWAY6" ]]; then
report_debug ethernet_iproute_up ip -6 route add default via "$GATEWAY6"