Labels
amazon
apache
apt
aptitude
automate docker image
awk
aws
awstat
backup
bandwidth
bash
binary log
bond
bridge
caching
centos
centos 7
cluster
concurrency
csv
digitalocean
disk
django
docker
docker images
dovecot
drop cache
enviroment
error
explain
free
fstab
ftp
git
gluster
go
gpg
grep
grub
header
header check
icinga2
imapsync
information
innodb
ip
iproute
isolation
ispconfig
java
jenkins
jump
kdump
keepalived
kvm
linux
locale
logbuffer
lookbehind
macos
mail
maillog
matplotlib
mcrypt
memory
modrewrite
monitoring
mount
msyql ndbcluster
mta
multipath
mutt
my.cnf
mysql
mysql error
mysql optimization
mysql permission
mysqlcluster
mysqldump
nethogs
network
nginx
node
nopasswd
ntp
nxlog
openssl
optimization
parsing
parted
password
pflogsumm
php
php-fpm
php5-mcrypt
phpmyadmin
pip
policyd
post
postfix
proxy
pycurl
python
query_cache
querydict
rdesktop
rds
recommender systems
recover mysql
redhat
redolog
regex
regularexpression
resilver
roundcube
route
rsync
scrapy
script
scrub
security
service
setfacl
sftp
slow
smtp
snnp
spamassassin
spotlight
sql
squirrelmail
ssc
ssh
ssh-copy-id
ssl
startup
syslog
syslog over tls
tar
telnet
tls
tomcat
transaction
troubleshoot
tuning
ubuntu
udev
ulimit
usb
vdev removal
virtualhost
virtualization
virtualmin
vrrp
watch
webscrape
wget
x11
zfs
zfs send
zfs recv
zpool
Setup a proxy server with web content filtering: squid+rejik+squint+sqstat
This summary is not available. Please
click here to view the post.
Linux Network Load Balancer For Multiple ISP Links
This article explains how to configure a Redhat/CentOS (and many
other Linux distributions) Linux server as a load balancer. For this
example, there are two routers each with a different ISP although they
could be the same ISP.
This was tested on a CentOS 6.3 64bit server.
In the script below, the load balancer has three interfaces: Eth0 is on the inside while Eth1 and Eth2 are connected to the routers.
Server addresses:
Eth0 = 192.168.0.10 (connected to inside network)
Eth1 = 192.168.1.10 (connected to router1/ISP1)
Eth2 = 192.168.2.10 (connected to router2/ISP2)
Router addresses:
Router1 = 192.168.1.1
Router2 = 192.168.2.1
Create a script file called “/usr/bin/lb.sh” with the following contents:
Add the following to the end of the “/etc/iproute2/rt_tables” file:
Make sure to configure static routes on the routers so they know their way back to the inside network.
From >>>
http://agix.com.au/blog/?p=3173
This was tested on a CentOS 6.3 64bit server.
In the script below, the load balancer has three interfaces: Eth0 is on the inside while Eth1 and Eth2 are connected to the routers.
Server addresses:
Eth0 = 192.168.0.10 (connected to inside network)
Eth1 = 192.168.1.10 (connected to router1/ISP1)
Eth2 = 192.168.2.10 (connected to router2/ISP2)
Router addresses:
Router1 = 192.168.1.1
Router2 = 192.168.2.1
Create a script file called “/usr/bin/lb.sh” with the following contents:
#!/bin/bash # By Andrew Galdes, AGIX, 4 April 2013 # Remember to turn off (or customise) SELinux and add the ROUTER1/2 in # the "/etc/iproute2/rt_tables" file. # Do NAT on this server. service network restart ip route flush cache ip route add 192.168.1.0/24 dev eth2 src 192.168.1.10 table ROUTER1 ip route add default via 192.168.1.1 table ROUTER1 ip route add 192.168.2.0/24 dev eth1 src 192.168.2.10 table ROUTER2 ip route add default via 192.168.2.1 table ROUTER2 ip rule add from 192.168.1.10 table ROUTER1 ip rule add from 192.168.2.10 table ROUTER2 # the following command is one line: ip route append default scope global nexthop via 192.168.1.1 dev eth1 weight 1 nexthop via 192.168.2.1 dev eth2 weight 1 route del default gw 192.168.1.1 route del default gw 192.168.2.1 ip routeMake the script executable:
chmod 755 /usr/bin/lb.shAdd the script to the boot process:
vi /etc/rc.localUse the following command to make sure the firewall is set correct.
system-configure-firewallThe firewall should trust the Eth+ devices. It should masquerade the Eth+ devices.
Add the following to the end of the “/etc/iproute2/rt_tables” file:
1 ROUTER1 2 ROUTER2Consider turning off SELinux as follows or make considered changes:
setenforce 0Set it permanently in the “/etc/sysconfig/selinux” file if you like.
Make sure to configure static routes on the routers so they know their way back to the inside network.
From >>>
http://agix.com.au/blog/?p=3173
Subscribe to:
Posts (Atom)