lvs-fullnat

fullnat

DR > 隧道 > NAT > FNAT(最慢,功能强)
FNAT:与NAT一样,支持多vlan,ddos

fullnat安装

(1)需要的包
asciidoc-8.4.5-4.1.el6.noarch.rpm
Lvs-fullnat-synproxy.tar.gz
newt-devel-0.52.11-3.el6.x86_64.rpm
kernel-2.6.32-220.23.1.el6.src.rpm
slang-devel-2.2.1-1.el6.x86_64.rpm

(2)包的安装
##解压fullnat源码包
tar zxf Lvs-fullnat-synproxy.tar.gz

##安装所需的包
yum install rpm-build -y
yum install kernel-2.6.32-220.23.1.el6.src.rpm -y
rpm -ivh kernel-2.6.32-220.23.1.el6.src.rpm
yum install redhat-rpm-config patchutils xmlto binutils-devel python-devel perl-ExtUtils-Embed hmaccalc -y
yum install asciidoc-8.4.5-4.1.el6.noarch.rpm -y
yum install newt-devel-0.52.11-3.el6.x86_64.rpm
yum install slang-devel-2.2.1-1.el6.x86_64.rpm
yum install newt-devel-0.52.11-3.el6.x86_64.rpm

##内核编译

cd /root/rpmbuild/SPECS
rpmbuild -bp kernel.spec 

##产生字符
yum install -y rng-tools
rngd -r /dev/urandom

(3)lvs内核设置
cd lvs-fullnat-synproxy/
cp lvs-2.6.32-220.23.1.el6.patch ~/rpmbuild/BUILD/kernel-2.6.32-220.23.1.el6/linux-2.6.32-220.23.1.el6.x86_64/

##增加补丁

cd /root/rpmbuild/BUILD/kernel-2.6.32-220.23.1.el6/linux-2.6.32-220.23.1.el6.x86_64
patch -p1 < lvs-2.6.32-220.23.1.el6.patch

##设置内核安装文件
vim Makefile

   4 EXTRAVERSION = -220.23.1.el6

##安装内核
安装前要确保可用硬盘大小大于8G

cd /root/rpmbuild/BUILD/kernel-2.6.32-220.23.1.el6/linux-2.6.32-220.23.1.el6.x86_64
make
make modules_install
make install

##编辑内核启动文件
vim /boot/grub/grub.conf

 10 default=0   ##默认为220.23.1.el6内核启动

reboot ##重启

(4)安装keepalived
/lib/modules/ ##该目录是存放内核版本文件的目录
cd /root/lvs-fullnat-synproxy/
tar zxf lvs-tools.tar.gz ##解压插件

\##路径 /root/lvs-fullnat-synproxy/tools/keepalived/

cd /root/lvs-fullnat-synproxy/tools/keepalived/
./configure --with-kernel-dir="/lib/modules/`uname -r`/build"
make
make install

(5)安装ipvsadm
yum remove ipvsadm -y ##把之前安装的版本3.5卸载,避免冲突

路径 /root/lvs-fullnat-synproxy/tools/ipvsadm/
cd /root/lvs-fullnat-synproxy/tools/ipvsadm/
make
make install

ipvsadm -l ##查看

你可能感兴趣的:(运维)