summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémy Oudompheng <remy@archlinux.org>2011-06-13 14:00:35 +0200
committerRémy Oudompheng <remy@archlinux.org>2011-06-13 14:01:14 +0200
commit67d1a8078a89c34fbf427942a4de24a8c8556e6a (patch)
tree515a34ca821e3aea7d12f05c0464b2abe839e5cd
parent9fb49752b99f58577323d81f98f8a790d5648a00 (diff)
downloadnetctl-67d1a8078a89c34fbf427942a4de24a8c8556e6a.tar.gz
netctl-67d1a8078a89c34fbf427942a4de24a8c8556e6a.tar.xz
IPv6: remove PREFIXLEN option and turn ADDR6 into an array
This allows configuring multiple IPv6 addresses on the same interface. Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
-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"