LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 01-06-2013, 10:09 PM   #1
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 333

Rep: Reputation: 46
fedora/centos/virtualbox IP problems


Hi, my main box runs F16 and I set up a Centos 6 VM using VirtualBox 4.2.6. My router is addressed as 10.1.1.1. When I first connect to the VM I get an IP address allocated by DHCP and I can ping the host (10.1.1.51). I want to give this box a static IP address though (10.1.1.71).

So I modify the ifcfg-eth0 as described in the attachment. I stop NetworkManager and restart network. Now though, I can not ping the host. I get an eror message "host unreacheable".

Here is the /sbin/ifconfig data for the host:

[tim@enigmatic ~]$ /sbin/ifconfig p4p1
p4p1 Link encap:Ethernet HWaddr 50:E5:49:19:7D:55
inet addr:10.1.1.51 Bcast:10.1.1.255 Mask:255.255.255.0
inet6 addr: fe80::52e5:49ff:fe19:7d55/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:139830640 errors:0 dropped:13804 overruns:0 frame:0
TX packets:141181592 errors:0 dropped:0 overruns:0 carrier:2
collisions:0 txqueuelen:1000
RX bytes:2087639226 (1.9 GiB) TX bytes:2651737436 (2.4 GiB)
A couple of things to note:
  • I was advised that NetworkManager was not required if I define the address in the ifcfg-eth0 file. Hence it was stopped
  • I am a bit concerned that the HWaddr is different between host & guest. Should I expect the same?
If I restart NetworkManager and return ifcfg-eth0 to remove the static IP address it works fine. DHCP allocates the address 10.0.2.15 and I can ping 10.1.1.51. Does this suggest I need to set up the VM to suit a different subnet?

Any thoughts appreciated. Cheers
Attached Images
File Type: png centos.png (11.4 KB, 13 views)
 
Old 01-07-2013, 09:13 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,666
Blog Entries: 54

Rep: Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952Reputation: 2952
When running virtualization SW in bridge mode for a virtualization guest to have it's own static IP the only thing to do commonly is to configure the LAN router to link the MAC address to an IP address so that when the virtualization guest asks for a DHCP lease, sending its unique MAC address, it will contain all the necessary network configuration. And while NetworkManager isn't required for it (all you need is a bare ethernet device configuration file, DHCP client and configuration file) you could configure it to just use DHCP and be done with it.
 
1 members found this post helpful.
Old 01-08-2013, 02:53 PM   #3
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 333

Original Poster
Rep: Reputation: 46
thanks unspawn. I am tinkering with virtualisation. DHCP will do

Cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Several Delightfully Challenging Problems (Switching from Fedora to CentOS) billquinn Linux - Software 14 08-10-2012 01:32 AM
CentOS 6 in VirtualBox video problems zebadee2010 Linux - Virtualization and Cloud 4 12-15-2011 06:19 PM
CentOS on Virtualbox joshuayip Linux - Newbie 4 09-22-2011 09:07 PM
CentOS in one VirtualBox, Windows in another - can I set up Samba in the CentOS VB? ismism Linux - Newbie 10 08-08-2010 04:34 PM


All times are GMT -5. The time now is 09:33 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration