环境:centos7、防火墙放行、selinux放行
目的:用ipv6,ssh远程访问服务器
- 修改/etc/ssh/sshd_config(记得重启服务)
- 查看服务端的ipv6(我有两张网卡,记住内网卡ens34的ipv6地址)
[root@chenshuyi ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:1c:e9:21 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1*/24 brd 10.0.0.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::****:488d:****:9921/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:1c:e9:2b brd ff:ff:ff:ff:ff:ff
inet 1.1.1.2/24 brd 1.1.1.255 scope global noprefixroute ens34
valid_lft forever preferred_lft forever
inet6 fe80::**e5:492f:648:****/64 scope link noprefixroute
valid_lft forever preferred_lft forever
- 客户端访问(注意使用ipv6之间可以用ping6
IPv6地址%网络接口,例如本地网卡的接口为ens33,则ipv6地址后面要添加%ens33,ping通之后,可以用ssh访问。)