Can't get static IP to work

Issues related to configuring your network

Can't get static IP to work

Postby cwscribner » 2012/02/17 01:23:38

Hi all.

I have a CentOS 6 VM that currently uses DHCP. When using DHCP I have internet access, LAN access, etc. When I set ifcfg-eth0 to be static with all the proper parameters, I lose everything. I can restart network and everything comes up as ok, but I can't get to the internet. Seems like its a DNS issue but I set the VM to point to the same DNS server as the host.
cwscribner
 
Posts: 9
Joined: 2012/01/26 19:10:45

Re: Can't get static IP to work

Postby maul0r » 2012/02/17 11:46:19

Are you able to ping your router and any other computers in the physical network environment? Just a wild guess
maul0r
 
Posts: 11
Joined: 2012/02/14 13:57:43

Can't get static IP to work

Postby pschaff » 2012/02/17 18:10:30

You might want to consider doing it with DHCP, but if more help is needed then please provide more information about your system by running "./getinfo.sh network" and showing us the output file.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Can't get static IP to work

Postby tormsl » 2012/02/28 22:46:55

I'm having the exact same issue.

I installed two CentOS 6.2 servers earlier today, and bot cannot assign a static ip address on boot.

The machines successfully locates both onboard ethernet interface cards:
# lspci
01:00.0 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)
01:00.1 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)

During installation, the interfaces were assigned an ip address from DHCP and while this worked perfectly fine, I need to configure the interfaces to assign static ip-addresses and not use DHCP.

I've tried several different configurations, but they all fail. When I log into IPMI KVM console after boot, I see the interface (eth0) is active, but no ip address is assigned to it. To get the ip address assigned, I can restart networking or do an ifdown/ifup on eth0.

Currently, /etc/sysconfig/network-scripts/ifcfg-eth0 contains the following:
Code: Select all
DEVICE=eth0
HWADDR=<snipped>
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=static
IPADDR=<snipped>
NETMASK=255.255.255.252
TYPE=Ethernet
GATEWAY=<snipped>
IPV6INIT=no
USERCTL=no


But that does not work.
I've tried changing NM_CONTROLLED to yes, BOOTPROTO to none, removed the HWADDR statement, moved GATEWAY into /etc/sysconfig/network and removed IPV6INIT and USERCTL, but nothing seems to work...

Only thing I can think of is the onboard IPMI controller having something to do with this as currently, the IPMI controller runs on a shared port with eth0. I've installed Ubuntu and Debian on the exact same hardware with the shared IPMI controller, but this does not affect them.

As a workaround, one could restart networking in /etc/rc.local, but this is not pretty...


Additionally, I see this in dmesg:
Code: Select all
Intel(R) Gigabit Ethernet Network Driver - version 3.0.6-k
Copyright (c) 2007-2011 Intel Corporation.
igb 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
igb 0000:01:00.0: setting latency timer to 64
  alloc irq_desc for 31 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 31 for MSI/MSI-X
  alloc irq_desc for 32 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 32 for MSI/MSI-X
  alloc irq_desc for 33 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 33 for MSI/MSI-X
  alloc irq_desc for 34 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 34 for MSI/MSI-X
  alloc irq_desc for 35 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 35 for MSI/MSI-X
  alloc irq_desc for 36 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 36 for MSI/MSI-X
  alloc irq_desc for 37 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 37 for MSI/MSI-X
  alloc irq_desc for 38 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 38 for MSI/MSI-X
  alloc irq_desc for 39 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.0: irq 39 for MSI/MSI-X
igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
igb 0000:01:00.0: eth0: (PCIe:5.0Gb/s:Width x4) 00:25:90:60:50:ca
igb 0000:01:00.0: eth0: PBA No: FFFFFF-0FF
igb 0000:01:00.0: Using MSI-X interrupts. 8 rx queue(s), 8 tx queue(s)
  alloc irq_desc for 17 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
igb 0000:01:00.1: setting latency timer to 64
  alloc irq_desc for 40 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 40 for MSI/MSI-X
  alloc irq_desc for 41 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 41 for MSI/MSI-X
  alloc irq_desc for 42 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 42 for MSI/MSI-X
  alloc irq_desc for 43 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 43 for MSI/MSI-X
  alloc irq_desc for 44 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 44 for MSI/MSI-X
  alloc irq_desc for 45 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 45 for MSI/MSI-X
  alloc irq_desc for 46 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 46 for MSI/MSI-X
  alloc irq_desc for 47 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 47 for MSI/MSI-X
  alloc irq_desc for 48 on node -1
  alloc kstat_irqs on node -1
igb 0000:01:00.1: irq 48 for MSI/MSI-X
igb 0000:01:00.1: Intel(R) Gigabit Ethernet Network Connection
igb 0000:01:00.1: eth1: (PCIe:5.0Gb/s:Width x4) 00:25:90:60:50:cb
igb 0000:01:00.1: eth1: PBA No: FFFFFF-0FF
igb 0000:01:00.1: Using MSI-X interrupts. 8 rx queue(s), 8 tx queue(s)



Is this a result of a outdated driver??
Is there anything more I can provide to help you solve this problem?
tormsl
 
Posts: 3
Joined: 2012/02/28 22:29:16

Re: Can't get static IP to work

Postby pschaff » 2012/02/28 22:51:02

tormsl - Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

After reading those links you should realize why you should not hijack threads as you have done. Please start a new Topic for your issue to get the attention you need, providing a link to this one if required for context.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America


Return to CentOS 6 - Networking Support

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests