LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   network interface question in debian (https://www.linuxquestions.org/questions/debian-26/network-interface-question-in-debian-727403/)

webofunni 05-20-2009 06:34 PM

network interface question in debian
 
Hi,

My system contains two nics.

1. On-board LAN card.
2. One PCI card.

My on-board LAN card get damaged after a short circute or something. So I purchased the PCI card. After inserting the PCI card, I started the system. Then executed 'ifconfig'. But the system was showing eth0 as my old LAN and the second NIC was not listed at all.

So I desabled the on-board LAN in BIOS and restarted the system. The 'ifconfig' shows only the loop back interfce. After trying some commands, I found :

Code:

dhclient3 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth1
After executing that the ifconfig changes to :

Code:

debian:~# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:80:48:62:2a:33 
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::280:48ff:fe62:2a33/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:129895 errors:169 dropped:0 overruns:0 frame:0
          TX packets:106324 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:171903761 (163.9 MiB)  TX bytes:11565616 (11.0 MiB)
          Interrupt:11 Base address:0xe800

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4962 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4962 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:297988 (291.0 KiB)  TX bytes:297988 (291.0 KiB)

After that I am able to access internet. But each time after the reboot I need to execute that command.

I need :

Code:

1. A permanent solution to configure the second card so that system will setup that automatically after each reboot
2. I want to make it as eth0 ( As you can see there is no eth0 but a eth1 )

How can I do that ?

scheidel21 05-21-2009 10:31 AM

open up a text editor, like nano or vim in a terminal window (as root or using sudo), then view /etc/network/interfaces i.e.

localhost#nano /etc/network/interfaces

you should see something like below

Code:

  GNU nano 2.0.7          File: /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp






^G Get Help  ^O WriteOut  ^R Read File ^Y Prev Page ^K Cut Text  ^C Cur Pos
^X Exit      ^J Justify  ^W Where Is  ^V Next Page ^U UnCut Text^T To Spell

add your other interface to the file, you can even just change the eth0 to eth1 and reboot or run /etc/init.d/networking restart the interfaces file is used when calling ifup which is executed when networking is brought up during boot. If you need to assign IP information statically, you can do a quick search for "static IP assignment debian network interfaces"

farslayer 05-21-2009 02:21 PM

another option if the onboard nic is disabled in BIOS is to edit the /etc/udev/rules.d/70-persistent-net.rules and change the mac address so the PCI card will come up as eth0...

it-lenny:/# cat /etc/udev/rules.d/70-persistent-net.rules
Code:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.

# PCI device 0x14e4:0x170c (b44)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:1a:a0:08:67:08", NAME="eth0"



All times are GMT -5. The time now is 05:53 PM.