全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1192|回复: 7
打印 上一主题 下一主题

[Windows VPS] 入了个OVH的小鸡鸡

[复制链接]
跳转到指定楼层
1#
发表于 2017-3-24 23:21:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
买了几个IP,无奈加上就链接不了SSH。。

按照这个教程的:https://docs.ovh.com/gb/en/cloud/dedicated/network-ipaliasing/#debian-derivatives

求大佬指点。debian 8

默认为添加IP的时候是这样:

20170324232219.png (12.86 KB, 下载次数: 0)

修改配置文件为这样之后就连接不上了,按照上面的官方doc配置的:

  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. source /etc/network/interfaces.d/*

  4. # The loopback network interface
  5. auto lo
  6. iface lo inet loopback

  7. # The primary network interface

  8. auto eth0
  9. iface eth0 inet static
  10.     address 151.80.155.222
  11.     netmask 255.255.255.0
  12.     broadcast 151.80.155.255
  13.     gateway 151.80.155.254

  14. auto eth0:0
  15. iface eth0:0 inet static
  16.     address 91.134.217.39
  17.     netmask 255.255.255.255

  18. auto eth0:1
  19. iface eth0:1 inet static
  20.     address 91.134.217.102
  21.     netmask 255.255.255.255
  22.    
  23. auto eth0:2
  24. iface eth0:2 inet static
  25.     address 91.134.217.188
  26.     netmask 255.255.255.255

  27. auto eth0:3
  28. iface eth0:3 inet static
  29.     address 91.134.217.208
  30.     netmask 255.255.255.255
  31.    
  32. auto eth0:4
  33. iface eth0:4 inet static
  34.     address 91.134.217.213
  35.     netmask 255.255.255.255
  36.    
  37.     # IPFO 1
  38.     post-up /sbin/ifconfig eth0:0 91.134.217.39 netmask 255.255.255.255 broadcast 91.134.217.39
  39.     pre-down /sbin/ifconfig eth0:0 down

  40.     # IPFO 2
  41.     post-up /sbin/ifconfig eth0:1 91.134.217.102 netmask 255.255.255.255 broadcast 91.134.217.102
  42.     pre-down /sbin/ifconfig eth0:1 down
  43.    
  44.      # IPFO 3
  45.     post-up /sbin/ifconfig eth0:2 91.134.217.188 netmask 255.255.255.255 broadcast 91.134.217.188
  46.     pre-down /sbin/ifconfig eth0:2 down
  47.    
  48.     # IPFO 4
  49.     post-up /sbin/ifconfig eth0:3 91.134.217.208 netmask 255.255.255.255 broadcast 91.134.217.208
  50.     pre-down /sbin/ifconfig eth0:3 down
  51.    
  52.     # IPFO 5
  53.     post-up /sbin/ifconfig eth0:4 91.134.217.213 netmask 255.255.255.255 broadcast 91.134.217.213
  54.     pre-down /sbin/ifconfig eth0:4 down
复制代码


求指点。

小鸡默认的配置

  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. source /etc/network/interfaces.d/*

  4. # The loopback network interface
  5. auto lo
  6. iface lo inet loopback

  7. # The primary network interface
  8. auto eth0
  9. allow-hotplug eth0
  10. iface eth0 inet dhcp
复制代码
2#
 楼主| 发表于 2017-3-24 23:22:40 | 只看该作者
3#
发表于 2017-3-24 23:27:37 | 只看该作者
  1. #!/bin/bash
  2. idx=0
  3. MAINIP=1.1.1.1
  4. FAILOVERIPS="2.2.2.2 3.3.3.3"
  5. for line in $FAILOVERIPS
  6. do
  7.         line=${line/ /}
  8.         sed "s/$MAINIP/$line/" /etc/sysconfig/network-scripts/ifcfg-eth0 | sed "s/GATEWAY=.*/BROADCAST=$line/" | sed "s/eth0/eth0:$idx/" > /etc/sysconfig/network-scripts/ifcfg-eth0:$idx
  9.         ifup eth0:$idx
  10.         idx=`expr $idx + 1`
  11. done
复制代码

1.1.1.1 为主IP 2.2.2.2 3.3.3.3为添加IP,可一次性添加多个,中间加空格。
4#
 楼主| 发表于 2017-3-24 23:28:37 | 只看该作者
JtrD 发表于 2017-3-24 23:27
1.1.1.1 为主IP 2.2.2.2 3.3.3.3为添加IP,可一次性添加多个,中间加空格。

大佬 这怎么用,。。。? 纯小白。
5#
发表于 2017-3-24 23:31:56 | 只看该作者
WordPress迷 发表于 2017-3-24 23:28
大佬 这怎么用,。。。? 纯小白。

新建一个类似123.sh 的文件,把上述代码复制进去,修改为自己的ip,给执行权限,执行。
6#
 楼主| 发表于 2017-3-24 23:35:21 | 只看该作者
JtrD 发表于 2017-3-24 23:31
新建一个类似123.sh 的文件,把上述代码复制进去,修改为自己的ip,给执行权限,执行。 ...

我是大便系统。。。
7#
发表于 2017-3-24 23:52:23 | 只看该作者
本帖最后由 JtrD 于 2017-3-24 23:53 编辑

dabian没玩过,思路是创建ifcfg-eth0:0 ifcfg-eth0:1

或者参考下http://www.lilynana.eu.org/thread-339818-1-1.html,看看有没帮助。
8#
 楼主| 发表于 2017-3-25 00:24:31 | 只看该作者
JtrD 发表于 2017-3-24 23:52
dabian没玩过,思路是创建ifcfg-eth0:0 ifcfg-eth0:1

或者参考下http://www.lilynana.eu.org/thread-339818-1- ...

谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-10-31 00:14 , Processed in 0.071140 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表