Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
I have a virtual box setup of Centos 6. I , for now, am trying to configure it to be a dhcp not static ip address. On ifconfig eth0, it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2014
    Posts
    7

    Network is unreachable on Centos


    I have a virtual box setup of Centos 6. I , for now, am trying to configure it to be a dhcp not static ip address. On ifconfig eth0, it is not obtaining an ip4 address at all.

    On /etc/sysconfig/network:
    Code:
    NETWORKING=yes
    HOSTNAME=localhost.localdomain
    GATEWAY=192.168.1.1
    On /etc/sysconfig/network-scripts/ifcfg-eth0
    Code:
    DEVICE="eth0"
    BOOTPROTO="dhcp'
    NETMASK="255.255.255.0"
    GATEWAY="192.168.1.1"
    HWADDRESS='08:00:27:cb:1f:bf"
    nmcONTROLLED="yes"
    ONBOOT="yes"
    TYPE="ethernet"
    I'm able to ping 127.0.0.1 but cant even ping my router 192.168.1.1

  2. #2
    Just Joined!
    Join Date
    Apr 2014
    Posts
    7
    Oh and rc.conf has nameservers as 4.2.2.2 and 8.8.8.8

  3. #3
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    949
    Are you picking up an IP address? Do an ifconfig -a to see what settings you're getting from DHCP and post the output of the command.
    A lion does not lose sleep, over the opinion of sheep.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Apr 2014
    Posts
    7
    Quote Originally Posted by docbop View Post
    Are you picking up an IP address? Do an ifconfig -a to see what settings you're getting from DHCP and post the output of the command.
    I'm not home right now but there is output but no up address. Only the other stuff (hw address, up6, etc)=. Nothing pertaining to up4

  6. #5
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    917
    Virtual Box has various settings for your virtual NIC. You may want to setup a 'bridge adapter' in Virtual Box instead of the default. This will allow your VM to get DHCP from your router.

  7. #6
    Just Joined!
    Join Date
    Apr 2014
    Posts
    7
    Its already on bridged connection. Had to set it that way for another virtual machine

  8. #7
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    917
    I just looked at your interface config file. You are mixing single quotes and double quotes in some lines. You should fix that:
    BOOTPROTO="dhcp'
    ...
    HWADDRESS='08:00:27:cb:1f:bf"

  9. #8
    Just Joined!
    Join Date
    Apr 2014
    Posts
    7
    It could be typo since I hand typed it into here but I'll check my config files shortly

  10. #9
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    917
    One other thing to check if that's not your problem. Did you clone this VM from another? If so, then you likely have existing udev rules in /etc/udev/rules.d/70-persistent-net.rules
    that are conflicting unless you specifically cleaned them out.

  11. #10
    Just Joined!
    Join Date
    Apr 2014
    Posts
    7
    Quote Originally Posted by mizzle View Post
    One other thing to check if that's not your problem. Did you clone this VM from another? If so, then you likely have existing udev rules in /etc/udev/rules.d/70-persistent-net.rules
    that are conflicting unless you specifically cleaned them out.
    ok double checked the quotes in my ifcfg-eth0 file and they are ''. I was just a sloppy typer here.
    Also I checked the rules, and there are some there but it is all dealing with hardware (cd, pci, etc). As far as I remember, I downloaded it fresh from the centos site a few months ago. Just now working wit it.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •