When you observe the gif0 interface correctly plumbed but the route utility refusing to accept paths through it, you are encountering a modern macOS routing constraint. macOS heavily restricts traditional scoped routing over raw generic tunneling interfaces (gif) if there is no underlying IPv4 gateway affinity explicitly parsed by the XNU kernel routing daemon.
The Technical Cause
- Interface Scoping Requirements: macOS enforces strict network interface scoping rules. When you try to append a standard IPv6 route using route add -inet6 default -interface gif0 or using the remote tunnel IPv6 endpoint, the BSD-layer routing table rejects it because it considers gif0 an un-scoped, disconnected link unless it explicitly resolves an on-link endpoint.
- Missing Local IPv4 Bindings: If your local machine is behind a NAT (e.g., using a local IPv4 address like 192.168.1.X), binding the gif tunnel to your external IP will cause the routing configuration to fail. macOS requires the tunnel command to bind to an IP physically present on one of your local hardware interfaces (en0, en1, etc.).
How to Fix It
To satisfy the kernel's routing demands, you must define the IPv6 destination explicitly paired with the point-to-point interface parameters. Use the following structured sequence:
Correctly Bind the Tunnel (Using Local IP)
Ensure your gif0 interface is tunnel-configured using your local LAN IPv4 (not your public IP if you are behind a NAT):
sudo ifconfig gif0 tunnel <YOUR_LOCAL_IPV4> <TUNNEL_BROKER_REMOTE_IPV4>
Assign the IPv6 Endpoints
Explicitly state the source and target IPv6 addresses on the interface, declaring a point-to-point link prefix length (prefixlen 128 or /128) to prevent routing path collisions:
sudo ifconfig gif0 inet6 <YOUR_ASSIGNED_CLIENT_IPV6> <TUNNEL_BROKER_REMOTE_IPV6> prefixlen 128
Overcome the route Refusal
Instead of pushing an abstract interface route, force the kernel to evaluate the interface by targeting the specific remote IPv6 gateway link as the next hop:
sudo route add -inet6 default <TUNNEL_BROKER_REMOTE_IPV6>
If it still throws a routing error, explicit scoping can sometimes be forced by appending the interface designation to the gateway command:
sudo route add -inet6 default -interface gif0
Alternative: Let macOS Manage 6to4 via System Settings (i.e., use 6to4 instead of 6in4)
If manual command-line configuration continues to drop or conflict with the macOS system configuration daemon (configd), you can allow macOS to handle the link encapsulation internally:
- Open System Settings > Network.
- Click the Action (...) pop-up menu at the bottom-right of the interface list and choose Add Service.
- Select 6to4 from the Interface dropdown menu.
- Name the service and hit Create.
- Go into its details to input your relay or broker addresses manually to let configd cleanly inject the required routes into the kernel
More info from Apple: Set up a 6to4 network port on Mac - Apple Support