在电信和网通之间做vpn桥
Idc(电信机房)-----办.公室-.----cnc(网通机房)电脑
IDC(电信):
Eth0: 22.2.77.A.72(公ip) 女人
Et.h1:10.59.96.72(内ip).
[r.oot.@idc]cat start_gre.sh 女人
#!/bin/bash
modprobe ip_.gre 女人
ip tunnel add netb m.ode gre remo.te 218.66.B.45 local 222.77.A.72 ttl 255电影
ip link set netb up. 乙肝
ip. addr add 10.59.96..72 dev netb 杀毒
ip route add 10.5.0.0/16.. dev netb健康
ip rou.te add 10.59.97.0/24 dev .netb服务器
[root@.idc]cat s.top_gre.sh学习
#!/bin/bash
ip li.nk set netb down投资
ip tunne.l del netb 乙肝
IDC2CNC(办公室):
Eth0:1.0.5.17.101/24 (内ip).
Eth1:218.66.B.45 (电信ip.).
Eth2:220.C.22.2 (网通i.p) 鲜花
[root@idc2cnet ~]#. cat /etc/sysconfig/net.work 女人
NETWORKING=yes
HOSTNA.ME.=idc2cnet.mydomain.com.
GATEWAY=21.8.66.B.60.
[root@idc2cnet ~]# cat . /etc/rc.l.ocal 汽车
route add -ne.t X.22.96.34 netmask 255.255.255.255 gw 220..C.22.1.
[ro.ot@idc2cnet ~]#cat s.tart_idc.sh.
#!/bin/bash
modp.robe ip_gre 汽车
ip tunnel add neta mo.de gre remote 222.77.A.72 local 218.66.B.45. ttl 255<性病>
ip link se.t neta up电脑
ip addr add 1.0.5.17.101 dev net.a 乙肝
i.p route add 10.59.96.0/24 dev. neta--------------彩票
[
root@i.dc2cnet ~]#c.at stop_idc.sh电脑
#!/bin/bash
ip link set neta do.wn( 游戏 )
ip t.unnel del neta服务器
[.root@idc2cnet ~]#cat start_cnc.s.h电脑
#!/bin/bash
modprob.e ip_gre
ip tunnel add cnc mode gre remote X.22.96.34 local. 220.C.2.2.2 ttl 255投资
ip link. set cnc up虚拟主机
ip addr add 10..5.17.101 dev cn.c( 游戏 )
ip route add 10..59.97.0/24 .dev cnc 建材
[root@idc2cnet ~.]#cat stop._cnc.sh学习
#!/bin/bash
ip link set cnc .down(广告)
ip .tunnel del cnc 鲜花
CNC(网通):
Et.h0: X.22.96.34(公ip)学习
Eth1: 10.59.97.25.4(内ip)健康
[root@cnet bin]#cat start_c..nc.sh教育
#!/bin/bash
modprobe .ip_gre 健康
ip tunnel a.dd cnc mode gre remote 220.C.22.2 local X.22.96.34 ttl. 255 乙肝
ip link set cn.c up<性病>
ip addr a.dd 10.59.97.254. dev cnc电脑
ip route add. 10.59.96.0./24 dev cnc 杀毒
ip route add 10.5.0.0/16.. dev cnc 外汇
[root@cnet b.in]#cat stop_cnc..sh 乙肝
#!/bin/bash
ip li.nk set cnc down健康
ip tunnel .del cnc虚拟主机
备注:
注意iptab.les都要.关掉,怕不安全的话,可只起ssh服务 女人
转发.都.要开net.ipv4.ip_forward = 1.