You are not logged in.

#1 2010-05-11 07:58:38

foudebassan
Member
From: France, Bretagne
Registered: 2007-06-20
Posts: 3

VIP loopback rc.conf

Hello everyone,

I'm trying to set up a load-balanced website using keepalived.
I have to set up a virtual ip on the loopback interface on each web node.

I'm trying this syntax in the rc.conf file :

eth1="eth1 192.168.41.253 netmask 255.255.254.0 broadcast 192.168.41.255"
lo_1="lo:1 192.168.41.250 netmask 255.255.255.255 broadcast 192.168.41.250"
INTERFACES=(eth1 lo_1)

On the machine startup, i get this message :
SIOCSIFFLAGS Cannot assign requested address

The interfaces seems ok, but i would like to have a clean startup.
When i restart the network, i always have a failure on network shutdown, but the startup is ok.

eth1      Link encap:Ethernet  HWaddr 08:00:27:14:E9:07 
          inet addr:192.168.41.252  Bcast:192.168.41.255  Mask:255.255.254.0
          inet6 addr: fe80::a00:27ff:fe14:e907/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:875 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1020 (1020.0 b)  TX bytes:47298 (46.1 Kb)
          Interrupt:9 Base address:0xd240

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:61 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9806 (9.5 Kb)  TX bytes:9806 (9.5 Kb)

lo:1      Link encap:Local Loopback 
          inet addr:192.168.41.250  Mask:255.255.255.255
          UP LOOPBACK RUNNING  MTU:16436  Metric:1

[root@hanzel ~]# /etc/rc.d/network restart
:: Stopping Network                                                                                            [FAIL]
:: Starting Network                                                                                            [DONE]
[root@hanzel ~]#ifconfig
eth1      Link encap:Ethernet  HWaddr 08:00:27:14:E9:07 
          inet addr:192.168.41.252  Bcast:192.168.41.255  Mask:255.255.254.0
          inet6 addr: fe80::a00:27ff:fe14:e907/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26 errors:0 dropped:0 overruns:0 frame:0
          TX packets:943 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1560 (1.5 Kb)  TX bytes:50994 (49.7 Kb)
          Interrupt:9 Base address:0xd240

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:192 errors:0 dropped:0 overruns:0 frame:0
          TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:22826 (22.2 Kb)  TX bytes:22826 (22.2 Kb)

lo:1      Link encap:Local Loopback 
          inet addr:192.168.41.250  Mask:255.255.255.255
          UP LOOPBACK RUNNING  MTU:16436  Metric:1

Is there another syntax in the rc.conf file in order to remove theses failure messages.

Last edited by foudebassan (2010-05-11 08:56:03)

Offline

#2 2010-05-11 08:34:34

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: VIP loopback rc.conf

foudebassan wrote:
eth1="eth1 192.168.41.253 netmask 255.255.254.0 broadcast 192.168.41.255"
lo_1="lo:1 192.168.41.250 netmask 255.255.255.255 broadcast 192.168.41.250"
INTERFACES=(eth1 l0_1)

1) I'm guessing you want lo_1 rather than l0_1
2) You shouldn't need to assign an RFC1918 address to lo... Ever AFAIK. You certainly don't need to for keepalived

I run several H/A box pairs at my work with keepalive and we don't have anything other than 127.0.0.1 on lo

Last edited by fukawi2 (2010-05-11 08:35:20)

Offline

#3 2010-05-11 08:44:14

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: VIP loopback rc.conf

i checked this config myself and i am also getting the fail message, but since startup is fine, it isnt a concerns, although if you dont want to see this message, you can add the virtual interface line to rc.local and run it from there.

Offline

#4 2010-05-11 09:03:13

foudebassan
Member
From: France, Bretagne
Registered: 2007-06-20
Posts: 3

Re: VIP loopback rc.conf

Thanks for testing Sin.citadel.

fukawi2,
I mistyped "l0_1" in my first post, i corrected it.
I think you use keepalived doing NAT, that's why you dont use the loopback interface.

In my network configuration, my LVS and my web nodes are on the same subnet. I'm using direct routing in my keepalived configuration.
Using NAT is useless for me, and requires more CPU ressources.
When using DR, the VIP is shared by each node on the loopback interface, with some tuning in the sysctl.conf file to correct arp issues, it runs fine.

I was just looking for a way to have a clean boot. Using the rc.local file could be a solution wink

Last edited by foudebassan (2010-05-11 09:07:56)

Offline

#5 2010-05-11 22:57:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: VIP loopback rc.conf

I'm not sure what you mean by using it for NAT... We use it for H/A configurations on firewall perimeter devices, so the boxes do perform NAT, but they also provide proxy, SMTP relay etc via the keepalived virtual address.

Offline

Board footer

Powered by FluxBB