Bug 745189

Summary: Need "manual" method of configuring network interfaces
Product: Red Hat Enterprise Linux 5 Reporter: Cong Wang <amwang>
Component: busyboxAssignee: Denys Vlasenko <dvlasenk>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.8CC: amwang, rkhan
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-14 12:33:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 682359, 752458    

Description Cong Wang 2011-10-11 15:40:02 UTC
Description of problem:

The busybox on RHEL5 doesn't understand "manual" method to configure a network interface, so without it, we can't use ifup to bring the interface up without assigning any IP address.

IOW, ifup from busybox should support the following configuration:

/etc/network/interfaces
auto eth0
iface eth0 inet manual
       up ifconfig $IFACE 0.0.0.0 up
       down ifconfig $IFACE down

Additional info:
Upstream busybox supports this, see:
http://git.busybox.net/busybox/tree/networking/ifupdown.c

Comment 1 Denys Vlasenko 2011-10-12 11:31:52 UTC
I was able to up eth0 interface without assigning an address to it using busybox from RHEL5 and the following configuration in /etc/network/interfaces:

auto eth0
iface eth0 inet static
    address 0.0.0.0
    netmask 0.0.0.0
    bnmask 0

State before "ifup eth0":

# ip a l dev eth0
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:1e:37:d0:50:06 brd ff:ff:ff:ff:ff:ff

State after "ifup eth0":

# ip a l dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:1e:37:d0:50:06 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::21e:37ff:fed0:5006/64 scope link tentative 
       valid_lft forever preferred_lft forever

Strace log indicates that the following commands are executed by ifup:

# grep execv LOG2  | grep -v '"/bin/sh"'
4999  execve("./busybox", ["./busybox", "ifup", "eth0"], [/* 51 vars */]) = 0
5000  execve("/usr/bin/run-parts", ["run-parts", "/etc/network/if-pre-up.d"], [/* 11 vars */]) = 0
5002  execve("/sbin/ip", ["ip", "addr", "add", "0.0.0.0/0", "dev", "eth0", "label", "eth0"], [/* 11 vars */]) = 0
5003  execve("/sbin/ip", ["ip", "link", "set", "eth0", "up"], [/* 11 vars */]) = 0
5005  execve("/usr/bin/run-parts", ["run-parts", "/etc/network/if-up.d"], [/* 11 vars */]) = 0

Yes, assigning address 0.0.0.0/0 to eth0 is pointless, but apparently harmless: kernel recognizes it as a special case of "no address".

I also verified that it works with upstream busybox too, and also works if busybox is configured to use "ifconfig" tool (not "ip").

If this work-around acceptable for you?

Comment 2 Cong Wang 2011-10-13 11:13:15 UTC
Hi, Denys,

Your workaround works fine for me, thanks a lot! So we don't need this request for "manual" method now, I will leave to you to evaluate if we need to close this BZ.

Comment 3 Cong Wang 2011-10-14 05:29:50 UTC
BTW, I saw this error today,

+ ifconfig eth0 0.0.0.0 netmask 0.0.0.0
SIOCSIFNETMASK: Cannot assign requested address
+ exit 0

Comment 4 Cong Wang 2011-10-14 07:55:58 UTC
Never mind, it is my mistake...

Comment 5 Denys Vlasenko 2011-10-14 12:33:18 UTC
I guess RHEL5 can live with the current situation. Closing as WONTFIX.