Opened 12 years ago

Closed 12 years ago

#3053 closed enhancement (fixed)

Network Configuration - ifup, ifdown, bridge, ipv4-static

Reported by: qrux Owned by: bdubbs@…
Priority: normal Milestone: 7.2
Component: Bootscripts Version: SVN
Severity: normal Keywords: network, bridge, ifup, ifdown, ipv4, dhcp
Cc:

Description

Modified ifup and ifdown to be more friendly to downstream services. The main use-case is bridging, where the "interface to be configured" differs from the physical interface (e.g., br0 != eth0).

Attachments (4)

ifup (3.3 KB ) - added by qrux 12 years ago.
/sbin/ifup
ifdown (3.1 KB ) - added by qrux 12 years ago.
/sbin/ifdown
bridge (1.7 KB ) - added by qrux 12 years ago.
/lib/services/bridge
ipv4-static (2.9 KB ) - added by qrux 12 years ago.
/lib/services/ipv4-static

Download all attachments as: .zip

Change History (9)

by qrux, 12 years ago

Attachment: ifup added

/sbin/ifup

by qrux, 12 years ago

Attachment: ifdown added

/sbin/ifdown

by qrux, 12 years ago

Attachment: bridge added

/lib/services/bridge

by qrux, 12 years ago

Attachment: ipv4-static added

/lib/services/ipv4-static

comment:1 by bdubbs@…, 12 years ago

Owner: changed from lfs-book@… to bdubbs@…
Status: newassigned

comment:2 by qrux, 12 years ago

Summary: Network Configuration - Downstream FriendlyNetwork Configuration - ifup, ifdown, bridge, ipv4-static

The gist is to separate out the different interface names. In the prior version, the variable IFACE held the physical interface name, which caused an issue with interfaces like bridge. Specifically, in a vanilla ipv4-static setup, the user never notices the difference between the physical link with the "logical link" because they are both named, for example, eth0.

In bridging, though, the logical link is the bridge (e.g., br0) and not the physical link (e.g., eth0). To resolve this, several new variables are proposed, along with changing the name of the IFACE variable to PHYS (to unambiguously name the physical interface). This separation has several benefits, including the ability to properly separate logic between ifup and the downstream services. For example, ifup can now properly set MTU on the physical link. It's also responsible for bringing the physical link into the UP state (and ifdown for the DOWN state). Then, each downstream service will see its own interface variable. IPV4_IF was chosen for the ipv4-static service, and BRIDGE_IF was chosen for the bridge service.

For maximum "ease of transition", ipv4-static has been modified to look first for its own variable IPV4_IF; failing to find that, it will use the first word of PHYS as the service interface; i.e., the interface to be configured with IPv4 parameters. For non-bridge (and other tunnel-like link) users, the impact is fairly minimal--it's simply changing IFACE in the existing configuration files to PHYS.

For bridge (and other tunnel-like link) users, the impact is two additional variables: BRIDGE_IF (e.g., "br0") and IPV4_IF (e.g., "br0"). This allows the bridge service to create a bridge named by BRIDGE_IF, and allows ipv4-static to assign the IPv4 parameters to the interface named by IPV4_IF (e.g., "br0"). This also prevents user-error when configuring bridges by a previously confusing naming convention (disambiguating IFACE from INTERFACES).

comment:3 by bdubbs@…, 12 years ago

You are changing several variables. Can you attach some example ifconfig files to show how they work with your proposed scripts.

comment:4 by qrux, 12 years ago

Sample Bridge Configuration:

ONBOOT=yes
PHYS="eth0"
SERVICE="bridge ipv4-static"
BRIDGE_IF="br0"
STP=no
IPV4_IF="br0"
IP=192.168.0.250
GATEWAY=192.168.0.1
PREFIX=24

Sample Vanilla Configuration:

ONBOOT=yes
PHYS=eth0
SERVICE="ipv4-static"
IP=192.168.0.250
GATEWAY=192.168.0.1
PREFIX=24

These are meant to be used with the attached ifup/ifdown/ipv4-static/bridge. This has not been reviewed for support of virtual interfaces (e.g., eth0:1...or br0:1--if that's even possible).

comment:5 by bdubbs@…, 12 years ago

Resolution: fixed
Status: assignedclosed

Several changes were made to the networking boot scripts in rev 9808.

   * General update of network scripts ifup/ifdown and services
   ** Add if_true utility function to init_functions
   ** Change variable INTERFACES to COMPONENT_INTERFACES for bridge interface
   ** ifdown now only uses the first SERVICE
   ** Updated ifup.8 to reflect current usage
   ** ifup
   *** Move interface up logic to after service scripts.  Eliminates the
       need for the LINK_CHECK variable.
   *** Sets the GATEWAY if the variable is set
   *** Add MTU logic to ifup

Please open a new ticket if further problems are noted.

Note: See TracTickets for help on using tickets.