LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   move cable from eth1 to eth0, but cannot ping eth0 (https://www.linuxquestions.org/questions/linux-networking-3/move-cable-from-eth1-to-eth0-but-cannot-ping-eth0-4175439209/)

5883 11-28-2012 05:39 PM

move cable from eth1 to eth0, but cannot ping eth0
 
hi everyone,

we designed embedded board, running basic linux,
no fancy stuff (e.g. network manager).

it has 2 ethernet ports: eth0, eth1

1. plugin cable to eth1, restart board.
it comes back, eth1 is alive, i can ping it.

2. move the cable from eth1 to eth0,
run "udhcpc --reties 4 -n -q -i eth0"
ifconfig shows eth0 now has a valid ip addr, also it's UP.

3. but i cannot ping eth0


i'm not familiar with network stuff,
the 2 device drivers for the 2 ports are working (in the sense i just plug in 1 cable each time).
does that mean the network stack is wrong ?
can someone walk through me with these ?

jefro 11-28-2012 08:00 PM

I guess your lan may have some issue maybe arp. I don't like to use ping myself. Is this between a computer to this board? Does it work on 0 from boot with cable attached?

Use ifconfig to set static ip in your lan subnet. Be sure to flush arp or wait a while until it clears out.

5883 11-29-2012 04:06 PM

Jefro,

you are making the right suggestion, i got it but don't know how to fix it.

1. say initially i have ethernet cable in eth0 for this embedded board, after reboot,
arp -n says
? (10.50.182.160) at bc:30:5b:df:b9:25 [ether] on eth0

2. move cable from eth0 to eth1,
# udhcpc --retries 4 -n -q -i eth1
eth1 is up

3. # arp -n
? (10.50.182.160) at <incomplete> on eth0
ping doesn't work for eth1

4. # arp -d 10.50.182.160 -i eth0
it doesn't return error, but the arp entry is still there

5. if i do
ifconfig eth0 down,
now arp table is clean
if i try all these in my desktop linux, arp table gets updated as soon as i move the cable.

so i'm so lost now,
1. why "arp -d" doesn't work ?
2. if i don't want to do "ifconfig eth0 down", it might involved too much
is there an easy way ?

thanks for your help !








Quote:

Originally Posted by jefro (Post 4839144)
I guess your lan may have some issue maybe arp. I don't like to use ping myself. Is this between a computer to this board? Does it work on 0 from boot with cable attached?

Use ifconfig to set static ip in your lan subnet. Be sure to flush arp or wait a while until it clears out.


jefro 11-30-2012 04:39 PM

I may not have said that well. I meant that arp on the other segment.

Describe lan segment.

5883 11-30-2012 06:03 PM

i believe this is our linux kernel/driver problem, arp is totally messed up.
just 1 board with 2 NICs, both NICs connects to the same router.

after i disconnect eth0 cable,
if i play with with "arp -d", "ifconfig eth0 up/down" with different combinations,
i could still ping eth0 even without the cable.

but any thoughts are welcome.

Quote:

Originally Posted by jefro (Post 4840468)
I may not have said that well. I meant that arp on the other segment.

Describe lan segment.



All times are GMT -5. The time now is 04:46 AM.