大网数据广告活动
服务器运维问答

Unable to ssh server via ipv6

· 52CE 我爱测

First: ipv4 works fine. So I got the following setup: (Server is an Arch Linux OS running as VM) EDIT Added a rule ACCEPT tcp ::/0 ::/0 tcp dpt:22 which accepts ANY connection on port 22 (to make sure it's not an IP failure), but…

问题原文

原帖链接 · elp · CC BY-SA 4.0

First: ipv4 works fine.

So I got the following setup: (Server is an Arch Linux OS running as VM)

EDIT Added a rule

ACCEPT     tcp      ::/0                 ::/0                 tcp dpt:22

which accepts ANY connection on port 22 (to make sure it's not an IP failure), but that does not work as well. So I am doing something wrong with the ssh ... command or the ipv6 firewall table is not working:

Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all      ::/0                 ::/0                 ctstate RELATED,ESTABLISHED
ACCEPT     all      ::/0                 ::/0                
DROP       all      ::/0                 ::/0                 ctstate INVALID
UDP        udp      ::/0                 ::/0                 ctstate NEW
TCP        tcp      ::/0                 ::/0                 tcp flags:0x17/0x02 ctstate NEW
REJECT     tcp      ::/0                 ::/0                 reject-with tcp-reset
REJECT     all      ::/0                 ::/0                 reject-with icmp6-adm-prohibited

Chain FORWARD (policy DROP)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain TCP (1 references)
target     prot opt source               destination         
ACCEPT     tcp      ::/0                 ::/0                 tcp dpt:22

Chain UDP (1 references)
target     prot opt source               destination         

After deleting the ip6table it finally works :D So I need to figure out what went wrong :)

已采纳解答

原帖链接 · fuero · CC BY-SA 4.0

Given that you didn't go into too much detail about your setup, here are a few pointers:

Verify that...

  • you have ip_forward enabled for IPv6: sysctl net.ipv6.conf.all.forwarding=1
  • you are not dealing with link-local addresses (the fe80::/10 prefix)
  • you can access the VM via IPv6 from the host it's running on.
  • you test IPv6 connectivity with firewall disabled (ip6tables -F) first and add rules when it's working.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-11-30)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。