Add ipv6 address for buyvm™ VPS and Scan all ports by Nmap to prepare more for network attacks with special purpose
本文最后更新于 119 天前,其中的信息可能已经有所发展或是发生改变。
  1. Obtain the IP address according to the reverse resolution of the domain name, conduct a simple analysis of the network structure according to the mtr command, obtain the open ports through the Nmap global port scan, and find the available ports.
  2. Add ipv6 addresses to hosts under buyvm to support IPv6 access. For Ubuntu 22.04, vim /etc/network/infaces does not seem to be able to add the ipv6 public network address, and the address is added through vim /etc/netplan. Enter the editing mode by typing “i”. After modifying the content, type “ESC” to enter the command line mode and enter “:wq” to save and exit.

END

——————————————————————————————

The following content is reproduced content; please respect the copyright of the copyright owner:

https://cyp0633.icu/archives/1244
Record to add IPv6 address for Ubuntu 20.04

https://web.archive.org/web/20220531083537/https://cyp0633.icu/archives/1244


This article takes BuyVM’s VPS with Ubuntu 20.04.3 as an example, hoping to prevent more people from stepping on the pit or even encountering server disconnection.

Especially for VPS users who are not BuyVM, the situation is not necessarily the same. It is recommended to also refer to the references in bold below.

Assign IPv6 address
BuyVM’s VPS itself does not have IPv6, only one IPv4.

To assign an IPv6 address, click Assign IPv6 Address in the Stallion Administration Interface – Virtual Services-Networking-IPv6.

You can choose one randomly or specify an IP address within a range. Click Add IPv6 Address, and you’re done.

Don’t close Stallion just yet, and wait for the next step.

Edit Netplan settings
Most of the tutorials found on the Internet are the methods used by older versions of Ubuntu, and Ubuntu 20.04.3 has started to use Netplan.

Connect to the server using SSH. If you are worried that the connection will be lost due to improper operation, you can directly use the VNC connection, as described in the next chapter.

Netplan’s default configuration file is in /etc/netplan, and there should be a YAML file in it, its configuration file.

Open this file with your favorite code editor (Vim, Nano, whatever), and you will see a form configuration file below. Some differences can be ignored.

Add-ipv6-address-for-buyvm-VPS.png

Click on the IPv4 tab from Stallion‘s previous page, then find the settings icon in the Normal item under the IPv4 addresses below. Click it, and then click Network Settings.

This IP Address is your IPv4 address, and Gateway is the IPv4 gateway. Replace them with the above modifications. If your Netmask is also 255.255.255.0, then / 24 does not need to be changed. They have the same meaning, just a mutual conversion between Netmask and Bitmask. The former is the idiom of IPv4, and the latter is the expression of IPv6. Netplan uses the latter uniformly.

In addition, Frantech’s official website also has instructions for Gateways in certain locations.

In the same way, enter the IPv6 address settings you just assigned and replace IP Address and Gateway with the corresponding values. The value of Bitmask is replaced with the value of Netmask/Bitmask on the web page, usually 48.

Save the configuration file, use the command sudo netplan to try to check the configuration file automatically, and press Enter to continue if it seems to be OK. Then use sudo netplan apply to apply the changes.

Check network connection
After a short period of time, use the networkctl status eth0 command to view the eth0 port status. In addition to checking the Address information for errors, the most important thing is State. If it’s green routable (configured), then everything is fine. Otherwise, degraded means that the public network may not be connected, and if No Route to Host is displayed in the log below, it may mean that the Gateway is set incorrectly.

After this, you can use ping6 google.com to test the network connection under IPv6. You can also use another device to ping the IPv6 address you just assigned. If it doesn’t prompt Network Unreachable, then everything is fine.

If your server has been disconnected due to this
You can always trust VNC. Click Direct VNC Connection in the Console at the top right of Stallion, and then enter the username and password that popped up on the web page on your VNC client (the officially recommended TightVNC is good) Viewer, and you can connect to the server.

References

https://hostloc.com/thread-745390-1-1.html
https://oldtang.com/2314.html
https://developer.aliyun.com/article/744737
https://askubuntu.com/questions/328265/trying-to-enable-ipv6-results-in-a-no-route-to-host-error
https://zhuanlan.zhihu.com/p/46544606

在课堂做的一些事情

