现在配置广州服务器

1.安装软件。。和主服务器一样 第1,2 步
2.开启路由并做SNAT转换
 #vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
 

# sysctl -p

#iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 192.168.68.73
 

3.将深圳服务器里面/etc/open***/keys/下的 ca.crt     ta.key   lvs1.key   lvs1.crt 拷贝到本机的/etc/open***/keys 下没有这目录就新建一个

4.创建广州×××服务器的配置文件
# vim /etc/open***/lvs1.conf
 

client
dev tun
proto udp
remote 192.168.68.71 1194
resolv-retry infinite
nobind
user nobody
group nobody
persist-key
persist-tun
ca keys/ca.crt
cert keys/lvs1.crt
key keys/lvs1.key
ns-cert-type server
tls-auth keys/ta.key 1
cipher BF-CBC
comp-lzo
verb 3
mute 20

5.重启×××服务器
#service open*** restart

6.查看一下tun0 和路由表
#ifconfig  tun0
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.8.0.1        0.0.0.0         255.255.255.255 UH    0      0        0 tun0
192.168.68.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
10.1.1.0        10.8.0.1        255.255.255.0   UG    0      0        0 tun0
10.9.0.0        10.8.0.1        255.255.255.0   UG    0      0        0 tun0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0
 

7.测试是否能ping通主服务器
#ping 10.8.0.1

 

二。.实现两地内网可以互相访问

深圳内网10.1.1.0   网关10.1.1.254
广州内网10.1.2.0   网关10.1.2.1

内网客户端互ping  对方内网看看
[root@lvs1 ~]# ping 10.1.1.2
PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
64 bytes from 10.1.1.2: icmp_seq=1 ttl=63 time=2.38 ms
64 bytes from 10.1.1.2: icmp_seq=2 ttl=63 time=0.632 ms
 

[root@dns ~]# ping 10.1.2.4
PING 10.1.2.4 (10.1.2.4) 56(84) bytes of data.
64 bytes from 10.1.2.4: icmp_seq=1 ttl=64 time=3.44 ms
64 bytes from 10.1.2.4: icmp_seq=2 ttl=64 time=0.530 ms