V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
idragonet
V2EX  ›  宽带症候群

请教下: K2P 刷老毛子后如何做中转机?

  •  
  •   idragonet · 2023-04-15 15:22:23 +08:00 · 2010 次点击
    这是一个创建于 378 天前的主题,其中的信息可能已经有所发展或是发生改变。

    需求:自己家的 K2P (有公网 IP+已经刷最新老子+DDNS 搞定)希望:把 9000 端口做 TCP/UDP 转发到 Oracle VPS:168.138.1.1:443 上。 也就是:等于路由器做中转机,因为公司电信出海太慢,家里联通快(联通出海轻轻松松 150-200M )

    24 条回复    2023-04-18 08:59:48 +08:00
    jiangzm
        1
    jiangzm  
       2023-04-15 16:31:58 +08:00
    K2P 操作系统中的 XP
    linhu66
        2
    linhu66  
       2023-04-15 16:36:53 +08:00
    坐标:上海,电信出海轻轻松松 2000M
    titanium98118
        3
    titanium98118  
       2023-04-15 16:56:19 +08:00 via Android
    socat
    109653VIP
        4
    109653VIP  
       2023-04-15 17:12:51 +08:00 via Android
    n2n
    ghjexxka
        5
    ghjexxka  
       2023-04-15 17:54:52 +08:00 via Android
    路由器防火墙自带端口转发功能
    xctcc
        6
    xctcc  
       2023-04-15 18:12:03 +08:00
    上行够吗,我 500M 联通上行 30M ,有公网 ip ,在公司连接家里速度也是 30M
    xctcc
        7
    xctcc  
       2023-04-15 18:14:41 +08:00
    而且说起这个就无语,之前我是 200M 上下行对等的(不知道是 bug 还是本来就是这样),被客户经理一个电话说可以免费升级 500M 就同意了,然后过了很久才发现上行变 30M 了,因为平时基本没注意上行,投诉无门,建议有电话免费升级的宽带的时候问一下上行多少
    idragonet
        8
    idragonet  
    OP
       2023-04-15 18:20:49 +08:00
    @xctcc #6 我也是联通 1000M 下行,70 上行, 自己一个人 70M 够了,现在是公司电信出海是通过家里笔记本电脑中转,缺点是要长期开着笔记本。
    xctcc
        9
    xctcc  
       2023-04-15 18:24:16 +08:00
    @idragonet 买个 n1 刷个 openwrt 或者 armbian 把中转搭在上面,功耗也不高
    idragonet
        10
    idragonet  
    OP
       2023-04-15 18:29:46 +08:00
    @xctcc #9 嗯,先把吃灰的 K3 刷 openwrt 试试
    aydd2004
        11
    aydd2004  
       2023-04-15 19:49:24 +08:00
    我也是 K2P 刷了 openWRT 。

    上网都设置不明白,擦。
    bibiisme
        12
    bibiisme  
       2023-04-15 19:57:34 +08:00
    iptables 就行了,根本不用其他系统或者设备

    iptables -t nat -A PREROUTING --dport 9000 -j DNAT --to-destination 168.138.1.1:443
    bibiisme
        13
    bibiisme  
       2023-04-15 19:58:27 +08:00   ❤️ 1
    iptables -t nat -A PREROUTING -p tcp --dport 9000 -j DNAT --to-destination 168.138.1.1:443
    iptables -t nat -A PREROUTING -p udp --dport 9000 -j DNAT --to-destination 168.138.1.1:443
    idragonet
        14
    idragonet  
    OP
       2023-04-15 20:35:07 +08:00
    @bibiisme #13
    请教下:在路由器“在防火墙规则启动后执行:”加入以下脚本,在局域网电脑可以正常范围 9000 中转( xray 测试 OK ),可是在外网的电脑发现无法中转的,而且在外网检测端口发现 9000 页没开的。


    iptables -t nat -A PREROUTING -p tcp --dport 9000 -j DNAT --to-destination 168.138.1.1:443
    iptables -t nat -A PREROUTING -p udp --dport 9000 -j DNAT --to-destination 168.138.1.1:443
    iptables -A INPUT -p tcp --dport 9000 -j ACCEPT
    iptables -A OUTPUT -p tcp --dport 9000 -j ACCEPT
    iptables -A OUTPUT -p udp --dport 9000 -j ACCEPT
    iptables -A OUTPUT -p udp --dport 9000 -j ACCEPT
    bibiisme
        15
    bibiisme  
       2023-04-15 20:43:14 +08:00
    @idragonet iptables -A INPUT -p udp --dport 9000 -j ACCEPT

    udp 没写? input 应该就够了吧
    idragonet
        16
    idragonet  
    OP
       2023-04-15 20:54:24 +08:00
    @bibiisme #15 iptables -A INPUT -p tcp --dport 9000 -j ACCEPT
    iptables -A INPUT -p udp --dport 9000 -j ACCEPT
    iptables -A OUTPUT -p udp --dport 9000 -j ACCEPT
    iptables -A OUTPUT -p udp --dport 9000 -j ACCEPT

    问题依旧,还是外网的电脑无法访问 9000 端口,在线网页测试也是 9000 端口关闭的。
    cwbsw
        17
    cwbsw  
       2023-04-15 21:26:57 +08:00
    @idragonet
    filter 表的接受应该是在 FORWARD 上的。
    idragonet
        18
    idragonet  
    OP
       2023-04-15 22:12:02 +08:00
    @cwbsw #17 什么意思?个人水平有限
    cwbsw
        19
    cwbsw  
       2023-04-15 22:29:09 +08:00
    @idragonet
    iptables -t nat -I PREROUTING -p tcp --dport 9000 -j DNAT --to-destination 168.138.1.1:443
    iptables -t nat -I PREROUTING -p udp --dport 9000 -j DNAT --to-destination 168.138.1.1:443
    iptables -I FORWARD -p tcp --dport 9000 -j ACCEPT
    iptables -I FORWARD -p udp --dport 9000 -j ACCEPT
    Mandy0
        20
    Mandy0  
       2023-04-16 02:03:29 +08:00 via Android
    有风险,我朋友之前买了个韩国的 VPS ,映射到国内老家里的服务器做的中转,也是家庭宽带,DDNS 映射,被联通扫到了,幸好只是警告了一下,具体咋建的他没和我说,他应该是在家里建了一个 v2ray 的服务端,就我们几个人用,不得不说是真滴爽。
    idragonet
        21
    idragonet  
    OP
       2023-04-16 12:10:42 +08:00
    @Mandy0 #20 谢谢告知。
    bibiisme
        22
    bibiisme  
       2023-04-16 12:40:07 +08:00
    @idragonet 理论上是这样,实在不行 padavan web 界面里端口转发加个 xx 端口转发到路由器自身 9000 端口的规则,然后自己连 xx 端口
    letmefly
        23
    letmefly  
       2023-04-18 07:26:28 +08:00
    楼主莫非是公司的老板?家里的路由器做中转给公司用,出了事不算你的吗?
    idragonet
        24
    idragonet  
    OP
       2023-04-18 08:59:48 +08:00
    @letmefly #23 打工的,自己用。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   917 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:30 · PVG 06:30 · LAX 15:30 · JFK 18:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.