FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 06-18-2012, 08:31 AM
Nikolaos Milas
 
Default Cannot set alias IP address

Hi,

I have an eth0 interface (it's a CentOS 6 guest VM on a KVM host) which
is configured as follows (see below) with a primary public IP address of
xxx.xxx.xxx.130 (which works fine). I cannot set an alias IP address. I
want eth0 to also use another IP address (xxx.xxx.xxx.131, so I create
/etc/sysconfig/network-scripts/ifcfg-eth0:1. Then:

# service network restart
Shutting down interface eth0: Device state: 3 (disconnected)
[ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
[ OK ]
# ping xxx.xxx.xxx.130
PING xxx.xxx.xxx.130 (xxx.xxx.xxx.130) 56(84) bytes of data.
64 bytes from xxx.xxx.xxx.130: icmp_seq=1 ttl=64 time=0.078 ms
64 bytes from xxx.xxx.xxx.130: icmp_seq=2 ttl=64 time=0.044 ms
^C
--- xxx.xxx.xxx.130 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1767ms
rtt min/avg/max/mdev = 0.044/0.061/0.078/0.017 ms

# ping xxx.xxx.xxx.131
PING xxx.xxx.xxx.131 (xxx.xxx.xxx.131) 56(84) bytes of data.
From xxx.xxx.xxx.130 icmp_seq=2 Destination Host Unreachable

If I try:

# ifup eth0:1
Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/3
state: activated
Connection activated

then I totally lose network connectivity.

What am I doing wrong? Please advise!

--------------------------------------------------------------
eth0
--------------------------------------------------------------
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT="yes"
HWADDR="DEB:EE:CD:8E:03"
TYPE=Ethernet
BOOTPROTO=static
GATEWAY=xxx.xxx.xxx.129
NETWORK=xxx.xxx.xxx.128
IPADDR=xxx.xxx.xxx.130
NETMASK=255.255.255.248
BROADCAST=xxx.xxx.xxx.135
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=2001:xxxx:xxxx:xxxx::130
IPV6_DEFAULTGW=2001:xxxx:xxxx:14::1
DNS1=xxx.xxx.xxx.211
DNS2=xxx.xxx.xxx.210
DNS3=2001:xxxx:xxxx:xxxx::210
IPV4_FAILURE_FATAL=no
IPV6_FAILURE_FATAL=no
DOMAIN="example.com example.com"
--------------------------------------------------------------

I've tried:
--------------------------------------------------------------
eth0:1
--------------------------------------------------------------
DEVICE="eth0:1"
ONPARENT="yes"
BOOTPROTO=none
IPADDR=xxx.xxx.xxx.131
NETMASK=255.255.255.248
BROADCAST=xxx.xxx.xxx.135
--------------------------------------------------------------

and:
--------------------------------------------------------------
eth0:1
--------------------------------------------------------------
DEVICE="eth0:1"
NM_CONTROLLED="yes"
ONBOOT="yes"
HWADDR="DEB:EE:CD:8E:03"
TYPE=Ethernet
BOOTPROTO=static
ONPARENT="yes"
GATEWAY=xxx.xxx.xxx.129
NETWORK=xxx.xxx.xxx.128
IPADDR=xxx.xxx.xxx.131
NETMASK=255.255.255.248
BROADCAST=xxx.xxx.xxx.135
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=2001:xxxx:xxxx:xxxx::131
IPV6_DEFAULTGW=2001:xxxx:xxxx:xxxx::1
DNS1=xxxx.xxxx.xxxx.211
DNS2=xxxx.xxxx.xxxx.210
DNS3=2001:xxxx:xxxx:xxxx::210
IPV4_FAILURE_FATAL=no
IPV6_FAILURE_FATAL=no
DOMAIN="example.com example.com"
--------------------------------------------------------------

Thanks,
Nick


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-18-2012, 09:06 AM
Nikolaos Milas
 
Default Cannot set alias IP address

On 18/6/2012 11:31 πμ, Nikolaos Milas wrote:

> I cannot set an alias IP address.

Note that if I issue:

# ifconfig eth0:1 xxx.xxx.xxx.131 netmask 255.255.255.248

then it works fine. Then I can ping .131 without problems.

Why doesn't it run correctly when run from
/etc/sysconfig/network-scripts/ifcfg-eth0:1?

I also tried:

eth0:1
--------------------------------------
DEVICE="eth0:1"
ONBOOT="yes"
ONPARENT="yes"
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.131
NETMASK=255.255.255.248
--------------------------------------

without success.

Please help.

Thanks,
Nick
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-18-2012, 11:59 AM
Nikolaos Milas
 
Default Cannot set alias IP address

On 18/6/2012 12:06 μμ, Nikolaos Milas wrote:

> Why doesn't it run correctly when run from
> /etc/sysconfig/network-scripts/ifcfg-eth0:1?

In /var/log/messages I see:

Jun 18 14:38:58 vpnserver NetworkManager[1125]: ifcfg-rh: updating
/etc/sysconfig/network-scripts/ifcfg-eth0:1
Jun 18 14:38:58 vpnserver NetworkManager[1125]: ifcfg-rh: error:
Couldn't parse file '/etc/sysconfig/network-scripts/ifcfg-eth0:1'
Jun 18 14:38:58 vpnserver NetworkManager[1125]: ifcfg-rh: removed
/etc/sysconfig/network-scripts/ifcfg-eth0:1.
Jun 18 14:39:20 vpnserver ntpd[1247]: Deleting interface #19 eth0:1,
xxx.xxx.xxx.131#123, interface stats: received=0, sent=0, dropped=0,
active_time=6722 secs
Jun 18 14:40:01 vpnserver NetworkManager[1125]: ifcfg-rh: parsing
/etc/sysconfig/network-scripts/ifcfg-eth0:1 ...
Jun 18 14:40:01 vpnserver NetworkManager[1125]: ifcfg-rh: read
connection 'System eth0:1'
Jun 18 14:40:01 vpnserver NetworkManager[1125]: ifcfg-rh: updating
/etc/sysconfig/network-scripts/ifcfg-eth0:1
Jun 18 14:40:39 vpnserver NetworkManager[1125]: <info> (eth0): device
state change: 8 -> 3 (reason 39)
Jun 18 14:40:39 vpnserver NetworkManager[1125]: <info> (eth0):
deactivating device (reason: 39).

when issuing a "service network restart".

Notes:

# ls -la /etc/sysconfig/network-scripts/
total 212
drwxr-xr-x. 2 root root 4096 Jun 18 14:40 .
drwxr-xr-x. 7 root root 4096 Jun 2 22:31 ..
-rw-r--r--. 1 root root 460 Jun 12 10:14 ifcfg-eth0
-rw-r--r-- 1 root root 114 Jun 18 14:40 ifcfg-eth0:1
-rw-r--r-- 1 root root 254 Oct 7 2011 ifcfg-lo

# getenforce
Disabled

Latest effort (unsuccessful):

# cat /etc/sysconfig/network-scripts/ifcfg-eth0:1
NAME=""
DEVICE="eth0:1"
ONBOOT="yes"
ONPARENT="yes"
BOOTPROTO=none
IPADDR=xxx.xxx.xxx.131
NETMASK=255.255.255.248

Any ideas please?

Thanks,
Nick


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-18-2012, 12:38 PM
Nikolaos Milas
 
Default Cannot set alias IP address

On 18/6/2012 2:59 μμ, Nikolaos Milas wrote:

> Jun 18 14:38:58 vpnserver NetworkManager[1125]: ifcfg-rh: error:
> Couldn't parse file '/etc/sysconfig/network-scripts/ifcfg-eth0:1'

Following the above error, I thought that I should change config as
follows:

DEVICE="eth0:1"
NM_CONTROLLED="yes"
ONBOOT="yes"
ONPARENT="yes"
BOOTPROTO=none
IPADDR=xxx.xxx.xxx.131
NETMASK=255.255.255.248

Now, I get the error (in /var/log/messages):

Jun 18 15:31:30 vpnserver NetworkManager[1125]: ifcfg-rh: updating
/etc/sysconfig/network-scripts/ifcfg-eth0:1
Jun 18 15:31:31 vpnserver NetworkManager[1125]: ifcfg-rh: updating
/etc/sysconfig/network-scripts/ifcfg-eth0:1
Jun 18 15:31:37 vpnserver NetworkManager[1125]: <info> (eth0): device
state change: 8 -> 3 (reason 39)
Jun 18 15:31:37 vpnserver NetworkManager[1125]: <info> (eth0):
deactivating device (reason: 39).

Please advise.

Note: I am on:
# uname -a
Linux vpnserver.example.com 2.6.32-220.17.1.el6.x86_64 #1 SMP Wed May 16
00:01:37 BST 2012 x86_64 x86_64 x86_64 GNU/Linux

Thanks,
Nick
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-18-2012, 12:52 PM
John Doe
 
Default Cannot set alias IP address

From: Nikolaos Milas <nmilas@noa.gr>

> Following the above error, I thought that I should change config as
> follows:
>
> DEVICE="eth0:1"
> NM_CONTROLLED="yes"
> ONBOOT="yes"
> ONPARENT="yes"
> BOOTPROTO=none
> IPADDR=xxx.xxx.xxx.131
> NETMASK=255.255.255.248
>
> Now, I get the error (in /var/log/messages):
>
> Jun 18 15:31:30 vpnserver NetworkManager[1125]:* * ifcfg-rh: updating
> /etc/sysconfig/network-scripts/ifcfg-eth0:1
> Jun 18 15:31:31 vpnserver NetworkManager[1125]:* * ifcfg-rh: updating
> /etc/sysconfig/network-scripts/ifcfg-eth0:1
> Jun 18 15:31:37 vpnserver NetworkManager[1125]: <info> (eth0): device
> state change: 8 -> 3 (reason 39)
> Jun 18 15:31:37 vpnserver NetworkManager[1125]: <info> (eth0):
> deactivating device (reason: 39).
>
> Please advise.

Do you really need NetworkManager...?

JD
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-18-2012, 01:05 PM
Nikolaos Milas
 
Default Cannot set alias IP address

On 18/6/2012 3:52 μμ, John Doe wrote:

> Do you really need NetworkManager...?

Not really, but in my CentOS 6 machines (only recently started using it)
I had problems setting up network (never had any with CentOS 5), because
resolv.conf was being overwritten.

After being overwhelmed experimenting, I found that my current
configuration works, so I just left it alone!

I will gladly get advice on how to setup things without NetworkManager !

Can I simply: "yum remove NetworkManager"?

Thanks,
Nick

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-18-2012, 01:21 PM
John Doe
 
Default Cannot set alias IP address

From: Nikolaos Milas <nmilas@noa.gr>

> On 18/6/2012 3:52 μμ, John Doe wrote:
>> Do you really need NetworkManager...?
>
> Not really, but in my CentOS 6 machines (only recently started using it) I had
> problems setting up network (never had any with CentOS 5), because resolv.conf
> was being overwritten.
>
> After being overwhelmed experimenting, I found that my current configuration
> works, so I just left it alone!
>
> I will gladly get advice on how to setup things without NetworkManager !
>
> Can I simply: "yum remove NetworkManager"?
>

I do not install it at all.
But I guess NM_CONTROLLED="no" might be enough...

And, for the resolv.conf, you have:
* PEERDNS="no"
*or
*DNS{1,2}=address and
* DOMAIN=domain1.com domain2.com

JD
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 09:47 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org