用下面的配置文件,这样就可以解决,注意最后3行配置:
client
dev tap
proto tcp
remote wolf.awolf.net 1194
ca ca.crt
keepalive 10 120
cipher AES-256-CBC
auth SHA1
auth-user-pass
verb 5
route-method exe
route-delay 2
route add 0.0.0.0 mask 0.0.0.0 192.168.27.254 metric 1
route-method exe #通过win自带的route.exe执行路由添加命令
route-delay 2 #延迟2秒后执行
route add 0.0.0.0 mask 0.0.0.0 192.168.27.254 metric 1 #添加网关为192.168.27.254且跳计数为1的默认路由
还需要注意的是,ros做服务端不支持udp连接方式和lzo压缩。
Tags:
client,
default,
default-gateway,
defaultgateway,
gateway,
openvpn,
ovpn,
profile,
push,
route,
route add,
RouterOS,
客户端,
添加,
配置文件,
默认网关 Category:
RouterOS
为了方便,我用VB重写了OpenVPN客户端,实际上就是gui版的OpenVPN,加上了一些检测机制,用于我和朋友们之间联机对战和资料共享,并重新命名为WolfLAN(单击下载客户端)。
由于OpenVPN拨入服务与内网接口同在一个桥里,因此拨入后可以直接通过DHCP获得内网IP,并且与本地LAN在同一个广播域里。目前经过测试,cs,魔兽,红警(IPX),星际,三角洲,暗黑,极品飞车,实况足球都全都成功联机。
Ros脚本:
[wolf@router_ros_330_wolf] /interface ovpn-server> export
# jun/10/2010 21:27:01 by RouterOS 3.30
# software id = QXLB-EYHG
#
/interface ovpn-server server
set auth=sha1 certificate=cert_wolf cipher=aes128 default-profile=ovpn_server
enabled=yes keepalive-timeout=60 mac-address=FE:36:F9:7F:32:0A max-mtu=\
1500 mode=ethernet netmask=24 port=1194 require-client-certificate=no
[wolf@router_ros_330_wolf] /interface ovpn-server>
[wolf@router_ros_330_wolf] /ppp profile> export
/ppp profile
add bridge=LAN change-tcp-mss=no comment="" dns-server=192.168.27.254 local-address=\
pool_master name=ovpn_server only-one=no rate-limit=512k/512k remote-address=\
pool_master use-compression=yes use-encryption=required use-vj-compression=yes \
wins-server=192.168.27.250
[wolf@router_ros_330_wolf] /ppp profile>
客户端代码:
client
dev tap
proto tcp
remote wolf.awolf.net 1194
ca ca.crt
keepalive 10 120
cipher AES-256-CBC
auth SHA1
auth-user-pass
verb 5
成功应用的ros版本为3.30 L6
需要ros 3.30 L6 的请看这里 《RouterOS 3.20 算号器 新版本 10分钟内算出指定id》
WolfLAN源码:http://www.awolf.net/content/vb/wolflan-source.html
Tags:
openvpn,
ovpn,
ros 3.30,
RouterOS,
局域网游戏,
游戏联机,
联机,
联机对战,
联机游戏 Category:
RouterOS,
Visual Basic,
网络