乐云主机笔记

  • 首页
  • 学习记录
  • 资源下载
  • 新手教程
  • 其他
  • 脚本源码
  • 自用主机
  • 主机优惠
  • 域名优惠
  • 网赚项目

  1. 首页
  2. 学习记录
  3. 正文

为hostigation的Debian VPS 增加多个IP地址的方法,亲测有效

2017年 9月 10日 2103点热度 0人点赞 0条评论

如果你的VPS或独立服务器,可以申请到新IP,但又没有自动添加上去,需要你手动添加,可以看这里。

下面是永久添加方案,编辑 vi /etc/network/interfaces 添加上你的新IP,假设你原有IP为11.11.11.11,需要添加 22.22.22.22 和 33.33.33.33 IP,按以下样例修改:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 11.11.11.11
netmask 255.255.254.0
gateway 11.11.11.1

auto eth0:0
iface eth0:0 inet static
address 22.22.22.22
netmask 255.255.254.0

auto eth0:1
iface eth0:1 inet static
address 33.33.33.33
netmask 255.255.254.0

dns-nameservers 8.8.8.8 8.8.4.4

其中网关gateway,可以通过以下任意指令获得

1、route -n

2、ip route show

3、traceroute www.prudentwoo.com -s 100 【第一行就是自己的网关】

4、netstat -r

5、more /etc/network/interfaces 【Debian/Ubuntu Linux】

Note: eth0:0 及后面的网关不用修改,也只需要原来的那一组,需要添加 eth0:0 , eth0:1 , eth0:X 一直下去。

修改之后,用命令/etc/init.d/networking restart 重启网络,但这样新IP还不能用,还需要将新IP上线,命令: ifup eth0:0 有多个IP,就 ifup eth0:1 ifup eth0:2 ifup eth0:3 …… 都上线。
大功告成!

Note: 对应的下线命令是 ifdown eth0:X (X改成对应的数字,这里就不重复了)

标签: 暂无
最后更新:2017年 9月 10日

wangzhe12588

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

归档

  • 2025 年 5 月
  • 2025 年 4 月
  • 2025 年 3 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 11 月
  • 2024 年 10 月
  • 2024 年 9 月
  • 2024 年 7 月
  • 2024 年 3 月
  • 2024 年 2 月
  • 2024 年 1 月
  • 2023 年 12 月
  • 2023 年 11 月
  • 2023 年 10 月
  • 2023 年 9 月
  • 2023 年 8 月
  • 2023 年 7 月
  • 2023 年 6 月
  • 2023 年 5 月
  • 2023 年 4 月
  • 2023 年 3 月
  • 2023 年 2 月
  • 2023 年 1 月
  • 2022 年 12 月
  • 2022 年 11 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 8 月
  • 2022 年 7 月
  • 2022 年 6 月
  • 2022 年 5 月
  • 2022 年 4 月
  • 2022 年 3 月
  • 2022 年 2 月
  • 2022 年 1 月
  • 2021 年 12 月
  • 2021 年 11 月
  • 2021 年 10 月
  • 2021 年 9 月
  • 2021 年 8 月
  • 2021 年 7 月
  • 2021 年 6 月
  • 2021 年 5 月
  • 2021 年 4 月
  • 2021 年 3 月
  • 2021 年 2 月
  • 2021 年 1 月
  • 2020 年 12 月
  • 2020 年 11 月
  • 2020 年 10 月
  • 2020 年 9 月
  • 2020 年 8 月
  • 2020 年 7 月
  • 2020 年 6 月
  • 2020 年 5 月
  • 2020 年 4 月
  • 2020 年 3 月
  • 2020 年 2 月
  • 2020 年 1 月
  • 2019 年 12 月
  • 2019 年 11 月
  • 2019 年 10 月
  • 2019 年 9 月
  • 2019 年 8 月
  • 2019 年 7 月
  • 2019 年 6 月
  • 2019 年 5 月
  • 2019 年 4 月
  • 2019 年 3 月
  • 2019 年 2 月
  • 2019 年 1 月
  • 2018 年 12 月
  • 2018 年 11 月
  • 2018 年 10 月
  • 2018 年 9 月
  • 2018 年 8 月
  • 2018 年 7 月
  • 2018 年 6 月
  • 2018 年 5 月
  • 2018 年 4 月
  • 2018 年 3 月
  • 2018 年 2 月
  • 2017 年 12 月
  • 2017 年 11 月
  • 2017 年 10 月
  • 2017 年 9 月
  • 2017 年 8 月
  • 2017 年 7 月

分类

  • 主机优惠
  • 其他
  • 域名优惠
  • 学习记录
  • 新手教程
  • 网赚项目
  • 脚本源码
  • 自用主机
  • 资源下载

COPYRIGHT © 2021 Letcloud.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

粤ICP备15031609号-3