]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network/ifup.sh: handle $dns1 and $dns2 from "ip=" settings
authorHarald Hoyer <harald@redhat.com>
Thu, 30 Jan 2014 16:12:24 +0000 (17:12 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 29 Jul 2014 09:52:05 +0000 (11:52 +0200)
dracut.cmdline.7.asc
modules.d/40network/ifup.sh

index 963ba0743e164a0527d35745d0e5f785b3314cac..985285b4dc45ebc9b52c018c36dc06af424a6a6b 100644 (file)
@@ -472,6 +472,13 @@ cannot be used in conjunction with the **ifname** argument for the
 same <interface>.
 =====================
 
+**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__[:[__<dns1>__][:__<dns2>__]]::
+    explicit network configuration. If you want do define a IPv6 address, put it
+    in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple
+    times. __<peer>__ is optional and is the address of the remote endpoint
+    for pointopoint interfaces and it may be followed by a slash and a decimal
+    number, encoding the network prefix length.
+
 **ifname=**__<interface>__:__<MAC>__::
     Assign network device name <interface> (ie "bootnet") to the NIC with
     MAC <MAC>.
index 2edcfe695dca55124549107356f5b51879db1cb0..b33981b228d14ae1689ebb835b489578d099d2cd 100755 (executable)
@@ -264,18 +264,15 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
     ip link set "$vlanname" up
 fi
 
-# setup nameserver
-namesrv=$(getargs nameserver)
-if  [ -n "$namesrv" ] ; then
-    for s in $namesrv; do
-        echo nameserver $s
-    done
-fi >> /tmp/net.$netif.resolv.conf
-
 # No ip lines default to dhcp
 ip=$(getarg ip)
 
 if [ -z "$ip" ]; then
+    namesrv=$(getargs nameserver)
+    for s in $namesrv; do
+        echo nameserver $s >> /tmp/net.$netif.resolv.conf
+    done
+
     if [ "$netroot" = "dhcp6" ]; then
         do_dhcp -6
     else
@@ -307,8 +304,14 @@ for p in $(getargs ip=); do
     [ "$use_bridge" != 'true' ] && \
     [ "$use_vlan" != 'true' ] && continue
 
+    # setup nameserver
+    namesrv="$dns1 $dns2 $(getargs nameserver)"
+    for s in $namesrv; do
+        echo nameserver $s >> /tmp/net.$netif.resolv.conf
+    done
+
     # Store config for later use
-    for i in ip srv gw mask hostname macaddr; do
+    for i in ip srv gw mask hostname macaddr dns1 dns2; do
         eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
     done > /tmp/net.$netif.override