LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Simple NAT Setup (long)

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Simple NAT Setup (long)
From: Malcolm Cowe <malcolm_cowe@xxxxxxxxxxx>
Date: Fri, 27 Jul 2001 13:31:49 +0100
Hi,

I'm trying to get a simple one network NAT setup to run on my testbed
and I'm having difficulties getting it to work. I'm using RH 7.1 with
the 2.4.7 kernel, patched with the 0.8.1 IPVS Netfilter module. This
seems to be working and does load into the kernel:

[epsg9008]root: ipvsadm
IP Virtual Server version 0.8.1 (size=4096)                    
Prot LocalAddress:Port Scheduler Flags                         
  -> RemoteAddress:Port             Forward Weight ActiveConn InActConn

[epsg9008]root: lsmod
Module                  Size  Used by
ip_vs                  57696   0  (autoclean) (unused)
nfs                    78960   2  (autoclean)
lockd                  49744   1  (autoclean) [nfs]
sunrpc                 66352   1  (autoclean) [nfs lockd]
autofs                 11264   6  (autoclean)
eepro100               16560   1  (autoclean)
aic7xxx               102608   3 
sd_mod                 11200   3 
scsi_mod               91632   2  [aic7xxx sd_mod]

I have modest requirements at this time, and want the cluster to run on
the main subnet on my site. This means that the clients, director and
real-servers must all reside on the same subnet. Additionally, there can
only be one network card per unit in the cluster (directors and
real-servers alike):

+--------+         +----------+         +-------------+
| Client |   ...   | Director |   ...   | Real-Server |
+---+----+         +----+-----+         +------+------+
    |                   |                      |
----+-------------------+----------------------+-------

Client IP: 156.141.59.181
Director IP: 156.141.59.59
Real-Server IP: 156.141.59.62
VIP: 156.141.59.63
Subnet: 255.255.248.0
Gateway: 156.141.56.1


I have been following the mini-howto to establish the lvs_nat.conf file,
with references to lvs_dr.conf.one_NIC_one_network in the configure
script, but I get a fatal error after running rc.lvs_nat on the
director, telling me that my LVS is not set up properly. I have attached
my lvs_nat.conf and the output from rc.lvs_nat, so you can see what I'm
doing.

Could you please help me figure out what's going wrong?

Regards,

-- 
Malcolm Cowe.
IT | Information Technology,    eMail: malcolm_cowe@xxxxxxxxxxx
Agilent Technologies Ltd.       External: +44 131 331 6466
South Queensferry, EH30 9TG.    Telnet: 313-3466
looking for standard utilities
$ECHO=/bin/echo
$IPCHAINS=/sbin/ipchains
Error: executable fping not found 
$PING=/bin/ping -c 1
$IFCONFIG=/sbin/ifconfig
$NETSTAT=/bin/netstat
$ROUTE=/sbin/route
$AWK=/bin/awk
$AWK=/usr/bin/awk
$NTPD=/usr/sbin/ntpd
$IP=/sbin/ip
$IPTABLES=/sbin/iptables
$GREP=/bin/grep
$HOSTNAME_CMD=/bin/hostname
$UNAME_CMD=/bin/uname
$CAT=/bin/cat
$CUT=/bin/cut
$TAIL=/usr/bin/tail
$XARGS=/usr/bin/xargs
$PS=/bin/ps
$KILL=/bin/kill
$WC=/usr/bin/wc
$TRACEROUTE=/usr/sbin/traceroute
$ARP=/sbin/arp
$ROUTE=/sbin/route
$LSMOD=/sbin/lsmod
$RMMOD=/sbin/rmmod
$INSMOD=/sbin/insmod
$TR=/usr/bin/tr
$EXPR=/usr/bin/expr
$CHMOD=/bin/chmod
fping not found, using ping instead
$FPING=/bin/ping -c 1
rc.lvs version 0.8 Apr 2001
(C) 2000-2001 Joseph Mack jmack@xxxxxxxx, distributed under GPL license
This file is part of the LVS project http://www.linuxvirtualserver.org
setting up epsg9008


LVS director 

