I have a RHAS4 2.6 kernel install with 6 NIC's. How do i tell it which nic I want to be labeled eth0? specifically, i have 2 nics built into the mobo, and 2 dual port addon cards. I want eth0 to be nic1 on the mobo, and eth1 to be nic2 on the mobo. By default it is assigning those nics to eth4 and eth5. thanks in advance... mike
==> Regarding [Wlug] Specify which nic gets named eth0; Mike Leo <mleo963@yahoo.com> adds: mleo963> I have a RHAS4 2.6 kernel install with 6 NIC's. How do i tell it mleo963> which nic I want to be labeled eth0? mleo963> specifically, i have 2 nics built into the mobo, and 2 dual port mleo963> addon cards. mleo963> I want eth0 to be nic1 on the mobo, and eth1 to be nic2 on the mleo963> mobo. mleo963> By default it is assigning those nics to eth4 and eth5. You can specify a hardware address in the ifcfg-ethX scripts: HWADDR=00:04:23:B3:B4:C3 -Jeff
yes, but that will only assign the right mac to the wrong NIC. eth0 will still be assigned to the "extra" nic port, not the one I want. but thanks for replying. --- Jeff Moyer <jmoyer@redhat.com> wrote:
==> Regarding [Wlug] Specify which nic gets named eth0; Mike Leo <mleo963@yahoo.com> adds:
mleo963> I have a RHAS4 2.6 kernel install with 6 NIC's. How do i tell it mleo963> which nic I want to be labeled eth0?
mleo963> specifically, i have 2 nics built into the mobo, and 2 dual port mleo963> addon cards.
mleo963> I want eth0 to be nic1 on the mobo, and eth1 to be nic2 on the mleo963> mobo.
mleo963> By default it is assigning those nics to eth4 and eth5.
You can specify a hardware address in the ifcfg-ethX scripts:
HWADDR=00:04:23:B3:B4:C3
-Jeff
==> Regarding Re: [Wlug] Specify which nic gets named eth0; Mike Leo <mleo963@yahoo.com> adds: mleo963> yes, but that will only assign the right mac to the wrong NIC. mleo963> eth0 will still be assigned to the "extra" nic port, not the one I mleo963> want. mleo963> but thanks for replying. Hmm, will an alias in /etc/modprobe.conf help, then? For example: alias eth0 tulip This will only work if the ethernet cards use different drivers, obviously. -Jeff mleo963> --- Jeff Moyer <jmoyer@redhat.com> wrote:
==> Regarding [Wlug] Specify which nic gets named eth0; Mike Leo <mleo963@yahoo.com> adds:
mleo963> I have a RHAS4 2.6 kernel install with 6 NIC's. How do i tell it mleo963> which nic I want to be labeled eth0?
mleo963> specifically, i have 2 nics built into the mobo, and 2 dual port mleo963> addon cards.
mleo963> I want eth0 to be nic1 on the mobo, and eth1 to be nic2 on the mleo963> mobo.
mleo963> By default it is assigning those nics to eth4 and eth5.
You can specify a hardware address in the ifcfg-ethX scripts:
HWADDR=00:04:23:B3:B4:C3
-Jeff
On Fri, Feb 17, 2006 at 12:41:21PM -0800, Mike Leo wrote:
yes, but that will only assign the right mac to the wrong NIC. eth0 will still be assigned to the "extra" nic port, not the one I want. but thanks for replying.
HWADDR doesn't assign MAC addresses to NICs. It just matches the NIC device with that hardware address. MACADDR actually reprograms the MAC used by a NIC.
Looks like you're right!
From Redhat support:
If you look in the /etc/sysconfig/network-scripts/ directory you'll see a number of scripts named ifcfg-eth0, ifcfg-eth1, etc... Inside each of these files you should see a line HWADDR=xx:xx:xx:xx:xx:xx. Pluging in the MAC address for the desired NIC should allow you to specify which card uses which interface. Restart networking and you should be good to go. --- Chuck Anderson <cra@WPI.EDU> wrote:
On Fri, Feb 17, 2006 at 12:41:21PM -0800, Mike Leo wrote:
yes, but that will only assign the right mac to the wrong NIC. eth0 will still be assigned to the "extra" nic port, not the one I want. but thanks for replying.
HWADDR doesn't assign MAC addresses to NICs. It just matches the NIC device with that hardware address.
MACADDR actually reprograms the MAC used by a NIC. _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
Is anybody else noticing that wlug messages are repeating?
From: Mike Leo <mleo963@yahoo.com>
Looks like you're right!
From Redhat support:
If you look in the /etc/sysconfig/network-scripts/ directory you'll see a number of scripts named ifcfg-eth0, ifcfg-eth1, etc... Inside each of these files you should see a line HWADDR=xx:xx:xx:xx:xx:xx. Pluging in the MAC address for the desired NIC should allow you to specify which card uses which interface. Restart networking and you should be good to go.
--- Chuck Anderson <cra@WPI.EDU> wrote:
On Fri, Feb 17, 2006 at 12:41:21PM -0800, Mike Leo wrote:
yes, but that will only assign the right mac to the wrong NIC. eth0 will still be assigned to the "extra" nic port, not the one I want. but thanks for replying.
HWADDR doesn't assign MAC addresses to NICs. It just matches the NIC device with that hardware address.
MACADDR actually reprograms the MAC used by a NIC.
I think he may be right too, but the quote from Redhat actually says he is wrong. Redhat says HWADDR specifies which card goes in that slot; Chuck says MACADDR does it. I guess it depends on what you mean by "specify". I think the HWADDR just gives you error messages when it is wrong, but doesn't actually change the name. It may depend upon your specific version. I think both the kernel and the start-up scripts have been changing the way they do this. Here's what works for me: in /etc/init.d/network add the lines: # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 # set the ethernet names from the MAC addresses nameif || echo "Can not rename ethernet cards" in /etc/mactab: #The eth on the Intel motherboard is for the lan ethlan 00:13:20:1e:5b:1d #The Realtek in the pci slot is for the internet ethdsl 00:50:FC:A7:56:0F try "man nameif" for explanation, and then change mactab to contain the names you like instead of ethlan and ethdsl, the MAC addresses of your cards, and more interesting comments. /etc/sysconfig/network-scripts/ifcfg-ethlan # Intel Corp.|82562EZ 10/100 Ethernet Controller DEVICE=ethlan BOOTPROTO=static BROADCAST=192.168.1.255 HWADDR=00:13:20:1e:5b:1d IPADDR=192.168.1.111 NETMASK=255.255.255.0 NETWORK=192.168.1.0 ONBOOT=yes TYPE=Ethernet /etc/sysconfig/network-scripts/ifcfg-ethdsl # Realtek|RTL-8139/8139C/8139C+ DEVICE=ethdsl BOOTPROTO=static BROADCAST=66.92.74.255 HWADDR=00:50:FC:A7:56:0F IPADDR=66.92.74.188 NETMASK=255.255.255.0 NETWORK=66.92.74.0 TYPE=Ethernet ONBOOT=no # uname -a Linux fcs12 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 i686 i686 i386 GNU/Linux # cat /etc/fedora-release Fedora Core release 3 (Heidelberg) Like I said, it works for me but YMMV, You Might Muck-up your Version. -- -- Keith Wright <kwright@free-comp-shop.com> Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com> --- Food, Shelter, Source code. ---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Keith Wright wrote:
Is anybody else noticing that wlug messages are repeating?
Yes Yes - -- Andy Stewart, Founder Worcester Linux Users' Group Worcester, MA, USA http://www.wlug.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD9rc2Hl0iXDssISsRAiAfAJ480WmZIoj5yYtm3n5vl1hRoTVqBgCcDvvC s2YsbjuGCEJY/kAgCBM8amM= =Hzc5 -----END PGP SIGNATURE-----
Mike> I have a RHAS4 2.6 kernel install with 6 NIC's. How do i tell Mike> it which nic I want to be labeled eth0? Udev? Mike> specifically, i have 2 nics built into the mobo, and 2 dual port Mike> addon cards. Mike> I want eth0 to be nic1 on the mobo, and eth1 to be nic2 on the Mike> mobo. What happened to nic0? Ok, I'm being a smartass... :] Mike> By default it is assigning those nics to eth4 and eth5. It's probably due to how the PCI bus get ennumerated. Try using the 'nameif' command to fix which MAC address is bound to which eth* name. You'll probably need to do: udevinfo -a -p /sys/class/net/eth0 and see what shows up. It might be best to do this after setting up all six interfaces (not caring what is where) so you can get their MAC addresses and put them into the table. John
I brought this up last night, but the suggestions did not help. Basically i have a "thing" i need to run at boot as someone else. init scripts are launched at boot as root, so somewhere in the script, I have to become someone else to execute this "thing". sample thing: su -l LNVAPP008SSH -c "/usr/local/bin/ssh2 -p 32497 -R51180:LNVAPP008:80 -l LNVAPP008SSH n2web043" This works just fine when logged in as root or as the LNVAPP008SSH user from the command line. The ssh has been setup so that this user (LNVAPP008SSH) does not need to pass a password to initiate the ssh tunnel. However, when this is called from a script, it fails trying to look for a password. I am surmizing that the script is still acting as root when it makes the ssh connection. When i put a printenv in the script, it reports me as still being root, not the LNVAPP008SSH user. I also have another situation that I need to apply this too. This seems like it should be something someone else in the world has done before. So any thoughts on this would be greatly appreciated. Thanks Mike
I ran into a similar problem when getting "hooks" in subversion to work... The shell script was run as "user1" and I needed it to run as "user2" so I wrote a shell script (owned by "user1") that kicked off a small C program which ran the script I need run by "user2". Something along the lines of: #include <stddef.h> #include <stdlib.h> #include <unistd.h> int main(void) { execl("/home/user1/script", "script", (const char *) NULL); return(EXIT_FAILURE); } * NOTE: I had no success using "exec", it only worked with "execl" Then make the program and the key is the "chmod +s" gcc test.c -o test chown user2:user2 test chmod +s test Obviously there may be security risks with this method! Hope this helps! Michael Z Mike Leo wrote:
I brought this up last night, but the suggestions did not help.
Basically i have a "thing" i need to run at boot as someone else.
init scripts are launched at boot as root, so somewhere in the script, I have to become someone else to execute this "thing".
sample thing:
su -l LNVAPP008SSH -c "/usr/local/bin/ssh2 -p 32497 -R51180:LNVAPP008:80 -l LNVAPP008SSH n2web043"
This works just fine when logged in as root or as the LNVAPP008SSH user from the command line. The ssh has been setup so that this user (LNVAPP008SSH) does not need to pass a password to initiate the ssh tunnel.
However, when this is called from a script, it fails trying to look for a password.
I am surmizing that the script is still acting as root when it makes the ssh connection. When i put a printenv in the script, it reports me as still being root, not the LNVAPP008SSH user.
I also have another situation that I need to apply this too. This seems like it should be something someone else in the world has done before.
So any thoughts on this would be greatly appreciated.
Thanks Mike _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
participants (7)
-
Andy Stewart
-
Chuck Anderson
-
Jeff Moyer
-
John Stoffel
-
Keith Wright
-
Michael Zarozinski
-
Mike Leo