LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-12-2007, 03:07 AM   #1
qanopus
Senior Member
 
Registered: Jul 2002
Location: New York
Distribution: Slackware
Posts: 1,358

Rep: Reputation: 45
two nics; inconsistent network interface number assignment


Hi,

I'm having the following issue. I have two network cards in my box, eth0 and eth1. One is an mobo onboard card and the other addon card.

lspci output

Code:
00:05.0 Bridge: nVidia Corporation CK8S Ethernet Controller (rev a2)
02:07.0 Ethernet controller: ADMtek NC100 Network Everywhere Fast Ethernet 10/100 (rev 11)
The problem is, sometimes the onboard card is assigned eth0, and sometimes the ADMtek card is. I have DHCP to configure my network settigns and I have the following startup script to get around the problem:

Code:
#!/bin/bash

desktopIP=10.0.0.1
nmask=255.255.0.0

for iface in {eth1,eth0}; do
 
        /sbin/dhcpcd $iface -t 5s

        if [ -f /etc/dhcpc/dhcpcd-$iface.pid ]; then
                echo "dhcp running on $iface";
                exit
        else
                /sbin/ifconfig $iface $desktopIP netmask $nmask up
        fi

done
But how do I get around this in an elegant way?
 
Old 02-13-2007, 01:55 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
You don't say on which distro you have this problem, but if device names are given by udev, you can add rules to achieve persistent naming (see here).
 
Old 02-14-2007, 09:25 AM   #3
qanopus
Senior Member
 
Registered: Jul 2002
Location: New York
Distribution: Slackware
Posts: 1,358

Original Poster
Rep: Reputation: 45
Thanks! I'm using slackware 11.0 (unofficial amd64 version) by the way, which I think does use udev.

Last edited by qanopus; 02-14-2007 at 09:26 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Number NICs on remote PC timonbg Linux - Networking 5 10-18-2006 05:31 AM
shell command to find the number of collisions of NICs RajRed Linux - Newbie 14 04-19-2006 01:20 PM
interface number assignment ralphb Linux - Wireless Networking 1 09-21-2004 02:01 PM
network interface assignment, how? Oxyacetylene Linux - Networking 0 06-18-2004 10:47 AM
inconsistent network access cognus_amaurosi Linux - Networking 3 09-03-2003 01:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration