<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://kb.linux-vs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Maluyao</id>
		<title>LVSKB - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://kb.linux-vs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Maluyao"/>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki/Special:Contributions/Maluyao"/>
		<updated>2026-04-28T11:00:26Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=IPVS_Wish_List&amp;diff=5760</id>
		<title>IPVS Wish List</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=IPVS_Wish_List&amp;diff=5760"/>
				<updated>2008-02-10T14:58:22Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* Feature List */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is to write all the wishes for [[IPVS]] development.&lt;br /&gt;
&lt;br /&gt;
'''Remember''': you can ask for features as long as you want, but that won't make such features appear magically. :) Basically, you have these options:&lt;br /&gt;
* get your hands dirty, program and submit code to LVS&lt;br /&gt;
* convince other programmers that your wanted feature is valuable to them so that the programmers do it for you (and the rest of the community)&lt;br /&gt;
* put some bounty on a feature development and wait until someone wants to earn some money&lt;br /&gt;
&lt;br /&gt;
== Feature List ==&lt;br /&gt;
&lt;br /&gt;
* [[SCTP load balancing]] support&lt;br /&gt;
* connection synchronization improvement&lt;br /&gt;
* ip_gre tunnel&lt;br /&gt;
&lt;br /&gt;
* [[IPV6 load balancing]] support&lt;br /&gt;
&lt;br /&gt;
[[Category:IPVS]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3923</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3923"/>
				<updated>2007-01-01T14:26:06Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* VS/DR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== VS/NAT ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| VIP/EXT IP ||  192.168.9.244 &lt;br /&gt;
|-&lt;br /&gt;
|| GATEWAY IP ||  192.168.0.1&lt;br /&gt;
|-&lt;br /&gt;
||RS1 || 192.168.0.150 &lt;br /&gt;
|-&lt;br /&gt;
||RS2 || 192.168.0.160 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
 ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
 ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
 ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VS/DR ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| VIP/eth0:0 ||  192.168.9.200/24&lt;br /&gt;
|-&lt;br /&gt;
|| LB/eth0 ||  192.168.9.244&lt;br /&gt;
|-&lt;br /&gt;
||RS1 || 192.168.9.150 with lo0:0 192.168.9.244/32 noarp&lt;br /&gt;
|-&lt;br /&gt;
||RS2 || 192.168.9.160 with lo0:0 192.168.9.244/32 noarp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
 ipvsadm -C&lt;br /&gt;
 ipvsadm -A -t 192.168.9.200:554  -s rr&lt;br /&gt;
 ipvsadm -a -t 192.168.9.200:554  -r 192.168.9.150 -g&lt;br /&gt;
 ipvsadm -a -t 192.168.9.200:554  -r 192.168.9.160 -g&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.200/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3922</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3922"/>
				<updated>2007-01-01T14:25:24Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* VS/NAT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== VS/NAT ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| VIP/EXT IP ||  192.168.9.244 &lt;br /&gt;
|-&lt;br /&gt;
|| GATEWAY IP ||  192.168.0.1&lt;br /&gt;
|-&lt;br /&gt;
||RS1 || 192.168.0.150 &lt;br /&gt;
|-&lt;br /&gt;
||RS2 || 192.168.0.160 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
 ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
 ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
 ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VS/DR ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| VIP/eth0:0 ||  192.168.9.200/24&lt;br /&gt;
|-&lt;br /&gt;
|| LB ||  192.168.9.244&lt;br /&gt;
|-&lt;br /&gt;
||RS1 || 192.168.9.150 with lo0:0 192.168.9.244/32 noarp&lt;br /&gt;
|-&lt;br /&gt;
||RS2 || 192.168.9.160 with lo0:0 192.168.9.244/32 noarp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
 ipvsadm -C&lt;br /&gt;
 ipvsadm -A -t 192.168.9.200:554  -s rr&lt;br /&gt;
 ipvsadm -a -t 192.168.9.200:554  -r 192.168.9.150 -g&lt;br /&gt;
 ipvsadm -a -t 192.168.9.200:554  -r 192.168.9.160 -g&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.200/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3921</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3921"/>
				<updated>2007-01-01T13:48:10Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* VS/NAT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== VS/NAT ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| VIP/EXT IP ||  192.168.9.244 &lt;br /&gt;
|-&lt;br /&gt;
|| GATEWAY IP ||  192.168.0.1&lt;br /&gt;
|-&lt;br /&gt;
||RS1 || 192.168.0.150 &lt;br /&gt;
|-&lt;br /&gt;
||RS2 || 192.168.0.160 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
 ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
 ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
 ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3920</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3920"/>
				<updated>2007-01-01T13:42:40Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* VS/NAT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== VS/NAT ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| VIP/EXTIP ||  192.168.9.244 &lt;br /&gt;
|-&lt;br /&gt;
||RS1 || 192.168.0.150 &lt;br /&gt;
|-&lt;br /&gt;
||RS2 || 192.168.0.160 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
 ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
 ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
 ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3919</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3919"/>
				<updated>2007-01-01T13:42:12Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* VS/NAT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== VS/NAT ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| VIP/EXTIP ||  192.168.9.244 &lt;br /&gt;
|-&lt;br /&gt;
||RS1 || 192.168.0.150 &lt;br /&gt;
|-&lt;br /&gt;
||RS2 || 192.168.0.160 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3918</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3918"/>
				<updated>2007-01-01T13:19:51Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* VS/NAT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== VS/NAT ===&lt;br /&gt;
|| VIP/EXTIP ||  192.168.9.244 ||&lt;br /&gt;
||RS1 || 192.168.0.150 ||&lt;br /&gt;
||RS2 || 192.168.0.160 ||&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3917</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3917"/>
				<updated>2007-01-01T13:18:16Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* vsnat mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== VS/NAT ===&lt;br /&gt;
VIP/EXTIP 192.168.9.244&lt;br /&gt;
RS1 192.168.0.150&lt;br /&gt;
RS2 192.168.0.160&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
for a test.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3916</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3916"/>
				<updated>2007-01-01T13:17:07Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== vsnat mode ===&lt;br /&gt;
VIP/EXTIP 192.168.9.244&lt;br /&gt;
RS1 192.168.0.150&lt;br /&gt;
RS2 192.168.0.160&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3915</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3915"/>
				<updated>2007-01-01T13:16:19Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* Configuration Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
=== vsnat mode&lt;br /&gt;
VIP/EXTIP 192.168.9.244&lt;br /&gt;
RS1 192.168.0.150&lt;br /&gt;
RS2 192.168.0.160&lt;br /&gt;
&lt;br /&gt;
Run the follwing script on LB Server:&lt;br /&gt;
ipvsadm -A -t 192.168.9.244:554  -s rr&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.150 -m&lt;br /&gt;
ipvsadm -a -t 192.168.9.244:554  -r 192.168.0.160 -m&lt;br /&gt;
&lt;br /&gt;
Run &lt;br /&gt;
 realplay rtsp://192.168.9.244/test.rm&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3914</id>
		<title>Building Helix Server Cluster using LVS</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Building_Helix_Server_Cluster_using_LVS&amp;diff=3914"/>
				<updated>2007-01-01T13:04:36Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RealNetworks' streaming service uses the following protocols:&lt;br /&gt;
&lt;br /&gt;
* PNM (TCP on port 7070, UDP from server -&amp;gt; player on ports 6970-7170)&lt;br /&gt;
* [[RTSP]] (TCP on port 554, similar UDP as above, but often on multiple ports)&lt;br /&gt;
* PNM was our original, but now mostly legacy, protocol used in our versions 1 through 5.&lt;br /&gt;
* There's also a HTTP/TCP-only fallback mode which is (usually) on port 8080.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Example ==&lt;br /&gt;
===vsnat mode&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* http://archive.linuxvirtualserver.org/html/lvs-users/2001-06/msg00097.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{lvs-example-stub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Media]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3725</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3725"/>
				<updated>2006-08-29T03:39:16Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* Config FreeBSD box */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
== Normal Linux Solaris/FreeBSD IP-tunneling ==&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
=== Testing environment ===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| OS IP       ||        Address  || Tunnel IP Address&lt;br /&gt;
|-&lt;br /&gt;
|| Fedora Core 5 Linux || 10.0.0.1 || 172.16.0.1&lt;br /&gt;
|-&lt;br /&gt;
|| Solaris 10 x86  || 10.0.0.2 || 172.16.0.2&lt;br /&gt;
|-&lt;br /&gt;
|| FreeBSD 5.4   || 10.0.0.3 || 172.16.0.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Config Linux box ===&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
 &lt;br /&gt;
 ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
 /sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
 &lt;br /&gt;
 /sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 /sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
 ifconfig gif0 create&lt;br /&gt;
 &lt;br /&gt;
 ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
 gif_interfaces=”gif0”&lt;br /&gt;
 &lt;br /&gt;
 gifconfig_gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
 &lt;br /&gt;
 ifconfig_gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
===  Using IP-tunneling ===&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
=== Topological graph ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 ifconfig_lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
 &lt;br /&gt;
 gif_interfaces=”gif0”&lt;br /&gt;
 &lt;br /&gt;
 gifconfig_gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
 &lt;br /&gt;
 ifconfig_gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
 &lt;br /&gt;
 apache_enable=”YES”&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
 tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
 &lt;br /&gt;
 192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
=== Config Load balancer ===&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
 sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
 ipvsadm -C&lt;br /&gt;
 &lt;br /&gt;
 ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
 &lt;br /&gt;
 ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
 &lt;br /&gt;
 ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;br /&gt;
&lt;br /&gt;
[3] http://blog.kovyrin.net/2006/03/17/how-to-create-ip-ip-tunnel-between-freebsd-and-linux/&lt;br /&gt;
&lt;br /&gt;
[4] http://docs.sun.com/app/docs/doc/817-0573/6mgc65bcq?a=view&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Tunnel]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3724</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3724"/>
				<updated>2006-08-29T03:37:28Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* Config FreeBSD box */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
== Normal Linux Solaris/FreeBSD IP-tunneling ==&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
=== Testing environment ===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|| OS IP       ||        Address  || Tunnel IP Address&lt;br /&gt;
|-&lt;br /&gt;
|| Fedora Core 5 Linux || 10.0.0.1 || 172.16.0.1&lt;br /&gt;
|-&lt;br /&gt;
|| Solaris 10 x86  || 10.0.0.2 || 172.16.0.2&lt;br /&gt;
|-&lt;br /&gt;
|| FreeBSD 5.4   || 10.0.0.3 || 172.16.0.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Config Linux box ===&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
 &lt;br /&gt;
 ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
 /sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
 &lt;br /&gt;
 /sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 /sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
 ifconfig gif0 create&lt;br /&gt;
 &lt;br /&gt;
 ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
 &lt;br /&gt;
 ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
 gif_interfaces=”gif0”&lt;br /&gt;
 &lt;br /&gt;
 gifconfig_gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
 &lt;br /&gt;
 ifconfig_gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
===  Using IP-tunneling ===&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
=== Topological graph ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
 &lt;br /&gt;
 gif interfaces=”gif0”&lt;br /&gt;
 &lt;br /&gt;
 gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
 &lt;br /&gt;
 ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
 &lt;br /&gt;
 apache enable=”YES”&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
 tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
 &lt;br /&gt;
 192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
=== Config Load balancer ===&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
 sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
 ipvsadm -C&lt;br /&gt;
 &lt;br /&gt;
 ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
 &lt;br /&gt;
 ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
 &lt;br /&gt;
 ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;br /&gt;
&lt;br /&gt;
[3] http://blog.kovyrin.net/2006/03/17/how-to-create-ip-ip-tunnel-between-freebsd-and-linux/&lt;br /&gt;
&lt;br /&gt;
[4] http://docs.sun.com/app/docs/doc/817-0573/6mgc65bcq?a=view&lt;br /&gt;
&lt;br /&gt;
[[Category:LVS Examples|Tunnel]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3704</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3704"/>
				<updated>2006-08-16T09:36:19Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* Testing environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Normal Linux Solaris/FreeBSD IP-tunneling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
=== Testing environment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OS IP               Address   Tunnel IP Address&lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1  172.16.0.1&lt;br /&gt;
&lt;br /&gt;
Solaris 10 x86      10.0.0.2  172.16.0.2&lt;br /&gt;
&lt;br /&gt;
FreeBSD 5.4         10.0.0.3  172.16.0.3&lt;br /&gt;
&lt;br /&gt;
=== Config Linux box ===&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
===  Using IP-tunneling ===&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
=== Topological graph ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
=== Config Load balancer ===&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;br /&gt;
&lt;br /&gt;
[3] http://blog.kovyrin.net/2006/03/17/how-to-create-ip-ip-tunnel-between-freebsd-and-linux/&lt;br /&gt;
&lt;br /&gt;
[4] http://docs.sun.com/app/docs/doc/817-0573/6mgc65bcq?a=view&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3703</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3703"/>
				<updated>2006-08-16T08:57:03Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Normal Linux Solaris/FreeBSD IP-tunneling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
=== Testing environment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OS IP Address Tunnel IP Address&lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
Solaris 10 x86 10.0.0.2 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
FreeBSD 5.4 10.0.0.3 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
=== Config Linux box ===&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
===  Using IP-tunneling ===&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
=== Topological graph ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
=== Config Load balancer ===&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;br /&gt;
&lt;br /&gt;
[3] http://blog.kovyrin.net/2006/03/17/how-to-create-ip-ip-tunnel-between-freebsd-and-linux/&lt;br /&gt;
&lt;br /&gt;
[4] http://docs.sun.com/app/docs/doc/817-0573/6mgc65bcq?a=view&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3702</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3702"/>
				<updated>2006-08-16T08:47:17Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Normal Linux Solaris IP-tunneling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
=== Testing environment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OS IP Address Tunnel IP Address&lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
Solaris 10 x86 10.0.0.2 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
FreeBSD 5.4 10.0.0.3 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
=== Config Linux box ===&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
===  Using IP-tunneling ===&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
=== Topological graph ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
=== Config Load balancer ===&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;br /&gt;
&lt;br /&gt;
[3] http://blog.kovyrin.net/2006/03/17/how-to-create-ip-ip-tunnel-between-freebsd-and-linux/&lt;br /&gt;
&lt;br /&gt;
[4] http://docs.sun.com/app/docs/doc/817-0573/6mgc65bcq?a=view&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3701</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3701"/>
				<updated>2006-08-16T08:46:24Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LVS/TUN mode with FreeBSD and Solaris&lt;br /&gt;
&lt;br /&gt;
Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Normal Linux Solaris IP-tunneling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
=== Testing environment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OS IP Address Tunnel IP Address&lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
Solaris 10 x86 10.0.0.2 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
FreeBSD 5.4 10.0.0.3 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
=== Config Linux box ===&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
===  Using IP-tunneling ===&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
=== Topological graph ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
=== Config Load balancer ===&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;br /&gt;
&lt;br /&gt;
[3] http://blog.kovyrin.net/2006/03/17/how-to-create-ip-ip-tunnel-between-freebsd-and-linux/&lt;br /&gt;
&lt;br /&gt;
[4] http://docs.sun.com/app/docs/doc/817-0573/6mgc65bcq?a=view&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3700</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3700"/>
				<updated>2006-08-16T08:39:41Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: LVS/TUN mode with FreeBSD and Solaris realserver&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LVS/TUN mode with FreeBSD and Solaris&lt;br /&gt;
&lt;br /&gt;
Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Normal Linux Solaris IP-tunneling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
=== Testing environment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OS IP Address Tunnel IP Address&lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
Solaris 10 x86 10.0.0.2 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
FreeBSD 5.4 10.0.0.3 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
=== Config Linux box ===&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
===  Using IP-tunneling ===&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
=== Topological graph ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
=== Config Load balancer ===&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3699</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3699"/>
				<updated>2006-08-16T08:38:28Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LVS/TUN mode with FreeBSD and Solaris&lt;br /&gt;
&lt;br /&gt;
Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Normal Linux Solaris IP-tunneling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
=== Testing environment ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OS IP Address Tunnel IP Address&lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
Solaris 10 x86 10.0.0.2 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
FreeBSD 5.4 10.0.0.3 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
=== Config Linux box ===&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
===  Using IP-tunneling ===&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
=== Topological graph ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
=== Config FreeBSD box ===&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
=== Config Solaris box ===&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
=== Config Load balancer ===&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3698</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3698"/>
				<updated>2006-08-16T08:26:44Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LVS/TUN mode with FreeBSD and Solaris&lt;br /&gt;
&lt;br /&gt;
Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1 Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
2 Normal Linux Solaris IP-tunneling&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
2.1 Testing environment&lt;br /&gt;
&lt;br /&gt;
OS IP Address Tunnel IP Address&lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
Solaris 10 x86 10.0.0.2 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
FreeBSD 5.4 10.0.0.3 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
2.2 Config Linux box&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
2.3 Config Solaris box&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
2.4 Config FreeBSD box&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
2.5 Using IP-tunneling&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== &lt;br /&gt;
3 Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
3.1 Topological graph&lt;br /&gt;
&lt;br /&gt;
[[Image:Topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
3.2 Config FreeBSD box&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
3.3 Config Solaris box&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
3.4 Config Load balancer&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== &lt;br /&gt;
4 Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
http://www.linuxvirtualserver.org http://www.triload.com/en/manual/index.html&lt;br /&gt;
References&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=File:Topo.png&amp;diff=3697</id>
		<title>File:Topo.png</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=File:Topo.png&amp;diff=3697"/>
				<updated>2006-08-16T08:25:26Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3696</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3696"/>
				<updated>2006-08-16T08:23:44Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LVS/TUN mode with FreeBSD and Solaris&lt;br /&gt;
&lt;br /&gt;
Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
August 16, 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1 Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
&lt;br /&gt;
a. Network Address Translation (VS/NAT)&lt;br /&gt;
&lt;br /&gt;
b. Direct Routing (VS/DR)&lt;br /&gt;
&lt;br /&gt;
c. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
2 Normal Linux Solaris IP-tunneling&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
2.1 Testing environment&lt;br /&gt;
&lt;br /&gt;
OS IP Address Tunnel IP Address&lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
Solaris 10 x86 10.0.0.2 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
FreeBSD 5.4 10.0.0.3 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
2.2 Config Linux box&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
2.3 Config Solaris box&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
2.4 Config FreeBSD box&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
2.5 Using IP-tunneling&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
== &lt;br /&gt;
3 Working example of VS/TUN ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
3.1 Topological graph&lt;br /&gt;
&lt;br /&gt;
[[Image:http://zh.linuxvirtualserver.org/files/topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
3.2 Config FreeBSD box&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
3.3 Config Solaris box&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
3.4 Config Load balancer&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p&lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
== &lt;br /&gt;
4 Conclusions and Future Work ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
http://www.linuxvirtualserver.org http://www.triload.com/en/manual/index.html&lt;br /&gt;
References&lt;br /&gt;
&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3695</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3695"/>
				<updated>2006-08-16T08:20:07Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LVS/TUN mode with FreeBSD and Solaris&lt;br /&gt;
Author: Ma Luyao RHCE   maluyao at gmail dot com&lt;br /&gt;
August 16, 2006&lt;br /&gt;
1 Introduction&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology.&lt;br /&gt;
1. Network Address Translation (VS/NAT)&lt;br /&gt;
2. Direct Routing (VS/DR)&lt;br /&gt;
3. IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer’s NIC and the real server’s NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
2 Normal Linux Solaris IP-tunneling&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let’s do some test to setup normal Linux-Solaris and Linux-FreeBSD IPtunneling without LVS.&lt;br /&gt;
&lt;br /&gt;
2.1 Testing environment&lt;br /&gt;
OS IP Address Tunnel IP Address&lt;br /&gt;
Fedora Core 5 Linux 10.0.0.1 172.16.0.1&lt;br /&gt;
Solaris 10 x86 10.0.0.2 172.16.0.2&lt;br /&gt;
FreeBSD 5.4 10.0.0.3 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
2.2 Config Linux box&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The ”tun0” is a virtual NIC device name. It can be replaced by other names, such as ”abc0” or ”def0”.&lt;br /&gt;
&lt;br /&gt;
2.3 Config Solaris box&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
2.4 Config FreeBSD box&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
gifconfig gif0=”10.0.0.3 10.0.0.1”&lt;br /&gt;
ifconfig gif0=”172.16.0.3 172.16.0.1 netmask 255.255.255.0”&lt;br /&gt;
&lt;br /&gt;
2.5 Using IP-tunneling&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
3 Working example of VS/TUN&lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don’t send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper &lt;br /&gt;
tunnel on FreeBSD/Solaris box.&lt;br /&gt;
&lt;br /&gt;
3.1 Topological graph&lt;br /&gt;
[[Image:http://zh.linuxvirtualserver.org/files/topo.png]]&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling. Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
3.2 Config FreeBSD box&lt;br /&gt;
&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
...&lt;br /&gt;
ifconfig lnc0=”inet 192.168.0.170 netmask 0xffffff00”&lt;br /&gt;
gif interfaces=”gif0”&lt;br /&gt;
gifconfig gif0=”192.168.0.170 192.168.10.100”&lt;br /&gt;
ifconfig gif0=”192.168.10.200 192.168.10.99 netmask 0xffffffff”&lt;br /&gt;
apache enable=”YES”&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
3.3 Config Solaris box&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address&lt;br /&gt;
and never use it.&lt;br /&gt;
&lt;br /&gt;
3.4 Config Load balancer&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box: Linux kernel must have ip forward enable.&lt;br /&gt;
Edit /etc/sysctl.conf and set to:&lt;br /&gt;
net.ipv4.ip forward = 1&lt;br /&gt;
While running command:&lt;br /&gt;
sysctl -p&lt;br /&gt;
It will take effect.&lt;br /&gt;
Run the scripts:&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80 -s wlc&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.170 -i&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80 -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
4 Conclusions and Future Work&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment? &lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
http://www.linuxvirtualserver.org http://www.triload.com/en/manual/index.html&lt;br /&gt;
References&lt;br /&gt;
[1] http://www.linuxvirtualserver.org&lt;br /&gt;
[2] http://www.triload.com/en/manual/index.html&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3694</id>
		<title>LVS/TUN mode with FreeBSD and Solaris realserver</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=LVS/TUN_mode_with_FreeBSD_and_Solaris_realserver&amp;diff=3694"/>
				<updated>2006-08-16T08:05:33Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LVS/TUN mode with FreeBSD and Solaris&lt;br /&gt;
&lt;br /&gt;
Author: Ma Luyao RHCE  maluyao at gmail dot com&lt;br /&gt;
&lt;br /&gt;
Introduction&lt;br /&gt;
&lt;br /&gt;
The Linux Virtual Server Project (LVS) is a project started by Dr. Wensong Zhang. LVS implements three load balance technology. &lt;br /&gt;
&lt;br /&gt;
Network Address Translation (VS/NAT)&lt;br /&gt;
Direct Routing (VS/DR)&lt;br /&gt;
IP Tunneling (VS/TUN)&lt;br /&gt;
&lt;br /&gt;
VS/NAT is easy to setup. The load balancer may be a bottleneck of the whole system where the number of servers is more than 20, because both the request packets and response packets need to be rewritten by the load balancer.&lt;br /&gt;
&lt;br /&gt;
VS/DR has the best performance. VS/DR uses MAC-spoofing technology, so it requires that one of the load balancer's NIC and the real server's NIC must be in the same IP network segment, and physical segment as well.&lt;br /&gt;
&lt;br /&gt;
VS/TUN is the most scalable. The advantage is since servers connect each other by using IP-tunneling, the load balance and real servers can reside on different LAN , or even WAN.&lt;br /&gt;
&lt;br /&gt;
I plan to setup a set of servers with load balance technique. Realserver run FreeBSD and Solaris system in different places on our business. So it is the only choice for us to use VS/TUN.&lt;br /&gt;
&lt;br /&gt;
According to the official document of LVS, FreeBSD and Solaris system can not be a realserver, but I did do it after some hard testing. &lt;br /&gt;
&lt;br /&gt;
We install Fedora Core 5 Linux on our Load Balance server. Kernel-2.6.15 is default.&lt;br /&gt;
&lt;br /&gt;
FreeBSD version is 5.4, we recompile the kernel in order to improve the performance. The default kernel can work too.&lt;br /&gt;
&lt;br /&gt;
Solaris box runs Solaris 10 x86.&lt;br /&gt;
&lt;br /&gt;
Normal Linux Solaris IP-tunneling&lt;br /&gt;
&lt;br /&gt;
IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagram, which allows datagram destined for one IP address to be wrapped and redirected to another IP address. Many modern OS support IP tunneling, such as Linux, FreeBSD and Solaris.&lt;br /&gt;
&lt;br /&gt;
Let's do some test to setup normal Linux-Solaris and Linux-FreeBSD IP-tunneling without LVS.&lt;br /&gt;
OS                   | IP Address | Tunnel IP Address &lt;br /&gt;
&lt;br /&gt;
Fedora Core 5 Linux  | 10.0.0.1   | 172.16.0.1 &lt;br /&gt;
Solaris 10 x86       | 10.0.0.2   | 172.16.0.2 &lt;br /&gt;
FreeBSD 5.4          | 10.0.0.3   | 172.16.0.3 &lt;br /&gt;
&lt;br /&gt;
Config Linux box&lt;br /&gt;
&lt;br /&gt;
In order to create an IP-Tunneling between Linux box and Solaris box, run command:&lt;br /&gt;
&lt;br /&gt;
ip tunnel add tun0 mode ipip remote 10.0.0.2 local 10.0.0.1&lt;br /&gt;
ifconfig tun0 172.16.0.1 pointopoint 172.16.0.2&lt;br /&gt;
ip tunnel add tun1 mode ipip remote 10.0.0.3 local 10.0.0.1&lt;br /&gt;
ifconfig tun1 172.16.0.1 pointopoint 172.16.0.3&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;tun0&amp;quot; is a virtual NIC device name. It can be replaced by other names, such as &amp;quot;abc0&amp;quot; or &amp;quot;def0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Config Solaris box&lt;br /&gt;
&lt;br /&gt;
To create an IP-tunneling, we have two methods, First method of creating tunnel is using three commands as below.&lt;br /&gt;
&lt;br /&gt;
/sbin/ifconfig ip.tun0 plumb&lt;br /&gt;
/sbin/ifconfig ip.tun0 tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
/sbin/ifconfig ip.tun0 172.16.0.2 172.16.0.1&lt;br /&gt;
&lt;br /&gt;
It takes effect immediately.&lt;br /&gt;
&lt;br /&gt;
Second method is creating /etc/hostname.ip.tun0 file which contains two lines as below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
tsrc 10.0.0.2 tdst 10.0.0.1&lt;br /&gt;
172.16.0.2 172.16.0.1 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Config FreeBSD box&lt;br /&gt;
On FreeBSD box, we also have two methods to create an IP-Tunneling, one way is to run three commands:&lt;br /&gt;
&lt;br /&gt;
ifconfig gif0 create&lt;br /&gt;
ifconfig gif0 tunnel 10.0.0.3 10.0.0.1&lt;br /&gt;
ifconfig gif0 inet 172.16.0.3 172.168.0.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
If we use the second method, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
Add three lines on /etc/rc.conf file as below, the tunnel will exist automatically after we reboot system.&lt;br /&gt;
&lt;br /&gt;
gif_interfaces=&amp;quot;gif0&amp;quot;&lt;br /&gt;
gifconfig_gif0=&amp;quot;10.0.0.3 10.0.0.1&amp;quot;&lt;br /&gt;
ifconfig_gif0=&amp;quot;172.16.0.3 172.16.0.1  netmask 255.255.255.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using IP-tunneling&lt;br /&gt;
&lt;br /&gt;
In all the cases on Linux/FreeBSD/Solaris, the netmask value will be default if we ignore to set it.&lt;br /&gt;
&lt;br /&gt;
After creating two tunnels, we can ping 10.0.0.2 and 10.0.0.3 at Linux box successfully, and ping 10.0.0.1 at Solaris or FreeBSD box successfully. All applications layers protocol will work correctly.&lt;br /&gt;
&lt;br /&gt;
Working example of VS/TUN &lt;br /&gt;
&lt;br /&gt;
In VS/TUN mode, because realserver don't send any datagram to Load balancer, we need not create any tunnel on Linux box and must create proper tunnel on FreeBSD/Solaris box. &lt;br /&gt;
&lt;br /&gt;
Topological graph&lt;br /&gt;
&lt;br /&gt;
topo.eps&lt;br /&gt;
&lt;br /&gt;
We can treat all machines on internet and have their real ip. The client can send their requests to VIP of LB Server. LB Server redirects the requests realserver through IP-tunneling.  Realserver can send datagram to client.&lt;br /&gt;
&lt;br /&gt;
Because both the gif0 of FreeBSD and ip.tun0 both are NO-ARP device, they are invisible to client.&lt;br /&gt;
&lt;br /&gt;
Config FreeBSD box&lt;br /&gt;
On FreeBSD box, edit /etc/rc.conf as below:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
ifconfig_lnc0=&amp;quot;inet 192.168.0.170  netmask 0xffffff00&amp;quot;&lt;br /&gt;
gif_interfaces=&amp;quot;gif0&amp;quot;&lt;br /&gt;
gifconfig_gif0=&amp;quot;192.168.0.170 192.168.10.100&amp;quot;&lt;br /&gt;
ifconfig_gif0=&amp;quot;192.168.10.200 192.168.10.99 netmask 0xffffffff&amp;quot;&lt;br /&gt;
apache_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any idle IP and never use.&lt;br /&gt;
&lt;br /&gt;
Config Solaris box&lt;br /&gt;
&lt;br /&gt;
On Solaris , edit /etc/hostname.ip.tun0 as below:&lt;br /&gt;
&lt;br /&gt;
tsrc 192.168.0.180 tdst 192.168.10.100&lt;br /&gt;
192.168.10.200 192.168.10.99 netmask 255.255.255.255 up&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
192.168.10.99 looks like a terminal of this tunnel. It can be any IP address and never use it.&lt;br /&gt;
&lt;br /&gt;
Config Load balancer&lt;br /&gt;
&lt;br /&gt;
Run ipvsadm command on Linux Box:&lt;br /&gt;
Linux kernel must have ip_forward enable. Edit /etc/sysctl.conf and set to:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.ip_forward = 1&lt;br /&gt;
&lt;br /&gt;
While running command:&lt;br /&gt;
&lt;br /&gt;
sysctl -p &lt;br /&gt;
&lt;br /&gt;
It will take effect.&lt;br /&gt;
&lt;br /&gt;
Run the scripts:&lt;br /&gt;
&lt;br /&gt;
ipvsadm -C&lt;br /&gt;
ipvsadm -A -t 192.168.10.200:80  -s wlc&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80  -r 192.168.0.170 -i&lt;br /&gt;
ipvsadm -a -t 192.168.10.200:80  -r 192.168.0.180 -i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this script, the port of LB Server and realerver must be same. Good idea is not setting the port of realserver.&lt;br /&gt;
&lt;br /&gt;
Now VS/TUN is finished. When a client access 192.168.10.200 at port 80, the&lt;br /&gt;
datagram will be sent to 192.168.0.170 or 192.168.180 port 80.&lt;br /&gt;
&lt;br /&gt;
Conclusions and Future Work&lt;br /&gt;
&lt;br /&gt;
I believe AIX and HP-UX can also work with VS/TUN, I have no Aix or HP-UX servers. Who can help to provide me with such an environment?&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
http://www.linuxvirtualserver.org&lt;br /&gt;
http://www.triload.com/en/manual/index.html&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	<entry>
		<id>http://kb.linux-vs.org/wiki?title=Examples&amp;diff=3693</id>
		<title>Examples</title>
		<link rel="alternate" type="text/html" href="http://kb.linux-vs.org/wiki?title=Examples&amp;diff=3693"/>
				<updated>2006-08-16T08:03:59Z</updated>
		
		<summary type="html">&lt;p&gt;Maluyao: /* Linux/Unix Cluster */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is to design examples using LVS, so please feel free to write your LVS systems here and share them with other LVS users.&lt;br /&gt;
&lt;br /&gt;
== Linux/Unix Cluster ==&lt;br /&gt;
&lt;br /&gt;
* [[Building Scalable Web Cluster using LVS]]&lt;br /&gt;
* [[Building Web Cache Cluster using LVS]]&lt;br /&gt;
* [[Building clusterized proxy farms using LVS]]&lt;br /&gt;
* [[Building Scalable Mail Cluster using LVS]]&lt;br /&gt;
* [[Building Scalable FTP Cluster using LVS]]&lt;br /&gt;
* [[Building Scalable TFTP Cluster using LVS]]&lt;br /&gt;
* [[Building MySQL Cluster using LVS]]&lt;br /&gt;
* [[Building Scalable DNS Cluster using LVS]]&lt;br /&gt;
* [[Building Tomcat Cluster using LVS]]&lt;br /&gt;
* [[Building Two-Node Directors/Real Servers using LVS and Keepalived]]&lt;br /&gt;
* [[Building an LDAP cluster using LVS and NetWare real servers]]&lt;br /&gt;
* [[Building Scalable DHCP Cluster using LVS]]&lt;br /&gt;
* [[LVS/TUN mode with FreeBSD and Solaris realserver]]&lt;br /&gt;
&lt;br /&gt;
== Media Service Cluster ==&lt;br /&gt;
&lt;br /&gt;
* [[Building Scalable Media Cluster using LVS]]&lt;br /&gt;
* [[Building Windows Media Service Cluster using LVS]]&lt;br /&gt;
* [[Building Darwin Streaming Service Cluster using LVS]]&lt;br /&gt;
* [[Building Helix Server Cluster using LVS]]&lt;br /&gt;
&lt;br /&gt;
== Terminal Service Cluster ==&lt;br /&gt;
&lt;br /&gt;
* [[Building Linux Terminal Service Cluster using LVS]]&lt;br /&gt;
* [[Building Windows Terminal Service Cluster using LVS]]&lt;/div&gt;</summary>
		<author><name>Maluyao</name></author>	</entry>

	</feed>