diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-22 22:53:39 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-22 22:53:39 +0100 |
commit | c316bc87923cd8a740a5e707a56bdfc7704076d8 (patch) | |
tree | f690132de6a51c22cff5a289c5a6044eba995dc7 | |
parent | 3b0ca46fbbcf5bbbb79abbc16856dfc7bd12dc76 (diff) | |
download | alpine-conf-c316bc87923cd8a740a5e707a56bdfc7704076d8.zip |
setup-interfaces: allow 'manual' interfaces without ip addr
Useful for bonding and bridges
-rwxr-xr-x | setup-interfaces.in | 11 |
1 files 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 |