Device eth0 doesnt exist but network is up!
Posted: 2019/01/14 09:02:18
Hi.
I have a script running for long time and suddenly it started giving error :
"Device "eth0" does not exist."
network is up and when I restart it I dont get errors "service network restart"
also, ifcfg-eth? are there and syslog isnt showing any errors
more over, using command like:
ip -o -4 a | awk '$2 == "eth0" { gsub(//.*/, "", $4); print $4 }'
ip addr show dev eth0 scope global | grep "inet\b" | cut -d/ -f 1 | egrep -o "([[:digit:]]{1,3}[.]{1}){3}[[:digit:]]{1,3}"
ip -f inet a show eth0|grep -oP "(?<=inet ).+(?=/)"
all above are reporting the ip addresses without errors.
but the command is giving "device eth0 doesnt exist is:
"ip addr show ${net_interface} | grep -Eo '\<[[:digit:]]{1,3}(.[[:digit:]]{1,3}){3}>' | head -1"
what could cause it not to work suddenly?
Thank you.
I have a script running for long time and suddenly it started giving error :
"Device "eth0" does not exist."
network is up and when I restart it I dont get errors "service network restart"
also, ifcfg-eth? are there and syslog isnt showing any errors
more over, using command like:
ip -o -4 a | awk '$2 == "eth0" { gsub(//.*/, "", $4); print $4 }'
ip addr show dev eth0 scope global | grep "inet\b" | cut -d/ -f 1 | egrep -o "([[:digit:]]{1,3}[.]{1}){3}[[:digit:]]{1,3}"
ip -f inet a show eth0|grep -oP "(?<=inet ).+(?=/)"
all above are reporting the ip addresses without errors.
but the command is giving "device eth0 doesnt exist is:
"ip addr show ${net_interface} | grep -Eo '\<[[:digit:]]{1,3}(.[[:digit:]]{1,3}){3}>' | head -1"
what could cause it not to work suddenly?
Thank you.