Dual-nic issues in Embedded Linux (what will happen to eth2)

Source: Internet
Author: User
Embedded Linux dual-nic problems (what will happen to eth2)-General Linux technology-Linux technology and application information, the following is a detailed description. I have a question.
1. In the system environment, the system is a Samsung chip with more than 6410 dual NICs (one is DM9000 and the other is SMSC9500). The Kernel is 2.6.31 and Ubuntu9.10.
2. First paste the/etc/udev/rules. d/70-persistent-net.rules File
# USB device 0x0424: 0x9500 (usb)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 80: 0f: 95: 06: 4
2 ", ATTR {dev_id} =" 0x0 ", ATTR {type} =" 1 ", KERNEL =" eth * ", NAME =" eth0"

# Net device ()
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 09: c0: ff: ec: 4
8 ", ATTR {dev_id} =" 0x0 ", ATTR {type} =" 1 ", KERNEL =" eth * ", NAME =" eth1"

3. In my test, because I have dual Enis, When I select both Enis in the Kernel, I feel that everything works properly in the system.

Kernel printing:
Dm9000 Ethernet Driver, V1.31
Eth0: dm9000e at c087e000, c0882002 IRQ 41 MAC: 00: 09: c0: ff: ec: 48 (chip)
....
Eth1: register 'smsc9500 'at usb-s5pv210-1.2, smsc9500 USB 2.0 Ethernet, 00: 80: 0f: 95: 06: 42
Finally, use ifconfig to view
The content is as follows:
Eth0 Link encap: Ethernet HWaddr 00: 09: c0: ff: ec: 48
Inet addr: 109.120.23.32 Bcast: 109.120.23.255 Mask: 255.255.255.0
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 109 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 31 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 18942 (18.9 KB) TX bytes: 4700 (4.7 KB)
Interrupt: 41 Base address: 0xe000

Eth1 Link encap: Ethernet HWaddr 00: 80: 0f: 95: 06: 42
Up broadcast multicast mtu: 1500 Metric: 1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 0 (0.0 B) TX bytes: 0 (0.0 B)

Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Up loopback running mtu: 16436 Metric: 1
RX packets: 2 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 100 (100.0 B) TX bytes: 100 (100.0 B)

First question:
Why is the MAC address of eth0 in the 70-persistent-net.rules file 00: 80: 0f: 95: 06: 42?
The MAC address corresponding to eth1 is 00: 80: 0f: 95: 06: 42 ???
(But I guess the reason for this is that it is estimated that the system depends on the loading order of the NIC and does not match the rules file .)

4. If only DM9000 is selected for the Kernel,
After the system is up, the Kernel prints
Dm9000 Ethernet Driver, V1.31
Eth0: dm9000e at c087e000, c0882002 IRQ 41 MAC: 00: 09: c0: ff: ec: 48 (chip)
View with ifconfig
Eth0 Link encap: Ethernet HWaddr 00: 09: c0: ff: ec: 48
Inet addr: 109.120.23.32 Bcast: 109.120.23.255 Mask: 255.255.255.0
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 301 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 35 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 49373 (49.3 KB) TX bytes: 5398 (5.3 KB)
Interrupt: 41 Base address: 0xe000

Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Up loopback running mtu: 16436 Metric: 1
RX packets: 2 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 100 (100.0 B) TX bytes: 100 (100.0 B)


5. If only SMSC9500 is selected for the Kernel,
After the system is up, the Kernel prints
Eth0: register 'smsc9500 'at usb-s5pv210-1.2, smsc9500 USB 2.0 Ethernet, 00: 80: 0f: 95: 06: 42
View with ifconfig
Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Up loopback running mtu: 16436 Metric: 1
RX packets: 2 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 100 (100.0 B) TX bytes: 100 (100.0 B)
Use ifconfig-a to view
Eth2 Link encap: Ethernet HWaddr 00: 80: 0f: 95: 06: 42
Broadcast multicast mtu: 1500 Metric: 1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 0 (0.0 B) TX bytes: 0 (0.0 B)

Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Up loopback running mtu: 16436 Metric: 1
RX packets: 2 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 100 (100.0 B) TX bytes: 100 (100.0 B)

My second question: Why can't I see anything with ifconfig here? Why does eth2 appear with ifconfig-?
Why not eth0 ???

I hope you can get some explanations.
Thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.