Ethernet0 listed as OFFLINE

jvangent100

Member
Joined
Jan 21, 2008
Messages
47
Reaction score
1
Hi there,
The piaf status screen is listing ethernet0 as offline, but in reality it isn't offline and has full connectivity. Because this is a vm, and I moved the vm from vmware to hyperv, centos created a new ifcfg.eth0 and renamed the old one to ifcfg.eth0.bak. Now how do I enable the status screen to correctly list ethernet0 as being online ?
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
Do you have an ifcfg.eth1? If there is no ifcfg.eth0 or it has the wrong mac address, then Centos will automatically create the next available interface such as eth1. Everything will still work but the status screen won't list eht0 as online. What does ifconfig show?

To restart the network services, type "service network restart" at the linux command prompt.
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
Eugene, it isn't that that is the problem. My proxmox piaf always shows ethernet0 as offline, but I have one and only one ethernet interface, and it is eth0. And /etc/sysconfig/network-scripts has:

ifcfg-eth0

for some reason, the status command is misclassifying the interface as offline.
 

jvangent100

Member
Joined
Jan 21, 2008
Messages
47
Reaction score
1
No ifcfg-eth1

As mentioned in the post, I do have a ifcfg-eth0.bak (the old VMWARE nic) and a ifcfg-eth0 (the new hyperv nic). There is no way to use the same mac address as trying that leads to no network connectivity at all. As said the network is fully operational, it's just that the status screen is incorrectly showing eth0 as being offline, but it does detect the internet connectivity :)

Edit: I did a complete reinstall of PIAF Bronze on Hyperv, I also loaded the hyperv tools for linux, as that enables me to use a normal network adapter, as opposed to a legacy network adapter, which is not recommended by Microsoft. What happens on CENTOS is that the device is identified as SETH0 instead of ETH0, so there is indeed a ifcfg-seth0 in /etc/sysconfig/network-scripts. Is there any way to let the status screen recognise this seth0 device ?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
eth0 and eth1 are hard-coded into the status display. Just curious, why do you care whether it displays or not? You'll be the first to know if it's not working. :wink5:
 

jvangent100

Member
Joined
Jan 21, 2008
Messages
47
Reaction score
1
eth0 and eth1 are hard-coded into the status display. Just curious, why do you care whether it displays or not? You'll be the first to know if it's not working. :wink5:

Yep that's completely true, I was just curious if it could be changed using a config file, since it's hardcoded, I now know the answer to my question :)

Since the status screen was also showing some errors while loading related to eth0, I decided to "rename" seth0 to eth0 by editing /etc/udev/rules.d/60-net.rules and adding:

KERNEL=="seth*", SYSFS{address}=="xx:xx:xx:xx:xx:xx", NAME="eth0" (where the mac address is of course tailored to the actual mac address of seth0).

now I gotten rid of the error messages, and the IP address now correctly shows on the screen, still it lists the ETH0 inferface as offline.
 

jvangent100

Member
Joined
Jan 21, 2008
Messages
47
Reaction score
1
Seem to have problems editing my post so:

still it lists the ETH0 inferface as offline. So the question now would be, why does the status screen think ETH0 is down, as ifup and ifdown now work correctly using ETH0.
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
not to be snarky, ward

eth0 and eth1 are hard-coded into the status display. Just curious, why do you care whether it displays or not? You'll be the first to know if it's not working. :wink5:

but this is pretty basic software design, no? if the status of the ethernet device is meaningless, why do you display it? there is nothing that causes more FUD among users than false error messages.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
Not speaking for Tom since he wrote it, but... It's really hard to build apps anticipating every customization that folks will make down the road. Status was intended to show new folks how their system was running and it ASS-U-MEs that they were using the base PIAF install. For others, there's ifconfig.

Once you venture into VM territory, change operating systems, or start renaming devices, it's obviously a whole new can of worms. Not to mention the development time soars from days and weeks to months and months... for a status display. Of course, anyone can write their own and contribute it to the project. :smile5:

Perhaps down the road there will be a config file that lets you choose your own devices for status but, for now, it be's what it be's. Sorry. :rolleyes:
 

jvangent100

Member
Joined
Jan 21, 2008
Messages
47
Reaction score
1
Yeah I agree, it is indeed not possible to take all configurations into account. At least it doesn't panic on the device name now, and it does display correct ip-address, still beats me as to why it would think the interface is offline, but without any idea as to what the utility looks for to determine it offline, I will simply ignore it :)
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
I am still confused. I *have* eth0. And it works. So what is "OFFLINE" about it? More specifically, as I said in my earlier post, I have one and only one ethernet device, and its name *is* eth0, which is what I thought you were saying the status program looks for. So, do I have a bug here? Something is clearly not right, no?
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
No everything is fine some NIC cards do not play well with ethtool. Which is what status uses to detect if a particular NIC is running. thus it looks for ethtool eth0 and parses for the return of Link detected: yes

This works on most but not all NICs.

We are unable to take into account ALL variations of NIC card and drivers thus we choose the one that seems to work for the majority of people

We have a couple of machines in our lab that ethtool does not detect. We just live with it.

Tom
 

jvangent100

Member
Joined
Jan 21, 2008
Messages
47
Reaction score
1
I am guessing you do a ethtool eth0, which indeed returns zero data on my system when ran against eth0.

When ran against the syntatic network driver, I get the error messages I saw before:


Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device


On the vmware system it does return usefull data:

Settings for eth0:
Current message level: 0x00000007 (7)
Link detected: yes


So it is probably a driver/nic issue, at least I know why :)
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
Ah, thanks Tom. This makes sense now - this is an openvz pbx, so ethtool does not work.
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
Nope on my openvz it don't work either.... Works just fine on vmware under linux and win however. Works on most hardware platforms also except one exotic motherboard I got that was a pre release... eth0 works but ethtools fail....


Oh well

Tom
 

jvangent100

Member
Joined
Jan 21, 2008
Messages
47
Reaction score
1
Yep works fine on vmware stuff, not on either the legacy network driver nor the microsoft linux additions network driver for HyperV .
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
One option would be to switch to ifconfig to figure this out. Here's what I use to get the localnet entry. No idea how generic this would/could be but we have lots of bash gurus...

internip=`ifconfig | grep -m 2 ^ | cut -f 2 -d ":" | cut -f 1 -d " " | tail -1`

echo $internip

echo ${internip%.*}.0
 

Members online

Forum statistics

Threads
25,825
Messages
167,856
Members
19,250
Latest member
mark-curtis
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top