在Freebsd和Linux之间创建IP隧道
[
2008/09/29 19:47 | by askwan ]
2008/09/29 19:47 | by askwan ]
OS1:Linux
Network Interface: eth0
IP: 61.152.1.1
OS2: FreeBSD
Network Interface: fxp0
IP: 210.51.1.1
预配置:
OS1: 10.0.0.1 / 255.255.255.252
OS2: 10.0.0.2 / 255.255.255.252
OS1上配置
配置ipip隧道
OS2配置隧道
OS1测试:
#ping -c 4 10.0.0.2
Network Interface: eth0
IP: 61.152.1.1
OS2: FreeBSD
Network Interface: fxp0
IP: 210.51.1.1
预配置:
OS1: 10.0.0.1 / 255.255.255.252
OS2: 10.0.0.2 / 255.255.255.252
OS1上配置
配置ipip隧道
Quotation
#ip tunnel add tun0 mode ipip remote 210.51.1.1 local 61.152.1.1 dev eth0
#ifconfig tun0 10.0.0.1 netmask 255.255.255.252 pointopoint 10.0.0.2
#ifconfig tun0 mtu 1500 up
#ifconfig tun0 10.0.0.1 netmask 255.255.255.252 pointopoint 10.0.0.2
#ifconfig tun0 mtu 1500 up
OS2配置隧道
Quotation
#ifconfig gif0 create
#gifconfig gif0 inet 210.51.1.1 61.152.1.1
#ifconfig gif0 10.0.0.2 netmask 255.255.255.252 10.0.0.1
#ifconfig gif0 mtu 1500 up
#gifconfig gif0 inet 210.51.1.1 61.152.1.1
#ifconfig gif0 10.0.0.2 netmask 255.255.255.252 10.0.0.1
#ifconfig gif0 mtu 1500 up
OS1测试:
#ping -c 4 10.0.0.2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.139 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.138 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.138 ms
64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=0.136 ms
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.139 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.138 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.138 ms
64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=0.136 ms
……
道不尽声声珍重
默默地祝福平安
人间事常难遂人愿
且看明月又有几回圆
远去矣,远去矣
……
道不尽声声珍重
默默地祝福平安
人间事常难遂人愿
且看明月又有几回圆
远去矣,远去矣
……
值得一看的《大秦帝国》
[
2008/09/20 17:57 | by askwan ]
2008/09/20 17:57 | by askwan ]
LVS + Keepalived 之DR实现
[
2008/09/19 17:25 | by askwan ]
2008/09/19 17:25 | by askwan ]
LVS原理可以看章博士的文章,Keepalived在这里主要用作RealServer的健康状态检查以及LoadBalance主机和BackUP主机之间failover的实现
OS: CentOS5.2/RHEL5.2
VIP: 129.0.3.236
LoadBalance : 129.0.3.230
BackUP: 129.0.3.231
RealServer1: 129.0.3.233
RealServer2: 129.0.3.234
1. LoadBalance配置
设置
安装ipvsadm
下载地址:http://www.linuxvirtualserver.org/software/kernel-2.6/ipvsadm-1.24.tar.gz
如果编译错误,看时候做了内核的软连接 /usr/src/linux
然后 make && make install
配置lvs
依次执行:
OS: CentOS5.2/RHEL5.2
VIP: 129.0.3.236
LoadBalance : 129.0.3.230
BackUP: 129.0.3.231
RealServer1: 129.0.3.233
RealServer2: 129.0.3.234
1. LoadBalance配置
设置
net.ipv4.ip_forward = 1
安装ipvsadm
下载地址:http://www.linuxvirtualserver.org/software/kernel-2.6/ipvsadm-1.24.tar.gz
如果编译错误,看时候做了内核的软连接 /usr/src/linux
然后 make && make install
配置lvs
依次执行:





