static ip not working in centos 6.6?

Issues related to configuring your network
Post Reply
jaiffable
Posts: 2
Joined: 2015/05/28 07:49:24

static ip not working in centos 6.6?

Post by jaiffable » 2015/05/28 07:52:52

I have IBM X3300 M4 server installed centos 6.6. It has two network(ethernet ports). I configure eth0 with local IP like:

Code: Select all

Address: 192.168.1.8
NetMask: 255.255.255.0
Gateway: 192.168.1.1
and it's working fine.

also I configured eth1 with static IP setting it's not working but in old server (with centos 5.5) with same static IP setting works fine.

When I ping my static address from server it pings but from other systems it's not even ping.

I tried mostly possible things like swapping eth0 & eth1 configuration etc.. So plz help guys

This is my

Code: Select all

 /etc/sysconfig/network-scripts/ifcfg-eth0

Code: Select all

DEVICE=eth0
TYPE=Ethernet
UUID=bb77xx71-76ff-4x15-x4x3-315228758484
ONBOOT=no
NM_CONTROLLED=yes
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
BOOTPROTO=none
IPADDR=192.168.1.8
PREFIX=24
GATEWAY=192.168.1.1
DNS1=202.xx.2xx.x
DNS2=202.xx.2xx.x
HWADDR=5x:x3:Fx:x1:x8:8x
LAST_CONNECT=1432728265
and this is

Code: Select all

/etc/sysconfig/network-scripts/ifcfg-eth1
(with static ip setting)

Code: Select all

DEVICE=eth1
TYPE=Ethernet
UUID=38x68x8x-6xx0-4xxb-9xx1-4x7988x2x9x5
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=1xx.xx.2xx.2xx
PREFIX=29
GATEWAY=1xx.xx.2xx.2xx
DEFROUTE=no
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
DNS1=202.xx.2xx.x
DNS2=202.xx.2xx.x
HWADDR=5x:x3:xx:x1:x8:xx
LAST_CONNECT=1432730341
why i am not able to run static ip on my centos6.6 is it IBM server issue or centos.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: static ip not working in centos 6.6?

Post by TrevorH » 2015/05/28 08:02:32

Don't put GATEWAY= in both files. One will override the other and wipe out the other route.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jaiffable
Posts: 2
Joined: 2015/05/28 07:49:24

Re: static ip not working in centos 6.6?

Post by jaiffable » 2015/05/28 08:10:54

TrevorH wrote:Don't put GATEWAY= in both files. One will override the other and wipe out the other route.
But they have different gateway i am using 192.168.1.1 for local but the static gateway is different from this.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: static ip not working in centos 6.6?

Post by TrevorH » 2015/05/28 20:53:07

GATEWAY= instructs the *system* which default gateway to use. It will send all packets that cannot be reached via ipaddress/netmask of the other connections via that IP address. You cannot have GATEWAY= in both connections as the second one to start up will replace the default route with its own. The default route is the default route, it's not per connection. If you wish to set up different static routes to go via each interface then you need to use /etc/sysconfig/network-scripts/route-$interface and /etc/sysconfig/network-scripts/rule-$interface files and specify the routes in those.

For your interface with ip address 192.168.1.8, it has a netmask of 255.255.255.0 so it already knows that to reach any 192.168.1.x address it has to go via that interface. It doesn't need a gateway to reach those. If you want to route other specific ip address/subnets over that interface then you need to tell the system which routes should go that way.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply