I am trying to configure load balancing for a couple of CentOS4 servers. In order to make it work, I need to add a hidden networking device on each server with the virtual IP. I found the following instructions on linuxvirtualserver.org for doing this, but they don't work. echo 1 > /proc/sys/net/ipv4/ip_forward ifconfig dummy0 0.0.0.0 up echo 1 > /proc/sys/net/ipv4/conf/all/hidden echo 1 > /proc/sys/net/ipv4/conf/dummy0/hidden ifconfig dummy0:0 172.26.20.110 up When I try to write to /proc/sys/net/ipv4/conf/all/hidden, the system refuses to let me create the file. I'm logged in as root, so why am I having permission problems? Also, I believe these instructions are for 2.2 or 2.4 kernels. Have things changed with 2.6? -- Bowie
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, Jan 26, 2006 at 04:15:59PM -0500, Bowie Bailey wrote:> I am trying to configure load balancing for a couple of CentOS4 servers. > In order to make it work, I need to add a hidden networking device on > each server with the virtual IP. I found the following instructions on > linuxvirtualserver.org for doing this, but they don't work. > > echo 1 > /proc/sys/net/ipv4/ip_forward > ifconfig dummy0 0.0.0.0 up > echo 1 > /proc/sys/net/ipv4/conf/all/hidden > echo 1 > /proc/sys/net/ipv4/conf/dummy0/hidden > ifconfig dummy0:0 172.26.20.110 up > > When I try to write to /proc/sys/net/ipv4/conf/all/hidden, the system > refuses to let me create the file. I'm logged in as root, so why am I > having permission problems? > > Also, I believe these instructions are for 2.2 or 2.4 kernels. Have things > changed with 2.6?No, things are exactly the same. Meaning that LVS is a separated patch that is not included either on the stock kernel or the RHEL one. If you really want to use LVS, you will have to apply the patch. Best Regards, - -- Rodrigo Barbosa <rodrigob at suespammers.org> "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFD2Ws3pdyWzQ5b5ckRAnlyAJ4351D2wx3NXml49qif+NFzfz4J7ACfYLgn 8IBzDh/TwTGiVPtEJLAJbiI=ZqGR -----END PGP SIGNATURE-----
Rodrigo Barbosa wrote:> On Thu, Jan 26, 2006 at 04:15:59PM -0500, Bowie Bailey wrote: > > I am trying to configure load balancing for a couple of CentOS4 > > servers. In order to make it work, I need to add a hidden > > networking device on > > each server with the virtual IP. I found the following > > instructions on linuxvirtualserver.org for doing this, but they > > don't work. > > > > echo 1 > /proc/sys/net/ipv4/ip_forward > > ifconfig dummy0 0.0.0.0 up > > echo 1 > /proc/sys/net/ipv4/conf/all/hidden > > echo 1 > /proc/sys/net/ipv4/conf/dummy0/hidden > > ifconfig dummy0:0 172.26.20.110 up > > > > When I try to write to /proc/sys/net/ipv4/conf/all/hidden, the > > system refuses to let me create the file. I'm logged in as root, > > so why am I having permission problems? > > > > Also, I believe these instructions are for 2.2 or 2.4 kernels. > > Have things changed with 2.6? > > No, things are exactly the same. Meaning that LVS is a separated patch > that is not included either on the stock kernel or the RHEL one. > > If you really want to use LVS, you will have to apply the patch.Hmm... I saw a reference to a kernel patch, but I thought the patch was for the server. I am actually not using a Linux LVS server, I am using a Foundry ServerIron to do the load balancing. It works great for standard balancing, but now I need to do direct routing to balance two CentOS4 servers. The instructions that came with the ServerIron just gave a single ifconfig command to set it up (which royally screwed up the networking). Do I need to install the kernel patch on these machines? And why would that affect the permissions problem I was seeing? As root, I should be able to create a file in any directory. It may not do what I expect if the functionality is not in the kernel, but I should be able to create the file. -- Bowie
Barry Brimer wrote:> > Rodrigo Barbosa wrote: > > > On Thu, Jan 26, 2006 at 04:15:59PM -0500, Bowie Bailey wrote: > > > > I am trying to configure load balancing for a couple of CentOS4 > > > > servers. > > Have a look at the Piranha/LVS direct routing information here: > <http://www.redhat.com/magazine/014dec05/departments/tips_tricks/> > > You will have to scroll down the page to find it.Interesting. I'm not too familiar with iptables, but based on that tip and what I've read from the man page, I should be able to do this for a webserver: iptables -t nat -A PREROUTING -p tcp -d 192.168.1.20 \ --dport 80 -j REDIRECT This should allow my machine to accept packets destined for the virtual IP (on port 80) and redirect them to localhost. Did I mess anything up there? Just a couple of questions come up here: 1) Do I still need to enable ip_forward? 2) When the server replies to the client, will the reply be sent from the proper virtual IP address? -- Bowie
Maybe Matching Threads
- action redirect and dummy interface
- Unable to get dummy interfaces to persist across reboots in CentOS 8
- Unable to get dummy interfaces to persist across reboots in CentOS 8
- Unable to get dummy interfaces to persist across reboots in CentOS 8
- Completely in despair - Xen and Windows domU