From 3ef5489578b849d3632cbd858245e0f18b5fe8dd Mon Sep 17 00:00:00 2001 From: James Rayner Date: Sun, 21 Feb 2010 22:53:23 +1100 Subject: Add adjustable netmask to IP='static' --- src/connections/ethernet | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/connections') 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 -- cgit v1.2.3-24-g4f1b