请教一个服务器 IP 和路由的配置问题 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
miemie666
V2EX    云计算

请教一个服务器 IP 和路由的配置问题

  •  
  •   miemie666 2022-04-29 11:25:16 +08:00 4199 次点击
    这是一个创建于 1275 天前的主题,其中的信息可能已经有所发展或是发生改变。

    买了台 clouvider 的独服,主 IP 是 10.10.201.3 ,网关是 10.10.201.1 ,配了一个 /29 的 IPv4 段:10.12.20.96-103 ,商家说这个子网已经已经直接路由给了主 IP ,不需要提供额外的网关。请教一下 Ubuntu18.04 下如何配置呢?

    8 条回复    2022-04-29 17:49:48 +08:00
    codefever
        1
    codefever  
       2022-04-29 11:31:56 +08:00
    查看 Ubuntu 系统的版本和网络配置文件目录
    cat /etc/issue 或者 lsb_release -a
    Ubuntu18.04.5 版本下的配置文件名:
    Ubuntu 18.04.5 LTS
    配置写在 /etc/netplan/ 01-network-manager-all.yaml 或者类似名称的 yaml 文件里

    使用 NetworkManager 配置网络
    点击配置按钮
    输入 IP 地址和子网掩码,Apply
    然后测试一下
    joshu
        2
    joshu  
       2022-04-29 12:21:24 +08:00
    随意配置
    不过一般情况下额外的网段是给里分配给其它小鸡(当然作为 vpn 网段或内部其它机器使用的网段也 ok )
    如果你一定要在买的这台机器上用,可以配置到 VRF 里面,也可以直接填到配置里,填写 IP 地址为 10.12.20.96/32 ,网关不用变,不影响 ARP 的,即使你没有配主 IP 也没啥关系
    miemie666
        3
    miemie666  
    OP
       2022-04-29 13:14:08 +08:00
    @joshu 我想直接配置在这台机器,按照你的方法直接在原网卡上添加 IP ,但是不生效,ping 测试:
    来自 10.12.20.94 的回复: TTL 传输中过期。
    cnleon
        4
    cnleon  
       2022-04-29 13:56:43 +08:00
    发下 trace 看看
    miemie666
        5
    miemie666  
    OP
       2022-04-29 15:20:58 +08:00
    @cnleon
    目标 IP: <a href="xxx.188.96">xxx.188.96</a>

    1 6.6.3.1 0 ms 0 ms 0 ms
    2 100.127.248.1 2 ms 2 ms 2 ms 共享地址 AS139072
    3 121.8.194.217 8 ms 9 ms 10 ms 中国 广东 广州 chinatelecom.com.cn 电信 AS4134
    4 59.37.176.149 5 ms 6 ms 9 ms 中国 广东 佛山 chinatelecom.com.cn 电信 AS4134 149.176.37.59.broad.dg.gd.dynamic.163data.com.cn
    5 59.43.70.5 4 ms 7 ms 12 ms 中国 广东 广州 chinatelecom.com.cn 电信 *
    6 59.43.130.158 5 ms * * 中国 广东 广州 chinatelecom.com.cn 电信 *
    7 59.43.187.122 5 ms 5 ms 5 ms 中国 广东 广州 chinatelecom.com.cn 电信 *
    8 59.43.184.126 163 ms 163 ms 163 ms 英国 伦敦 chinatelecom.com.cn 电信 *
    9 80.239.193.225 163 ms 164 ms 173 ms 英国 伦敦 telia.com AS1299 ldn-b2-link.ip.twelve99.net
    10 * * * *
    11 62.115.122.181 163 ms 163 ms 164 ms 英国 伦敦 telia.com AS1299 ldn-b3-link.ip.twelve99.net
    12 62.115.154.43 163 ms 164 ms 164 ms 英国 伦敦 telia.com AS1299 clouvider-ic337427-ldn-b3.ip.twelve99-cust.net
    13 xxx.188.95 180 ms 190 ms 475 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    14 xxx.188.94 163 ms 163 ms 210 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    15 xxx.188.95 188 ms 191 ms 213 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    16 xxx.188.94 164 ms 165 ms 209 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    17 xxx.188.95 176 ms 177 ms 178 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    18 xxx.188.94 163 ms 164 ms 164 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    19 xxx.188.95 187 ms 191 ms 193 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    20 xxx.188.94 163 ms 163 ms 166 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    21 xxx.188.95 194 ms 203 ms 241 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    22 xxx.188.94 163 ms 163 ms 164 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    23 xxx.188.95 196 ms 204 ms 292 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    24 xxx.188.94 163 ms 164 ms 164 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    25 xxx.188.95 178 ms 181 ms 193 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    26 xxx.188.94 163 ms 163 ms 164 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    27 xxx.188.95 181 ms 184 ms 186 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    28 xxx.188.94 163 ms 163 ms 164 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    29 xxx.188.95 182 ms 183 ms 258 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-95.reverse.clouvider.net
    30 xxx.188.94 164 ms 164 ms 164 ms 英国 伦敦 clouvider.com AS62240 hxxx-xxx-188-94.reverse.clouvider.net
    FabricPath
        6
    FabricPath  
       2022-04-29 17:44:55 +08:00
    ip route get 1.1.1.1
    看 src ip 就是你 default 路由指定的 IP ,如果不指定,那就用这个 IP 。要想把多个 IP 用起来,除了 IP 配在接口上,还需要应用程序显式指定源 IP
    FabricPath
        7
    FabricPath  
       2022-04-29 17:47:08 +08:00
    @FabricPath 是我看错了,你这个无法被访问,就是商家物理网络配置的问题
    miemie666
        8
    miemie666  
    OP
       2022-04-29 17:49:48 +08:00
    @FabricPath 是商家配置问题,已经发工单处理好了,谢谢大家
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     865 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 25ms UTC 22:40 PVG 06:40 LAX 15:40 JFK 18:40
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86