[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Network interface name
- From: "penguin" <mnmasterjp ybb ne jp>
- To: "Discussion of Red Hat Enterprise Linux 3 \(Taroon\)" <taroon-list redhat com>
- Subject: Re: Network interface name
- Date: Thu, 23 Dec 2004 16:54:51 +0900
----- Original Message -----
From: "Ed Wilts" <ewilts ewilts org>
To: "Discussion of Red Hat Enterprise Linux 3 (Taroon)"
<taroon-list redhat com>
Sent: Thursday, December 23, 2004 1:16 PM
Subject: Re: Network interface name
> On Thu, Dec 23, 2004 at 01:10:13PM +0900, penguin wrote:
> > I have a server with two network interfaces.
> > Both of network cards are the products made from Broadcom.
> > 1st network Interface name's is eth0.
> > 2st network Interface name's is eth1.
> >
> > I want to change the 1st network interface name into eth1,
> > and to change the 2nd network interface name into eth0.
> > Is this possible?
>
> Sure. Edit the cfg files in /etc/sysconfig/network-scripts/ifcfg-eth*
> Each file can take a parameter HWADDR that has the hardware address of
> the device it's for. I don't have time to look up the exact syntax, but
> this should get you going in the right direction.
>
> --
> Ed Wilts, RHCE
> Mounds View, MN, USA
> mailto:ewilts ewilts org
> Member #1, Red Hat Community Ambassador Program
>
> --
> Taroon-list mailing list
> Taroon-list redhat com
> http://www.redhat.com/mailman/listinfo/taroon-list
>
I read the ifup script.
I think that it is impossible by the method.
Before ifup script is run, I think that the network interface name is
already attached.
The following is a part of ifup script.
ifup -------------------------------------------------------
if [ -n "${HWADDR}" ]; then
FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \
sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'`
if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}"
/etc/sysconfig/network-scripts/ifcfg-*`
if [ -n "${NEWCONFIG}" -a "`basename ${NEWCONFIG}`" !=
"${CONFIG}" ]; then
exec /sbin/ifup ${NEWCONFIG}
fi
NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}"
/etc/sysconfig/networking/default/ifcfg-*`
if [ -n "${NEWCONFIG}" -a "`basename ${NEWCONFIG}`" !=
"${CONFIG}" ]; then
exec /sbin/ifup ${NEWCONFIG}
else
echo $"Device ${DEVICE} has different MAC address than expected,
ignoring."
exit 1
fi
fi
fi
---------------------------------------------------------------
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]