V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
t1anea
V2EX  ›  Linux

新人关于 iptables 转发问题

  •  
  •   t1anea · 2017-02-09 15:20:20 +08:00 · 1807 次点击
    这是一个创建于 2630 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我想自己制作一个游戏加速器来实现美服游戏加速的效果

    各种 VPS 都无法满意情况下 别人给我说了一个方法即

    本地网络---国内中转服务器---( GPN )----美国服务器---游戏服务器

    通过国内中转服务器和美国服务器组成 GPN 专线 来实现中国到美国这一条线路稳定不掉包

    之后在美国架设 SS 直接连接国内中转服务器

    在成功组件了 GPN 网络之后,在 CENTOS 7 X64 系统下 我无法保存我配置的 iptables 转发规则。

    注:本人( LINUX 菜鸡)没有学习过相关知识,只会通过百度搜索到的命令进行操作。一旦出现问题百度搜不到的就卡主无法进行下一步。

    所以我想请教一下

    我想问我要玩美服加速通过上述方案是否可以解决掉包的问题,延迟没所谓。

    可以有人可以指导我一下 iptables 转发吗。

    4 条回复    2017-02-11 17:41:10 +08:00
    dawncold
        1
    dawncold  
       2017-02-09 22:55:42 +08:00
    建议这种情况下,用 google 代替百度,别的就没有问题了。
    t1anea
        2
    t1anea  
    OP
       2017-02-11 14:40:47 +08:00
    @dawncold 感谢你的回复
    t1anea
        3
    t1anea  
    OP
       2017-02-11 15:38:31 +08:00
    劳烦可以搞定的大神留个联系方式 感谢
    t1anea
        4
    t1anea  
    OP
       2017-02-11 17:41:10 +08:00
    root@localhost:~# iptables -nvL -t nat
    Chain PREROUTING (policy ACCEPT 91 packets, 5923 bytes)
    pkts bytes target prot opt in out source destination
    24 1216 DNAT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:8989 to:192.168.2.15:8989
    0 0 DNAT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:8989 to:192.168.2.15:8989

    Chain INPUT (policy ACCEPT 91 packets, 5923 bytes)
    pkts bytes target prot opt in out source destination

    Chain OUTPUT (policy ACCEPT 15 packets, 1084 bytes)
    pkts bytes target prot opt in out source destination

    Chain POSTROUTING (policy ACCEPT 15 packets, 1084 bytes)
    pkts bytes target prot opt in out source destination
    0 0 SNAT tcp -- * * 0.0.0.0/0 192.168.2.15 tcp dpt:8989 to:192.168.2.20
    0 0 SNAT udp -- * * 0.0.0.0/0 192.168.2.15 udp dpt:8989 to:192.168.2.20

    192.168.2.15 是美国的 GPN IP
    192.168.2.20 是北京的 GPN IP
    请问以上 iptable 转发规则规则是否生效?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1122 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:37 · PVG 02:37 · LAX 11:37 · JFK 14:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.