Re: ce0 is primary over hme0, how do I switch?
From: Stefaan A Eeckels (tengo_at_DELETEMEecc.lu)
Date: 09/24/04
- Previous message: Dave Uhring: "Re: PCI I/O card"
- In reply to: Phillip Pacheco: "ce0 is primary over hme0, how do I switch?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Sep 2004 08:55:37 +0200
On 23 Sep 2004 16:38:36 -0700
ppacheco@sbcglobal.net (Phillip Pacheco) wrote:
> Why is ce0 considered the primary, and how do I change that? I
That's because the "init.d/network" startup script reads the
/etc/hostname.* files in alphabetical order:
| # If there are multiple lines we assume the file contains a list of commands to
| # ifconfig with neither the implied bringing up of the interface nor the setting
| # of the default netmask and broadcast address.
| #
| interface_names="`echo /etc/hostname.*[0-9] 2>/dev/null`"
| if [ "$interface_names" != "/etc/hostname.*[0-9]" ]; then
| (
| #
| # If /etc/hostname.lo0 exists the loop below will do
| # additional configuration of lo0.
| #
| echo "configuring IPv4 interfaces:\c"
| ORIGIFS="$IFS"
| IFS="$IFS."
| set -- $interface_names
| IFS="$ORIGIFS"
| while [ $# -ge 2 ]; do
| shift
| if [ "$1" = "ip" -o "$1" = "ip6" ]; then
| #
| # Filenames of the form /etc/hostname.ip.* and
| # /etc/hostname.ip6.* represent tunneling interfaces
| # (see tun(7M)); these are handled later by
| # /etc/init.d/inetinit.
| #
| shift
| while [ $# -gt 1 -a "$1" != "/etc/hostname" ]; do
| shift
| done
| continue
| fi
| if [ "$1" = "xx0" ]; then
| #
| # For some unknown historical reason the xx0
| # ifname is ignored.
| #
| shift
| continue
| fi
| /sbin/ifconfig $1 plumb
etc.
> manually added a route to the logserver, but the client called that a
> workaround, and wants hme0 to be considered the primary interface.
> Yes, we have also considered setting up a management network, as
> separate from production, but we are not in a position to do that
> right now.
The solution is to modify the loop so that hme0 is plumbed first.
ifh="`echo /etc/hostname.h*[0-9] 2>/dev/null`"
ifc="`echo /etc/hostname.c*[0-9] 2>/dev/null`"
[ "$ifh" != "/etc/hostname.h*[0-9]" ] && interface_names = "$ifh"
[ "$ifc" != "/etc/hostname.c*[0-9]" ] && interface_names = "$interface_names $ifh"
if [ ! -z "$interface_names ]; then
(
#
# If /etc/hostname.lo0 exists the loop below will do
# additional configuration of lo0.
etc.
Note that a modified startup file will be silently set back
to the default if you upgrade the OS.
Take care,
-- Stefaan -- "What is stated clearly conceives easily." -- Inspired sales droid
- Previous message: Dave Uhring: "Re: PCI I/O card"
- In reply to: Phillip Pacheco: "ce0 is primary over hme0, how do I switch?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|