Repository navigation
Description
What are you trying to do?
I have a VPS machine but only have IPv4 address. which is used for VPN and I setup Wireguard Warp tunnel enabled only IPv6 traffic. by this tutorial Cloudflare WARP Installer .
Now I could have both IPv4 (VPS) and IPv6(Cloudflare Warp). and I found some conflict with Tailscale Exit node function in this VPS. when I using 'tailscale ping mine-pc' command. this mine-pc have both IPv4 and 6; results first show IPv6 connection as show below. and occasionally it can't establish connection. and the real connection is IPv4.
root@1983:~# tailscale ping openwrt-ct (only have IPv4)
pong from openwrt-ct (100.81.23.28) via DERP(pbulic901) in 46ms
pong from openwrt-ct (100.81.23.28) via DERP(pbulic901) in 46ms
pong from openwrt-ct (100.81.23.28) via DERP(pbulic901) in 47ms
pong from openwrt-ct (100.81.23.28) via [IPv4 address]:27711 in 43ms
root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
pong from openwrt-cu (100.81.23.58) via DERP(pbulic901) in 42ms
pong from openwrt-cu (100.81.23.58) via DERP(pbulic901) in 42ms
pong from openwrt-cu (100.81.23.58) via DERP(pbulic901) in 42ms
pong from openwrt-cu (100.81.23.58) via DERP(pbulic901) in 42ms
pong from openwrt-cu (100.81.23.58) via [IPv6 address]:41641 in 252ms
root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
pong from openwrt-n1-cu (100.10.100.10) via [IPv4 address]:21744 in 37ms
After reading the ACLs docs https://tailscale.com/kb/1023/troubleshooting#cgnat-conflicts; I'm trying to use "disableIPv6": true as follows:
"hosts": {
"VPS_a": "100.10.100.10",
"VPS_b": "100.10.100.20",
},
// Define access control lists for users, groups, autogroups, tags,
// Tailscale IP addresses, and subnet ranges.
"acls": [
// Allow all connections.
// Comment this section out if you want to define specific restrictions.
{
"action": "accept",
"src": ["VPS_a"],
"dst": ["*"],
"disableIPv6": true
},
{
"action": "accept",
"src": ["VPS_b"],
"dst": ["*"],
"disableIPv6": true
},
{"action": "accept", "src": ["*"], "dst": ["*:*"]},
but only shows "Error: json: unknown field "disableIPv6""
How should we solve this?
Pls add "disableIPv6":true", as the CGNAT conflicts "DisableIPv4": true"
What is the impact of not solving this?
No response
Anything else?
No response
Activity
bradfitz commentedon Oct 7, 2024
Don't confuse IPv6 availability on your underlay network with IPv6 on the overlay network.
We provide disableIPv4 (on the overlay network) because there are legitimate cases were your network might already be using IPv4 addresses from the CGNAT pool.
But there's no such conflict with IPv6 overlay addresses from our ULA pool.
So there's no harm in keeping overlay IPv6 always on. (And IPv6 underlay will be used best effort, if it's available)
OTOH, there's real harm in letting overlay IPv6 be disabled: that'd mean it's possible there's no common protocol between two nodes wanting to talk to each other in a cross-tailnet situation, if one tailnet disabled IPv4 and the other disabled IPv6. Also, some parts of Tailscale (like Tailscale Funnel) only use IPv6 addresses on the overlay and assume it must be present.
So we have no plans to let you disable IPv6 overlay addresses.
You seem to be describing a different problem, though, and "disableIPv6" was just your guess at a solution, assuming it meant underlay? Because the ACLs don't affect the underlay network at all.
Re-reading your post several times, I'm having trouble understanding what's not working.
gemnioo commentedon Oct 8, 2024
Appreciated ur time to read my issue, bradifitz
Let me organize and explain the situation again:
I have a VPS that has a public IPv4 address but no IPv6 address. I can set it up as an Exit node smoothly and allow traffic to pass through it. However, the annoying problem is that YouTube flags this VPS's IPv4 as a bot: "Please log in so we can confirm you are not a chatbot."
Through the "Cloudflare WARP Installer" script, I successfully set up the "WARP IPv6 Network interface (WireGuard Mode)" on this VPS, giving it an IPv6 address. This was verified by using "ping6 google.com". Since IPv6 out first, it resolved the YouTube flagging issue.
My current network situation as follows: You can see that two WireGuard protocols have been successfully connected.
As mentioned above, I could set up the VPS as Exit node; however, cannot connect to the internet. When using the "tailscale ping" command, if I ping a devices under the tailnet "have valid public IPv4/6 Add", the results shows establishing a connection via "WireGuard Warp IPv6 Network" first and then falling back to the real public IPv4 address or sometimes losing ping briefly before reverting to an IPv4 connection upon retry.
Based on my situation, I naturally thought setting "disableIPv6: true" in ACLs would solve these problems... So please understand that.
On what I observed, some Tailscale IPv6 connections seem to be entering into "WireGuard Warp IPv6" tunnel causing the issue ?
gemnioo commentedon Oct 8, 2024
And status of INPUT OUTPUT FORWARD or other kernel parameters below:
gemnioo commentedon Oct 8, 2024
bradfitz commentedon Oct 8, 2024
I think what you're asking for is #1552.
gemnioo commentedon Oct 9, 2024
Read the #1552. let me try 'tailgate' or 'RestrictNetworkInterfaces'. hope it works.
gemnioo commentedon Oct 9, 2024
test using @fernandoenzo 'TailGate' limited the Tailscale only use "ens5" network interface, It looks like can't fix mine "can't using as Exit Node" problem. well. this is the the overrid.conf
and the tailscale ping command also show IPv6 like I mentioned kinds of same as @mbilker #1552 (comment)
gemnioo commentedon Oct 9, 2024
After disable the wgcf WireGuard tunnel. still can't have traffic in "Exit mode" it's weird
fernandoenzo commentedon Oct 9, 2024
Hey there! Thanks a ton for using my project
Tailgate. I hope it’s working wonders for you. About your issue, I'd suggest using the IPv4 address of the node directly instead of its name. I know it’s a bit of a hassle, but it's the only way to force IPv4 and avoid IPv6. Now, if you want to level up with a geeky option, I recommend my other project,wirescale, which lets you set up IPv4 WireGuard networks as you wish. Happy hacking!gemnioo commentedon Oct 9, 2024
Tailscale IPv6 traffic will enter the wgcf network interface because the default route for IPv6 traffic is via wgcf. This default route takes precedence over any more specific routes unless the destination address matches one of the specific routes for tailscale0.
gemnioo commentedon Oct 11, 2024
After trying follow Alex's tutorial Install tailsacle in Docker. It only could access using IPv4 but failed to establish Direct connection as It behind the docker0 TUN interface (172.17.0.1/16... into Hard NAT mode....
gemnioo commentedon Nov 21, 2024
update with the fix methods:just stop the WireGuard tunnnel and modify "nano /etc/wireguard/wgcf.conf" set to only Allow IPv6 trafficupdate 2.0: still not fixed. as the tailscale still traffic IPv6 to wgcf WireGuard Tunnel Interface when trying to connect IPv6 address
then you can check with "ip add" to confirm wgcf network interface only working on IPv6
gemnioo commentedon Nov 21, 2024
Update with the help of Gemini Experimental 1114 💯 the problem fixed:
wgcf Interface: This is your wireguard interface, as indicated by the wg-quick logs. It has been assigned an IPv6 address and has a default IPv6 route set up in table 51820/or 51888 in previous route table.
Routing Rules: Routing rules determine which routing table is used to make forwarding decisions. The critical rule here is:
Why Traffic Goes Through wgcf
Lack of fwmark on tailscale0 Traffic: Traffic originating from tailscale0 does not inherently have the fwmark 51820. The logs and configuration you provided show no indication of tailscale0 traffic being marked.
Matching the not fwmark 51820 Rule: Since tailscale0's IPv6 traffic lacks the fwmark 51820, it matches the rule
ip -6 rule add not fwmark 51820 table 51820
This directs the traffic to use routing table 51820.
Default Route in Table 51820: Within routing table 51820, you have a default IPv6 route (::/0) that directs all traffic to the wgcf interface:
Therefore, any IPv6 traffic from any interface except wgcf (including tailscale0) that doesn't have the fwmark 51820 will be directed to the wgcf interface via the default route in table 51820.
As involve marking tailscale0 traffic with a different fwmark and creating a corresponding rule and routing table, which modifying Tailscale's behavior is challenging, and working within the constraints of the wgcf interface's fwmark 51820 is the best approach for this situation.
Solution: Add a Specific Rule for Tailscale with Higher Priority
Identify the Source IP Range for tailscale0 and Create a Specific Rule to Bypass Table 51820. (Note by me: from the tailscale docs Tailscale IPv6 addresses are assigned from the unique local addressprefix of fd7a:115c:a1e0::/48
add a new rule with a higher priority (lower number) than the existing rule that directs traffic to table 51820. This rule will match traffic from tailscale0 and direct it to the main routing table.
Viewing the main Routing Table
Viewing the main Routing Table
gemnioo commentedon Nov 21, 2024
and for @fernandoenzo 's TailGate:
The tailgate-allow ens5.service unit configured within the tailscaled.service.d/override.conf is not directly related to how IPv6 routing is handled for tailscale0 traffic. This configuration affects Tailscale's ability to initiate connections through a specific interface (ens5 in your case), but it doesn't dictate the routing decisions for already established traffic.
What tailgate-allow ens5.service does:
tailgate-allow service: This is a systemd service template provided by Tailscale. It uses iptables (or equivalent depending on your OS's firewall) to permit incoming traffic on a specified interface for Tailscale's relay servers (DERP servers) and peer connections.
Why it doesn't affect routing:
Ingress vs. Egress: tailgate-allow ens5.service primarily deals with ingress (incoming) traffic to your machine through ens5. Your routing issue relates to egress (outgoing) traffic from your tailscale0 interface.
"allow traffic on ens5" implies routing through ens5. However, allowing traffic through an interface doesn't dictate the routing path. The routing logic is still governed by your routing tables and rules.
gemnioo commentedon Nov 21, 2024
One more thing. if wgcf restart. it will over writer the priority 100 rule table. so thanks to wireguard PostUp and PostDown "commands are issued when the interface is setup and stopped to configure network address translation and forwarding." ;
which will delete and re-add priority 100 above the wg-quick added priority!
You need to nano /etc/wireguard/wgcf.conf to add this two in the end of [Interface]
gemnioo commentedon Nov 22, 2024
And from Claude 3.5 Sonnet V2 explain: why still have IPv6 in tailscale Ping command.
Tailscale's ping command behaves differently from a regular ping because it actively tries all possible paths to reach the destination, regardless of the system's routing table. This is part of Tailscale's "path finding" or "path discovery" feature. Here's what's happening in your logs:
Even though you've set up routing rules to prevent regular IPv6 traffic from going through wgcf, Tailscale's ping command
This is different from a regular ping command which would respect the system's routing tables. To verify this, you can try a regular ping6 command to the same IPv6 address - it should follow your routing rules.