diff options
author | James Rayner <james@archlinux.org> | 2010-02-21 12:53:23 +0100 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2010-02-21 12:53:23 +0100 |
commit | 3ef5489578b849d3632cbd858245e0f18b5fe8dd (patch) | |
tree | 496980fb0febe74977be622400ec17c2477dcb7f | |
parent | 1b3a2e870c5619ad3a6c2ca5c7f30ccf37c8d422 (diff) | |
download | netctl-3ef5489578b849d3632cbd858245e0f18b5fe8dd.tar.gz netctl-3ef5489578b849d3632cbd858245e0f18b5fe8dd.tar.xz |
Add adjustable netmask to IP='static'
-rw-r--r-- | docs/ethernet | 2 | ||||
-rw-r--r-- | src/connections/ethernet | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/ethernet b/docs/ethernet index a128697..5df810a 100644 --- a/docs/ethernet +++ b/docs/ethernet @@ -16,6 +16,8 @@ ADDR (requires IP of 'static') : A single IP address to configure a static IP. For example: GATEWAY (requires IP of 'static') : Set specified gateway +NETMASK (requires IP of 'static') +: Set specified netmask. Defaults to 24 IPCFG : Array of arguments to pass to 'ip'. The power of this options is that it allows both simple and complicated routing configurations, within the framework of netcfg. IFOPTS (deprecated, requires IP of 'static') diff --git a/src/connections/ethernet b/src/connections/ethernet index 8e51cf9..36f6b93 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -71,8 +71,9 @@ ethernet_up() { ;; static) if [[ -n "$ADDR" ]]; then - report_debug ethernet_iproute_up ip addr add "$ADDR/24" brd + dev "$INTERFACE" - if ! ip addr add "$ADDR/24" brd + dev "$INTERFACE"; then + [[ -z $NETMASK ]] && NETMASK=24 + report_debug ethernet_iproute_up ip addr add "$ADDR/$NETMASK" brd + dev "$INTERFACE" + if ! ip addr add "$ADDR/$NETMASK" brd + dev "$INTERFACE"; then report_iproute "Could not configure interface" fi fi |