LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

lvs nat

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: lvs nat
From: <malalon@xxxxxxxxxxxxxx>
Date: Mon, 27 Aug 2001 20:03:53 +0200
Hi!
I'm trying to set up LVS_NAT, the simplest version from LVS_HOWTO, one director 
and two realservers. I,ve got a problem on RS: directors default gw isn't two 
hoops from realserver (all IPs are from howto).

Thanx for any help.

Pawel Osko.

****************************
My lvsnat.conf:

LVS_TYPE=VS_NAT
INITIAL_STATE=on
VIP=eth0:110 192.168.1.110 255.255.255.0 192.168.1.255
DIRECTOR_INSIDEIP=eth0 10.1.1.9 192.168.1.0 255.255.255.0 192.168.1.255
DIRECTOR_DEFAULT_GW=192.168.1.254
SERVICE=t telnet rr 10.1.1.2:telnet 10.1.1.3:telnet
SERVER_NET_DEVICE=eth0
SERVER_DEFAULT_GW=10.1.1.9

************************************
rc.lvsnat > log.txt (on director):

looking for standard utilities
$IPCHAINS=/sbin/ipchains
$PING=/bin/ping -c 1
$IFCONFIG=/sbin/ifconfig
$NETSTAT=/bin/netstat
$ROUTE=/sbin/route
$AWK=/usr/bin/awk
$AWK=/bin/awk
fping not found, using ping instead
$FPING=/bin/ping -c 1
done
LVS 

director 

clearing ipchain rules 
turn on ip forwarding


adding ethernet device and 

routing for VIP 192.168.1.110 
listing ifconfig info for VIP 192.168.1.110 
eth0:110  Link 

encap:Ethernet  HWaddr 00:C0:4F:B4:2B:06  
          inet addr:192.168.1.110  

Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  

Metric:1
          Interrupt:11 Base address:0xdcc0 

checking VIP 192.168.1.110 is 

reachable from self (director): PING 192.168.1.110 (192.168.1.110) from 
192.168.1.110 : 

56(84) bytes of data.
64 bytes from 192.168.1.110: icmp_seq=0 ttl=255 time=0.2 ms

--- 

192.168.1.110 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet 

loss
round-trip min/avg/max = 0.2/0.2/0.2 ms
listing routing info for VIP 192.168.1.110 
192.168.1.110   0.0.0.0         255.255.255.255 UH        0 0          0 eth0

 
installing 

LVS services with ipvsadm
checking if server 10.1.1.2 is reachable from director: PING 

10.1.1.2 (10.1.1.2) from 10.1.1.9 : 56(84) bytes of data.
64 bytes from 10.1.1.2: icmp_seq=0 

ttl=255 time=1.0 ms

--- 10.1.1.2 ping statistics ---
1 packets transmitted, 1 packets 

received, 0% packet loss
round-trip min/avg/max = 1.0/1.0/1.0 ms
checking if server 10.1.1.3 

is reachable from director: PING 10.1.1.3 (10.1.1.3) from 10.1.1.9 : 56(84) 
bytes of data.
64 bytes from 10.1.1.3: icmp_seq=0 ttl=255 time=0.6 ms

--- 10.1.1.3 ping statistics ---
1 

packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.6/0.6/0.6 

ms
 
displaying ipvsadm settings 
IP Virtual Server version 1.0.8 (size=4096)                

    
Prot LocalAddress:Port Scheduler Flags                         
  -> RemoteAddress:Port 

            Forward Weight ActiveConn InActConn
TCP  192.168.1.110:telnet rr
  -> 

10.1.1.3:telnet                Masq    1      0          0         
  -> 10.1.1.2:telnet     

           Masq    1      0          0         

installing ipchain rules
masquerading tcp 

10.1.1.2:telnet:tcp to outside world
masquerading tcp 10.1.1.3:telnet:tcp to outside world
ipchain rules 
Chain input (policy ACCEPT):
Chain forward (policy ACCEPT):
target     prot 

opt     source                destination           ports
MASQ       tcp  ------  10.1.1.2   

          anywhere              telnet ->   any
MASQ       tcp  ------  10.1.1.3             

anywhere              telnet ->   any
Chain output (policy ACCEPT):

 
changing default gw 

to 192.168.1.254
showing routing table
Kernel IP routing table
Destination     Gateway       

  Genmask         Flags   MSS Window  irtt Iface
10.1.1.9        0.0.0.0         

255.255.255.255 UH        0 0          0 eth0
192.168.1.110   0.0.0.0         

255.255.255.255 UH        0 0          0 eth0
192.168.1.0     0.0.0.0         255.255.255.0  

 U         0 0          0 eth0
10.1.1.0        0.0.0.0         255.255.255.0   U         0 0 

         0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 

lo
0.0.0.0         192.168.1.254   0.0.0.0         UG        0 0          0 eth0

checking 

if DEFAULT_GW 192.168.1.254 is reachable - PING 192.168.1.254 (192.168.1.254) 
from 

192.168.1.110 : 56(84) bytes of data.64 bytes from 192.168.1.254: icmp_seq=0 
ttl=255 

time=1.9 ms--- 192.168.1.254 ping statistics ---1 packets transmitted, 1 
packets received, 

0% packet lossround-trip min/avg/max = 1.9/1.9/1.9 ms, good
 
checking for valid 

server_gw 
default gw for the vs-nat servers is on director, good 





-- 

OnetKomunikator - porozumiesz sie
z innymi [ http://ok.onet.pl/instaluj.html ]



<Prev in Thread] Current Thread [Next in Thread>