[Linux-cluster] Netmask bit set to 32 in service ip

Pavlos Parissis p_pavlos at freemail.gr
Thu Feb 14 00:59:17 UTC 2008


Quoting Lon Hohberger <lhh at redhat.com>:

>
> On Wed, 2008-02-13 at 12:33 +0200, Pavlos Parissis wrote:
>> Hi,
>>
>> I have a question which may sounds stupid.
>> why the netmask for the service ip is set to 32 while the IP belongs
>> to a network with different netmask?
>>
...snip...
> Strange that the netmask is wrong.  You can force it to the correct one
> by doing:
>
>     <ip monitor_link="1" address="10.10.21.138/26"/>
The above worked.

> Or, you could apply the attached patch:
>
>     cd /usr/share/cluster; patch -p0 < /tmp/fs.sh-netmask.patch
>
> ... and see if it helps you.  If it doesn't, you can revert the patch:
>
>     cd /usr/share/cluster; patch -Rp0 < /tmp/fs.sh-netmask.patch
>
> -- Lon
>

but not this one

ocsi2# pwd
/usr/share/cluster
ocsi2# cat /tmp/ip.sh-netmask.patch
Index: ip.sh
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/resources/ip.sh,v
retrieving revision 1.5.2.17
diff -u -r1.5.2.17 ip.sh
--- ip.sh       22 Mar 2007 23:15:59 -0000      1.5.2.17
+++ ip.sh       13 Feb 2008 18:28:12 -0000
@@ -692,6 +692,10 @@
                         if [ $? -ne 0 ]; then
                                 continue
                         fi
+
+                       if [ "${addr/\/*/}" = "${addr}" ]; then
+                               addr="$addr/$maskbits"
+                       fi
                         ocf_log info "Adding IPv4 address $addr to $dev"
                 fi
                 if [ "$1" = "del" ]; then
ocsi2# patch -p0 <  /tmp/ip.sh-netmask.patch
patching file ip.sh
ocsi2# clusvcadm -R ppr1
Member ocsi2-cluster trying to restart ppr1...success
ocsi2# ip add sh
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
2: bond0: <BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue
     link/ether 00:19:bb:3b:6c:b1 brd ff:ff:ff:ff:ff:ff
     inet 10.10.21.133/26 brd 10.10.21.191 scope global bond0
     inet 10.10.21.138/32 scope global bond0
3: bond1: <BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue
     link/ether 00:1a:4b:ff:9c:e8 brd ff:ff:ff:ff:ff:ff
     inet 10.10.21.69/27 brd 10.10.21.95 scope global bond1
     inet 10.10.21.71/32 scope global bond1
4: bond2: <BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue
     link/ether 00:1a:4b:ff:9c:ea brd ff:ff:ff:ff:ff:ff
     inet 10.10.21.228/27 brd 10.10.21.255 scope global bond2
5: eth0: <BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc pfifo_fast  
master bond0 qlen 1000
     link/ether 00:19:bb:3b:6c:b1 brd ff:ff:ff:ff:ff:ff
6: eth1: <BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc pfifo_fast  
master bond0 qlen 1000
     link/ether 00:19:bb:3b:6c:b1 brd ff:ff:ff:ff:ff:ff
7: eth2: <BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc pfifo_fast  
master bond1 qlen 1000
     link/ether 00:1a:4b:ff:9c:e8 brd ff:ff:ff:ff:ff:ff
8: eth3: <BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc pfifo_fast  
master bond1 qlen 1000
     link/ether 00:1a:4b:ff:9c:e8 brd ff:ff:ff:ff:ff:ff
9: eth4: <BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc pfifo_fast  
master bond2 qlen 1000
     link/ether 00:1a:4b:ff:9c:ea brd ff:ff:ff:ff:ff:ff
10: eth5: <BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc pfifo_fast  
master bond2 qlen 1000
     link/ether 00:1a:4b:ff:9c:ea brd ff:ff:ff:ff:ff:ff
11: eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
     link/ether 00:19:bb:3b:18:38 brd ff:ff:ff:ff:ff:ff
12: eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
     link/ether 00:19:bb:3b:18:3a brd ff:ff:ff:ff:ff:ff
ocsi2# uname -a
Linux ocsi2 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:32:02 EDT 2006 x86_64  
x86_64 x86_64 GNU/Linux
ocsi2# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)


I really wonder how an application can use that IP as a source IP.

Regards,
Pavlos






More information about the Linux-cluster mailing list