Contents
- IPv6 is a separate access path
- First, force both address families to be compared
- DNS: AAAA must point to the current and correct machine
- Routing and listening: what can be verified directly on the server
- Firewall: TCP service and the required ICMPv6 have different roles
- Ping works, SSH doesn't: determine the last successful phase
- The connection opens, but larger traffic gets stuck
- What to save to your profile and how to verify completion
- Frequently asked questions
IPv6 is a separate access path
A server may have IPv4 working and IPv6 not working. It may also work over IPv6 directly, while IPv4 goes through a NAT or bastion. So when diagnosing, don't automatically take a response from the same name as proof of the same path. Write down the destination address, TCP port, and whether you are using a VPN, proxy, or relay server.
IPv6 often eliminates the need for traditional port translation on your home router, but it does not eliminate the firewall. A publicly routable address does not mean that incoming connections are allowed. Similarly, a server's functioning outgoing web traffic does not confirm that new incoming SSH can be established to it. You need to check the rules of all devices in the path.
The following examples use a custom Linux server with OpenSSH. Addresses starting with 2001:db8 are reserved for documentation purposes and do not belong to the actual target. Replace them with the verified address of your server as you work. The public prefix may change and the historical record in the notes may not reflect the current state.
First, force both address families to be compared
Use the same account, key, and port, and only change the address family. The OpenSSH client can choose between multiple addresses during a normal connection. The -4 and -6 switches remove the ambiguity of which path you are currently trying. A detailed listing will show the specific destination address and the stage at which the attempt ended.
ssh -4 -vvv -o ConnectTimeout=8 spravce@server.example
ssh -6 -vvv -o ConnectTimeout=8 spravce@server.example
# Připojení přímo na ověřenou IPv6 adresu:
ssh -6 -l spravce 2001:db8:1234::20For direct address, verify the host key independently as for name connections. The client may have the identity of the address and DNS name stored separately. Do not bypass the warning by turning off StrictHostKeyChecking. Successful login to the address with the same password is not in itself a confirmation that it is the correct server.
If only IPv4 works, continue by checking IPv6 DNS, routes, listeners, and filtering. If both paths fail at the same authentication stage, first look for a common cause in the account or key. Switching to IPv4 may be a temporary operational option, but it does not fix the IPv6 misadvertising.
DNS: AAAA must point to the current and correct machine
A record corresponds to IPv4, AAAA to IPv6. The server may publish multiple addresses and some may be outdated. Compare the response from the resolver used by the client with the actual addresses on the server. For a dynamic prefix, check the updater, the time of the last successful update, and the TTL. A DNS fix may not immediately take effect in all caches that are already populated.
# Na klientovi s nástrojem dig:
dig +short A server.example
dig +short AAAA server.example
# Na Linux serveru:
ip -6 address show
ip -6 route showDistinguish between a global address, a private local scope, and a link-local address fe80::. Link-local access only makes sense on the relevant local segment and often requires an interface identifier. It cannot be used as a public Internet address for a server. Additionally, addresses marked tentative, dadfailed, or deprecated require an explanation of their status, not automatic DNS takeover.
For temporary client addresses, the connection source may change. A firewall limited to a single, current laptop address may become unresponsive over time. Design access based on the actual management network or VPN and its lifecycle. Broadly allowing the entire Internet is not a good automatic fix for a changing address.
Routing and listening: what can be verified directly on the server
The server must have an address and a correct path back to the client. Check the default route and any multi-interface policies. For a virtual machine, distinguish between guest system settings, virtual bridge, and hypervisor rules. A functional host network is not automatically a functional guest server network.
# Na serveru: cesta k ověřené adrese klienta
ip -6 route get 2001:db8:5678::10
# Skutečné IPv6 TCP listenery
sudo ss -6 -lntp
sudo /usr/sbin/sshd -T | grep -E "^(addressfamily|port|listenaddress) "The address [::]:22 usually indicates listening on an unspecified IPv6 address. Whether the socket also accepts IPv4 depends on its configuration and system; do not infer this from the asterisk in the output alone. Verify both families with a real connection. If SSH only listens on 127.0.0.1, the public IPv6 connection to it does not have a corresponding listener.
For socket activation, also check ssh.socket and its ListenStream. The source of truth about the currently open port is the actual socket, while sshd_config describes the daemon configuration. When making changes, keep the original functional approach, check syntax, and retest the new connection. Don't disable IPv6 across the board as a way to hide the inconsistency.
Firewall: TCP service and the required ICMPv6 have different roles
Check the rules of the guest system, hypervisor, provider and router. IPv6 is not protected by the existence of NAT for IPv4. The rule for an IPv4 address does not automatically apply to an IPv6 client. In some firewall managers, IPv6 may be disabled or handled by a different table, so read the actually applied status.
# Pouze čtecí kontrola používaného firewallu:
sudo nft list ruleset
# Pokud používáte UFW:
sudo ufw status verboseDo not issue commands to delete the entire rule set. When editing, add targeted permissions for the desired port and source, and verify that no other admin service has opened. Don't forget about return traffic and stateful rules. For an account restricted by source address, also check sshd Match Address and Fail2ban protection.
ICMPv6 is not just an optional ping response. It is used for things like neighbor discovery and packet size reporting. Widespread blocking can create hard-to-read errors. Follow the recommendations for the appropriate interface type and specific ICMPv6 messages. This does not mean automatically allowing every type from every network without consideration.
Ping works, SSH doesn't: determine the last successful phase
A ping response only confirms some ICMPv6 traffic. SSH still requires a TCP connection, protocol negotiation, server authentication, and account login. Conversely, a non-responsive ping does not rule out a functioning TCP 22. Therefore, when reporting an error, please provide the result of the actual SSH attempt, not just a ping snapshot.
- No route to host or Network is unreachable: check the path, interface, and any rejections along the way.
- Connection refused: verify correct address, port, listener, and active denial.
- Timeout: look for a lost request or response or an unresponsive service.
- Permission denied: The connection reached account authentication; focus on the key, methods, and context rules.
If you have permission to capture traffic, a targeted short capture on the server can show whether an incoming TCP SYN arrives at all and whether the server responds. Capture only the necessary interface, address, and port, and be sensitive to the traffic data. A missing SYN, when properly tested, shows a different search area than a two-way TCP connection with a rejected key.
The connection opens, but larger traffic gets stuck
The functional short command does not yet check the entire transfer path. If the terminal opens but a larger output or SFTP transfer stops progressing, consider the MTU and delivering the necessary Packet Too Big messages. The suspicion must match the observation: disconnecting exactly after a period of inactivity is a different scenario than depending on the transfer size.
Compare the same small and larger approved traffic over IPv4 and IPv6. Consider VPNs and tunnels that reduce the effective MTU. Do not randomly change the global MTU of all interfaces. First, document where the problem occurs and determine the intended network configuration. Fixing the filtering of necessary ICMPv6 messages may be more correct than permanently covering up the problem with a small MTU.
# Příklad SFTP přes DNS jméno s vynucenou IPv6:
sftp -6 -P 22 spravce@server.example
# Přímá IPv6 v syntaxi SFTP potřebuje hranaté závorky:
sftp -P 22 "spravce@[2001:db8:1234::20]"What to save to your profile and how to verify completion
Maintain the correct host, port, account, and verified server key in CH-J Tools. If the public prefix changes, a managed DNS name is usually more practical than manually copying the historical address into multiple profiles. However, the functionality of the name depends on a properly working updater and a truly valid AAAA. This does not replace trust in the host key.
- The new SSH login works over the intended IPv6 path.
- SFTP or other necessary transfer also works for regular file size.
- DNS matches current addresses and does not publish defunct prefixes.
- The firewall protects both IPv4 and IPv6 according to the same security intent.
- The procedure for restoring access after a prefix change or VPN outage is described below.
Record the fix, along with the address family and path tested. The phrase "server is working" is too broad if you only verified IPv4 from the local network. It is more accurate to list the specific new test over IPv6, its source, port, and success phase. Such a record will help distinguish a repeat of the same error from a different problem the next time you experience an outage.
Frequently asked questions
Do I need to forward a port on my router for IPv6?
For a directly routed IPv6 server, usually not with classic IPv4 NAT. But you still need proper routing and targeted firewall enablement.
Why does ssh -4 work and ssh -6 not?
These are different addresses and often different paths. Check AAAA, routing, IPv6 listener and firewall rules.
Can I disable all ICMPv6?
Broadband blocking can disrupt necessary network functions including neighbor discovery and path size. Apply specific rules based on the role of the interface.
Is a public IPv6 address automatically available from the Internet?
No. Availability depends on the routing and rules of the provider, router, hypervisor, and the server itself.
Detailed documentation
OpenSSH: IPv4 and IPv6 options →
OpenSSH: AddressFamily and ListenAddress →
IETF RFC 4890: ICMPv6 filtering recommendations →
IETF RFC 8201: Path MTU Discovery for IPv6 →