1.根据域名反向解析获取IP地址,根据mtr 命令对网络结构进行简单分析,通过nmap全局端口扫描获取开放端口,寻找可以利用的端口。

2.对buyvm 旗下主机添加ipv6 地址实现对IPv6访问的支持。对于Ubuntu 22.04 vim /etc/network/infaces 似乎添加不了ipv6 公网地址,通过 vim /etc/netplan 实现的添加地址。通过键入“i” 实现进入编辑模式,修改好内容之后,键入“esc” 进入命令行模式,输入”:wq” 保存退出。

——————————————————————————————

以下内容为转载内容,请尊重版权所有者版权

https://cyp0633.icu/archives/1244

https://web.archive.org/web/20220531083537/https://cyp0633.icu/archives/1244

本文以 BuyVM 装有 Ubuntu 20.04.3 的 VPS 为例,希望能够避免更多人踩坑甚至遭遇服务器失联。

尤其对于并不是 BuyVM 的 VPS 用户来说,情况不一定相同,建议同时参照下面加粗的参考文献研究。

分配 IPv6 地址
BuyVM 的 VPS 本身不带 IPv6,仅有一个 IPv4。

要分配一个 IPv6 地址,在 Stallion 管理界面 – Virtual Services-Networking-IPv6 内点击 Assign IPv6 Address。

你可以随机选择一个,也可以在范围内指定一个 IP 地址。点击 Add IPv6 Address,就可以了。

暂时不要关闭 Stallion,等待下一步操作。

编辑 Netplan 设置
网络上搜到的教程大多是旧版 Ubuntu 所使用的方法,而 Ubuntu 20.04.3 已经开始使用 Netplan。

使用 SSH 连接到服务器。如果你担心因操作不当而失联,可以直接使用 VNC 连接,方法见下章。

Netplan 的默认配置文件处于 /etc/netplan 中,里面应该有一个 YAML 文件,即其配置文件。

使用你喜欢的代码编辑器(Vim,Nano,whatever)打开此文件,你将看到如下形式的配置文件。有些许差异可以忽略。

Add-ipv6-address-for-buyvm-VPS.png

从 Stallion 刚刚的页面中点击 IPv4 选项卡,然后在下方的 IPv4 addresses 中的 Normal 项找到设置图标。点击它,再点击 Network Settings。

这个 IP Address 就是你的 IPv4 地址,Gateway 就是 IPv4 网关,分别将其替换入上面的修改内容。如果你的 Netmask 也是 255.255.255.0,那么 / 24 就不需要变动,它们的意义相同,只是一个 Netmask 和 Bitmask 的相互转换,前者是 IPv4 惯用表述,后者则是 IPv6 的表述。Netplan 统一用后者。

另外,对于某几个地点的 Gateway,Frantech 官网也有说明。

同理,进入刚刚你分配的 IPv6 地址设置中,替换 IP Address 和 Gateway 为对应的值。Bitmask 的值则替换为网页上 Netmask/Bitmask 的值,一般为 48。

保存配置文件,使用命令 sudo netplan try 可以自动检查配置文件,如果看起来没有问题的话就可以按回车继续了。然后使用 sudo netplan apply 来应用更改。

检查网络连接
一小段时间之后,使用 networkctl status eth0 命令查看 eth0 端口情况。除了查看 Address 信息有没有错误之外,最重要的是 State。如果是绿色的 routable (configured),那么一切正常。否则,degraded 表示可能没有连接公网,而若下方 log 中提示 No Route to Host 则可能代表 Gateway 设置错误。

这之后,可以使用 ping6 google.com 测试一下 IPv6 下的网络连接。也可以用其他设备 Ping 你刚刚分配的 IPv6 地址。如果都不会提示 Network Unreachable,那么就万事大吉了。

如果你的服务器已经因此失联
你永远可以相信 VNC。在 Stallion 右上方的 Console 内点击 Direct VNC Connection,然后在你的 VNC 客户端(官方推荐的 TightVNC 就不错)Viewer 上输入网页中弹出的用户名和密码,就可以连接到服务器了。

参考文献

https://hostloc.com/thread-745390-1-1.html
https://oldtang.com/2314.html
https://developer.aliyun.com/article/744737
https://askubuntu.com/questions/328265/trying-to-enable-ipv6-results-in-a-no-route-to-host-error
https://zhuanlan.zhihu.com/p/46544606

No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next