Bug 210618 - Patch for port translation
Summary: Patch for port translation
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Cluster Suite
Classification: Retired
Component: piranha
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Marek Grac
QA Contact: Cluster QE
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-13 11:18 UTC by Jordi Prats
Modified: 2018-10-19 20:23 UTC (History)
3 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2008-07-25 19:08:46 UTC


Attachments (Terms of Use)
LVS port translation (14.91 KB, patch)
2006-10-13 11:18 UTC, Jordi Prats
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0794 normal SHIPPED_LIVE piranha bug fix and enhancement update 2008-07-25 19:08:36 UTC

Description Jordi Prats 2006-10-13 11:18:24 UTC
Description of problem:

Features:

 - Adds a "port" option to real-server blocks in lvs.cf.  This value defaults
   to the virtual service port number if specified, and port 80 if neither are
   specified (this is the default as is currently in piranha).  This port value
   is passed to the "-r" argument for ipvsadm as called by nanny.

 - Adds the "-r" argument to nanny itself, similar to the already existing "-p"
   argument.  The manpage for nanny has been updated to reflect this usage.

 - The special token "%p" has been added to nanny's external check command syntax
   in order to utilize the specific real-server port number in
command-line-specified
   external check commands with nanny.  Also see nanny manpage updates. 


Version-Release number of selected component (if applicable): 0.8.2

Comment 1 Jordi Prats 2006-10-13 11:18:24 UTC
Created attachment 138417 [details]
LVS port translation

Comment 5 Stanko Kupcevic 2007-01-11 16:08:25 UTC
Patch in CVS

Comment 6 Brenton D. Rothchild 2007-02-26 21:58:03 UTC
There are two errors in my original patch submitted by Jordi Prats and found by
Robert Hurst:

1) a log message spelling error
2) a missing update of rport to a log message

Relative to the 0.8.2 source + original patch provided on this bug, they are:

--- piranha-brenton/nanny.c     2006-10-10 08:19:06.000000000 -0500
+++ piranha-robert/nanny.c        2007-02-23 13:59:37.000000000 -0600
@@ -927,7 +927,7 @@
        if (expect_str != NULL) {
                 if (strcmp (expect_str, result) != 0) {
                         piranha_log (flags, (char *)
-                                    "Trouble. Recieved results are not what we
expected from (%s:%d)\n",
+                                    "Trouble. Received results are not what we
expected from (%s:%d)\n",
                                      inet_ntoa (*remoteAddr), rport);
                         res = 1;
                 } else {
@@ -1315,7 +1315,7 @@
                                 /* Failover Service */
                                 piranha_log (flags, (char *)
                                              "Remote service %s:%d is available",
-                                            inet_ntoa (*remoteAddr), port);
+                                            inet_ntoa (*remoteAddr), rport);
                         } else if (service_type == SERV_LVS) {
                                 /* Virtual Server */
                                 int newWeight;



Comment 8 Lon Hohberger 2007-05-10 22:09:14 UTC
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.rewrite_ports.html

So, this *will not work* in anything but NAT configurations.

Comment 9 Lon Hohberger 2007-05-10 22:10:16 UTC
From the ipvsadm man page:

       -r, --real-server server-address
              Real  server  that  an  associated  request  for  service may be
              assigned to.  The server-address is the host address of  a  real
              server, and may plus port. Host can be either a plain IP address
              or a hostname.  Port can be either a plain port  number  or  the
              service  name  of port.  In the case of the masquerading method,
              the host address is usually an RFC 1918 private IP address,  and
              the  port  can be different from that of the associated service.
              With the tunneling and direct  routing  methods,  port  must  be
              equal  to  that of the service address. For normal services, the
              port specified  in the service address will be used if  port  is
              not  specified.  For  fwmark  services,  port may be omitted, in
              which case  the destination port on the real server will be  the
              destination port of the request sent to the virtual service.


Comment 10 Jordi Prats 2007-05-11 06:17:37 UTC
Yes, It only works for NAT configurations. For Direct routing or ip tunnel
configurations you could set additional rules on the real servers to do port
translation.

Comment 15 errata-xmlrpc 2008-07-25 19:08:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0794.html



Note You need to log in before you can comment on or make changes to this bug.