loading ip_vs module 
ip_vs already loaded 
searching for ipchains
ipchains not loaded, good
loading ip_tables module 
ip_tables already loaded 
clearing iptables/ipchain rules 
set_director_ip_forwarding on vs-nat director (1 on, 0 off).
set ip_forward ON for vs-nat director (1 on, 0 off).
proc/sys/net/ipv4/ip_forward 1

Not a 1 net VS-NAT. 
Turning on icmp redirects (1 on, 0 off) 
(incase were turned off in a previous installation).
/proc/sys/net/ipv4/conf/all/send_redirects 1
/proc/sys/net/ipv4/conf/default/send_redirects 1
/proc/sys/net/ipv4/conf/eth0/send_redirects 1
/proc/sys/net/ipv4/conf/lo/send_redirects 1

device eth0:110 has VIP 156.141.59.63


adding ethernet device and routing for VIP 156.141.59.63 
listing ifconfig info for VIP 156.141.59.63 
eth0:110  Link encap:Ethernet  HWaddr 00:60:B0:57:8A:01  
          inet addr:156.141.59.63  Bcast:156.141.255.255  Mask:255.255.248.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:10 Base address:0x1000 

checking VIP 156.141.59.63 is reachable from self (director): PING 
156.141.59.63 (156.141.59.63) from 156.141.59.63 : 56(84) bytes of data.
64 bytes from 156.141.59.63: icmp_seq=0 ttl=255 time=309 usec

--- 156.141.59.63 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/mdev = 0.309/0.309/0.309/0.000 ms
listing routing info for VIP 156.141.59.63 
156.141.59.63   0.0.0.0         255.255.255.255 UH       40 0          0 eth0

 
clearing ipvsadm table 
installing LVS services with ipvsadm
initialising persistence for 156.141.59.63 to N 
persistence for 156.141.59.63 N 
non-persistent service on 156.141.59.63:telnet
checking if server epsg9009.britain.agilent.com is reachable from director: 
PING epsg9009.britain.agilent.com (156.141.59.62) from 156.141.59.59 : 56(84) 
bytes of data.
64 bytes from epsg9009.britain.agilent.com (156.141.59.62): icmp_seq=0 ttl=255 
time=336 usec

--- epsg9009.britain.agilent.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/mdev = 0.336/0.336/0.336/0.000 ms
 
displaying ipvsadm settings 
IP Virtual Server version 0.8.1 (size=4096)                    
Prot LocalAddress:Port Scheduler Flags                         
  -> RemoteAddress:Port             Forward Weight ActiveConn InActConn
TCP  epsg9010.britain.agilent.com:telnet rr
  -> epsg9009.britain.agilent.com:telnet Masq    1      0          0         

masquerading handled by LVS code. 
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
installing default gw 156.141.56.1
deleting current default gw 156.141.56.1
setting default gw to 156.141.56.1
showing routing table

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
156.141.59.63   0.0.0.0         255.255.255.255 UH       40 0          0 eth0
156.141.56.0    0.0.0.0         255.255.248.0   U        40 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
0.0.0.0         156.141.56.1    0.0.0.0         UG       40 0          0 eth0

checking if DEFAULT_GW 156.141.56.1 is reachable - PING 156.141.56.1 
(156.141.56.1) from 156.141.59.59 : 56(84) bytes of data.
64 bytes from 156.141.56.1: icmp_seq=0 ttl=255 time=741 usec

--- 156.141.56.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/mdev = 0.741/0.741/0.741/0.000 ms
good
 
killing ntpd process 1378.
ntpd restarted


Fatal Errors: 1
Your LVS is not setup properly.
LVSCONF_FORMAT=1.0
LVS_TYPE=VS_NAT
INITIAL_STATE=on
CLEAR_IPVS_TABLES=yes
VIP=eth0:110 156.141.59.63 255.255.248.0 156.141.59.63
DIRECTOR_INSIDEIP=eth0 156.141.59.59 255.255.248.0 156.141.63.255
DIRECTOR_GW=156.141.56.1
SERVICE=t telnet rr 156.141.59.62:telnet
SERVER_NET_DEVICE=eth0
<Prev in Thread] Current Thread [Next in Thread>