V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
doyel
V2EX  ›  云计算

阿里云的 Centos ECS 主机如果只需要对 SLB 开放请求端口该怎么设置 iptables 规则啊?

  •  
  •   doyel · 2016-06-02 15:33:46 +08:00 · 2999 次点击
    这是一个创建于 2889 天前的主题,其中的信息可能已经有所发展或是发生改变。

    都搭完应用服务器了突然冒出来这茬。。。一脸懵逼啊。。。。

    7 条回复    2016-06-04 09:32:41 +08:00
    Austing
        1
    Austing  
       2016-06-02 15:51:21 +08:00   ❤️ 1
    iptables -A INPUT -p [protocol] --dport [port] -j DROP
    iptables -A INPUT -s 100.64.0.0/10 -p [protocol] --dport [port] -j ACCEPT
    doyel
        2
    doyel  
    OP
       2016-06-02 17:37:27 +08:00
    @Austing 我拿 SLB 来转发 ECS 服务器上的 MYSQL Proxy 服务,转发 /监控 TCP 3306 貌似不行啊。。。但是在客户端访问那台 ECS 的 3306 是能正常访问的。。。
    tinyproxy
        3
    tinyproxy  
       2016-06-02 21:23:33 +08:00 via iPhone
    阿里云有安全组,你看起来对 IPtable 不熟,一不小心就把自己 ssh 干点了。把外网连接全 ban 了,内网开你要转发的端口就好了
    Austing
        4
    Austing  
       2016-06-02 23:00:16 +08:00   ❤️ 1
    @doyel 你看看你的 MYSQL 監聽是否正常?阿里雲經典網絡內外網是兩個網卡內網可能沒有監聽上,或者 iptables 先全開放看看能不能轉發,然後再看是不是有其他限制什麼的?
    doyel
        5
    doyel  
    OP
       2016-06-03 01:46:03 +08:00 via iPhone
    @Austing 搞定了,就是监控进程刷我的服务, mysql 代理就报错......服务都正常了
    lslqtz
        6
    lslqtz  
       2016-06-03 03:24:42 +08:00
    @tinyproxy 阿里云只要不是把系统干死就没事,反正有 vnc 。
    realpg
        7
    realpg  
       2016-06-04 09:32:41 +08:00
    用啥 iptables ,用控制台的安全组
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2258 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 05:50 · PVG 13:50 · LAX 22:50 · JFK 01:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.