linux测试ipv6

简介: linux测试ipv6

前言

  • 操作系统版本:centos 7.6
  • curl版本:7.87(centos 7自带的curl版本是7.29,测ipv6会有问题

系统开启ipv6

centos 7默认开启 ipv6,可检查net.ipv6.conf.all.disable_ipv6net.ipv6.conf.default.disable_ipv6的值是否为 0。如果不是,可修改/etc/sysctl.conf文件。

sysctl -a | grep net.ipv6.conf.all.disable_ipv6
sysctl -a | grep net.ipv6.conf.default.disable_ipv6

执行 ip aifconfig 可查看网卡的ipv6地址,假设网卡名为 ens192

ifconfig ens192 | grep inet6 | awk '{print $2}'

更新curl

如果操作系统版本为CentOS 7,其自带的curl版本 7.29较低,建议更新curl,高版本curl可略过。

  1. 从github下载新版的curl,centos 7测试7.87版本可用。GitHub - curl - release
  2. 备份原来的curl
mv /usr/bin/curl{,-bak}
  1. 将新版的curl文件放到/usr/bin目录下,授予可执行权限
  2. 测试
curl -V

测试ipv6

# ping测试,-I 指定网卡名
ping6 -c 4 -I ens192 fe80::1c33:4e53:ebfc:707f
# telnet测试,测试80端口,百分号后接网卡名
telnet -6 fe80::20c:29ff:fead:6a6b%ens192 80
# curl测试,-6表示指定IPv6,-g 解析中括号,--interface 指定网卡名
curl -6 -g --interface ens192 "http://[fe80::20c:29ff:fead:6a6b]:80"

nginx配置监听ipv6地址

server {
    listen 80;
    listen [::]:80;
  # ...
}
相关文章
|
7月前
|
Linux Shell
linux自动崩溃,模拟测试
该脚本创建一个 systemd 服务和定时器,在系统启动3分钟后触发崩溃。通过向 /proc/sysrq-trigger 写入 "c" 来实现内核崩溃,用于测试系统崩溃后的恢复机制。
167 4
|
4月前
|
SQL 安全 Linux
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
236 1
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
|
4月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
310 1
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
|
5月前
|
安全 Linux 网络安全
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
386 2
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
|
5月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
459 1
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
|
6月前
|
运维 Linux 开发者
Linux系统中使用Python的ping3库进行网络连通性测试
以上步骤展示了如何利用 Python 的 `ping3` 库来检测网络连通性,并且提供了基本错误处理方法以确保程序能够优雅地处理各种意外情形。通过简洁明快、易读易懂、实操性强等特点使得该方法非常适合开发者或系统管理员快速集成至自动化工具链之内进行日常运维任务之需求满足。
406 18
|
5月前
|
安全 Linux 网络安全
Metasploit Framework 6.4.88 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.88 (macOS, Linux, Windows) - 开源渗透测试框架
601 0
|
5月前
|
存储 安全 Linux
Kali Linux 2025.3 发布 (Vagrant & Nexmon) - 领先的渗透测试发行版
Kali Linux 2025.3 发布 (Vagrant & Nexmon) - 领先的渗透测试发行版
689 0
|
安全 Linux 测试技术
OpenText Static Application Security Testing (Fortify) 25.3 (macOS, Linux, Windows) - 静态应用安全测试
OpenText Static Application Security Testing (Fortify) 25.3 (macOS, Linux, Windows) - 静态应用安全测试
409 0
|
5月前
|
缓存 安全 Linux
Metasploit Pro 4.22.8-2025082101 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025082101 (Linux, Windows) - 专业渗透测试框架
237 0