LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-17-2012, 10:07 PM   #1
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
VM OS is not Taking IP Automatically on Reboot


Hi,


I have a Linux VM created with VirtualBox running on a Windows XP SP 3 Host OS. I am using Bridged Connection for the VM to take its IP / connectivity from.

I have an open thread/topic on the similar problem here.


I have given a static IP to the VM and it is of the same network range as the Host OS is of.

The system does not take any IP when it reboots. I have to manually start/restart the network service and then it is okay.

However, I did make the network service part of chkconfig as shown here:

Code:
[root@devhost ~]# chkconfig --list | grep network
network        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
[root@devhost ~]#
still I have got to start the service manually every time I start/reboot the VM.

Please check the other thread/post specified above for details descriptions of what is going on wrong on the VM.


Thanks!
 
Old 01-18-2012, 02:46 AM   #2
fritz001
Member
 
Registered: Aug 2004
Posts: 176

Rep: Reputation: 18
Exclamation

so...

1st get the MAC ADDRESS OF eth0

cat /etc/udev/rules.d/70-persistent-net.rules

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:2f:6a:c8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

-- modify 70-persistent-net.rules, wipe everything and add line above with correct mac address.
-- edit /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
BOOTPROTO="static"
DNS1="192.100.100.2"
GATEWAY="192.100.100.1"
HWADDR="52:54:00:2F:6A:C8"
IPADDR="192.100.100.10"
NETMASK="255.255.255.128"
ONBOOT="yes"


reboot and see if it's working.
 
Old 01-18-2012, 12:18 PM   #3
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Original Poster
Rep: Reputation: 59
fritz001:


Thanks for your post. I followed your guidelines and along the way I came to know about the 70-persistent-net.rules file. I think it is always good to have troubles so that we can learn something new even if the troubles may not be solved at first or easily.

So, I restarted the system and this time it got eth1 and here is some output:

Code:
[root@localhost ~]# ifconfig
eth1      Link encap:Ethernet  HWaddr 08:00:27:11:6F:E7  
          inet6 addr: fe80::a00:27ff:fe11:6fe7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:159 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:29622 (28.9 KiB)  TX bytes:1836 (1.7 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)

virbr0    Link encap:Ethernet  HWaddr 1A:8F:D1:64:0F:F5  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:5189 (5.0 KiB)
I restarted the network service but in vain:

Code:
[root@localhost ~]# service network restart
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Error: No suitable device found: no device found for connection 'System eth0'.
                                                           [FAILED]

It seems every other time the VM would take next ethN out of nowhere and would not let me know any clue.
 
Old 01-19-2012, 08:20 AM   #4
fritz001
Member
 
Registered: Aug 2004
Posts: 176

Rep: Reputation: 18
Exclamation

goto system preferences - network connections -> delete all interfaces and add them again

restart network service


or

cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
DNS1="192.100.100.2"
GATEWAY="192.100.100.1"
HWADDR="52:54:00:2F:6A:C8"
IPADDR="192.100.100.10"
IPV6INIT="no"
NETMASK="255.255.255.128"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
 
1 members found this post helpful.
Old 01-19-2012, 03:20 PM   #5
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Original Poster
Rep: Reputation: 59
Quote:
Originally Posted by fritz001 View Post
NM_CONTROLLED="no"
TYPE="Ethernet"
Hi!


Thanks again! This time I just deleted the .rules file except the comments; and added those two fields that I previously deleted from ifcfg-eth0 file thinking that they would not make much difference. But interestingly this time the system took the set IP and I did not have to start the network service which was the problem that arose.

Here is the output of ifocnfig and the .rules file also got a correct entry automatically:

Code:
[root@devhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:11:6F:E7  
          inet addr:169.254.75.58  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::a00:27ff:fe11:6fe7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:139 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:23974 (23.4 KiB)  TX bytes:7144 (6.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)

virbr0    Link encap:Ethernet  HWaddr E6:00:3F:16:9F:52  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:5682 (5.5 KiB)

[root@devhost ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000) (custom name provided by external tool)

# PCI device 0x8086:0x100e (e1000) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:11:6f:e7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
[root@devhost ~]#

Last edited by devUnix; 01-19-2012 at 03:26 PM.
 
Old 01-19-2012, 03:24 PM   #6
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Original Poster
Rep: Reputation: 59
The above problem is resolved now. Can you have a look at the other post that I mentioned in the original post above:

Please click here where I have described the problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to get radius to start after a reboot automatically jenniekingsland Linux - Server 2 10-02-2010 12:26 AM
ypbind taking port of imaps on reboot. Please help guys~ ravangrid Linux - Newbie 3 08-24-2009 09:37 PM
ypbind taking port of imaps on reboot. Please help ravangrid Linux - Server 1 08-21-2009 12:26 AM
Automatically mount after reboot rust8y Linux - Newbie 1 05-25-2008 10:25 PM
automatically reboot padideh Linux - Server 7 10-12-2006 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration