Strange IP address issue, Linux
binarysoul
Member Posts: 993
in Off-Topic
Hello Linuxers,
I'm playing with CentOS and when I run 'ifconfig' I get 10.0.0.5 as IP. But when I look at /etc/sysconfig/network-scripts/ifcfg-eth0, it shows IP as 10.1.1.1. This is a VM in Virtualbox.
I had previously changed IP to 10.0.0.5, but it shouldn't be there. I've used ifconfig to change IP back, rebooted, but it doesn't change.
Any idea?
I'm playing with CentOS and when I run 'ifconfig' I get 10.0.0.5 as IP. But when I look at /etc/sysconfig/network-scripts/ifcfg-eth0, it shows IP as 10.1.1.1. This is a VM in Virtualbox.
I had previously changed IP to 10.0.0.5, but it shouldn't be there. I've used ifconfig to change IP back, rebooted, but it doesn't change.
Any idea?
Comments
-
UnixGuy Mod Posts: 4,570 Modis it CentOS 6.x ? The network might be controlled by "NetworkManager".
in the file /etc/sysconfig/network/ifcfg-eth0
NMCONTROLLED="yes" ?
change it to "no"
then do this:
"server NetworkManager stop"
"chkconfig NetworkManager off"
or what I do is "yum remove NetworkManager" -
binarysoul Member Posts: 993Thanks for the tip. It worked, but after I rebooted, the problem is back! It's Centos 6.32.
'ifconfig' shows 10.0.0.5 as IP
/etc/sysconfig/network-scripts/ifcfg-eth0, shows IP as 10.1.1.1
I get PING replies from 10.0.0.5.
But when I ping 10.1.1.1, I get replies From ip 10.0.0.5 that 10.1.1.1 is unreachable! -
UnixGuy Mod Posts: 4,570 ModSorry about the reboot. Instead of reboot, you needed to just reset the network service (service network restart).
this is strange. Can you copy paste the contents of this file: "/etc/sysconfig/network-scripts/ifcfg-eth0" and the contents of this file "/etc/sysconfig/network"
also, the outputs of "ifconfig" and "netstat -rn"
try this command as well: "ifdown eth0", then "ifup eth0", it might post a message on why you're not acquiring the IP in the files -
ccnxjr Member Posts: 304 ■■■□□□□□□□Can we see the full output of :
ifconfig -a ip addr dmesg | grep eth
Just a tiny peek -
binarysoul Member Posts: 993Thanks everyone! I've attached the output of everything you asked for and put them in a screenshot. Please use this link:
View image: output -
ccnxjr Member Posts: 304 ■■■□□□□□□□One more thing, can you give us the output of :
cat /etc/udev/rules.d/70-persistent-net.rules
I find it odd that there is a vlan assosciated with eth0 from the output of dmesg.
here's mine for reference:[root@cacti ~]# dmesg|grep eth0 e1000 0000:00:03.0: eth0: (PCI:33MHz:32-bit) 08:00:27:d6:33:0c e1000 0000:00:03.0: eth0: Intel(R) PRO/1000 Network Connection e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX [root@cacti ~]#
Can you also runls /proc/net/vlan/
If there is a vlan of some sort configured let's start digging there.
If a vlan is configured then vlan sub-interfaces *should* show up under the output ofifconfig -a
But that *looks* ok, so I guess we'll have to put on our sleuthing hats for this after all ! -
UnixGuy Mod Posts: 4,570 ModIt looks alright, just change BOOTPROTO from "static" to "none". Static is no longer a valid option
BOOTPROTO="none"
Then do a "service network restart"
Since it's a virtualbox, it's worth checking your VirtualBox network config, sometimes they result in funny errors -
ally_uk Member Posts: 1,145 ■■■■□□□□□□might be worth also checking your virtual box network settings are set to bridgedMicrosoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish " -
binarysoul Member Posts: 993Bingo!
I changed BOOTPROTO and played around with Virtualbox network settings. It's fixed!
Thanks everyone. I could have rebuilt the box, but I often want to learn from such strange problems than quickly 'throwing the white towel at the ring'. -
W Stewart Member Posts: 794 ■■■■□□□□□□Interesting. Didn't know static wasn't valid anymore. I haven't used a redhat based distro in awhile. Most supporting ubuntu these days.