From c316bc87923cd8a740a5e707a56bdfc7704076d8 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 22 Mar 2012 22:53:39 +0100 Subject: setup-interfaces: allow 'manual' interfaces without ip addr Useful for bonding and bridges --- setup-interfaces.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup-interfaces.in b/setup-interfaces.in index 042475e..bb2325c 100755 --- a/setup-interfaces.in +++ b/setup-interfaces.in @@ -141,16 +141,19 @@ config_iface() { while ! ipcalc -s -m $address >/dev/null 2>&1; do address=`get_default_addr $iface` [ -z "$address" ] && address="dhcp" - ask "Ip address for $iface? (or 'dhcp' or '?')" $address + ask "Ip address for $iface? (or 'dhcp', 'none', '?')" $address address=$resp case "$resp" in '?') ipaddr_help;; "abort") return;; "dhcp") - HAS_DHCP=yes echo "type=dhcp" >> $conf unconfigured_del $iface return ;; + "none") + echo "type=manual" >> $conf + unconfigured_del $iface + return;; br[0-9]*|bridge[0-9]*) case "$iface" in # we dont allow bridge bridges @@ -357,6 +360,10 @@ prompt_for_interfaces() { echo -e "\tbond-slaves $bond_slaves" >> interfaces fi case $type in + manual) + echo -e "\tup ip link set \$IFACE up" >> interfaces + echo -e "\tdown ip link set \$IFACE down" >> interfaces + ;; dhcp) [ -n "$hostname" ] \ && echo -e "\thostname $hostname" >> interfaces -- cgit v1.2.3