Skip to contentSkip to conversation

Patch for ip setting on bridge interface and vlan

DISCUSSION Kevin Yung 1 participant 2 messages Jan 23, 2013

lore
Share & tools
lore

Kevin Yung

author
#0 lore raw

Hi all,

I have an environment that needs to boot on bridged interface or interface using vlan.

I found curent dracut release will by pass ip settings on these interfaces.

So I wrote the a patch to set up provided ip options on the interfaces that using bridge or vlan.

Please let me know if I need to tidy it up a bit more or add additional code to handle ip settings on bridge

and vlan.

Cheers
Kevin

author
#1 lore raw

Patch

ifup.sh.new 2013-01-24 09:50:46.000000000 +1100 renamed from ifup.sh.org 2013-01-21 17:46:19.000000000 +1100 +8 -1
@@ -17,6 +17,8 @@
 
 # $netif reads easier than $1
 netif=$1
+use_bridge='false'
+use_vlan='false'
 
 # enslave this interface to bond?
 if [ -e /tmp/bond.info ]; then
@@ -46,6 +48,7 @@
                 : # We need to really setup bond (recursive call)
             else
                 netif="$bridgename"
+                use_bridge='true'
             fi
         fi
     done
@@ -58,6 +61,7 @@
             : # We need to really setup bond (recursive call)
         else
             netif="$vlanname"
+            use_vlan='true'
         fi
     fi
 fi
@@ -256,6 +260,7 @@
     fi
 fi
 
+
 # Specific configuration, spin through the kernel command line
 # looking for ip= lines
 for p in $(getargs ip=); do
@@ -264,7 +269,9 @@
     [ "$autoconf" = "ibft" ] && continue
 
     # If this option isn't directed at our interface, skip it
-    [ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
+    [ -n "$dev" ] && [ "$dev" != "$netif" ] && \
+    [ "$use_bridge" != 'true' ] && \
+    [ "$use_vlan" != 'true' ] && continue
 
     # Store config for later use
     for i in ip srv gw mask hostname macaddr; do