Skip to content

FR: Support "disableIPv6": true  #13705

Closed

Description

@gemnioo

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

  1. bradfitz commented on Oct 7, 2024

    @bradfitz
    Member

    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.

  2. added
    waiting-for-info
    vpn-interop
    on Oct 7, 2024
  3. gemnioo commented on Oct 8, 2024

    @gemnioo
    Author

    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.

    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.

    root@1983:~# ip add
    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 noprefixroute 
           valid_lft forever preferred_lft forever
    2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 00:16:3e:06:69:07 brd ff:ff:ff:ff:ff:ff
        altname enp0s5
        inet 10.3.22.253/16 metric 100 brd 10.3.255.255 scope global dynamic ens5
           valid_lft 315194514sec preferred_lft 315194514sec
        inet6 fe80::216:3eff:fe06:6907/64 scope link 
           valid_lft forever preferred_lft forever
    3: tailscale0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc fq state UNKNOWN group default qlen 500
        link/none 
        inet 100.10.100.10/32 scope global tailscale0
           valid_lft forever preferred_lft forever
        inet6 fd7a:115c:a1e0::ed01:ce73/128 scope global 
           valid_lft forever preferred_lft forever
        inet6 fe80::ce3f:1239:c719:752b/64 scope link stable-privacy 
           valid_lft forever preferred_lft forever
    4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
        link/ether 02:42:36:31:ff:33 brd ff:ff:ff:ff:ff:ff
        inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
           valid_lft forever preferred_lft forever
        inet6 fe80::42:36ff:fe31:ff33/64 scope link 
           valid_lft forever preferred_lft forever
    11: wgcf: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
        link/none 
        inet 172.16.0.2/32 scope global wgcf
           valid_lft forever preferred_lft forever
        inet6 2606:4700:110:821e:81e:3644:df34:8226/128 scope global 
           valid_lft forever preferred_lft forever
    
    
    root@1983:~# bash <(curl -fsSL git.io/warp.sh) status
    
    [INFO] Status check in progress...
    
     ----------------------------
     WARP Client	: Stopped
     SOCKS5 Port	: Off
     ----------------------------
     WireGuard	: Running
     IPv4 Network	: Normal
     IPv6 Network	: WARP
     ----------------------------
    

    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.

    root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
    pong from openwrt-cu (100.10.100.30) via DERP(pbulic901) in 42ms
    pong from openwrt-cu (100.10.100.30) via DERP(pbulic901) in 42ms
    pong from openwrt-cu (100.10.100.30) via DERP(pbulic901) in 42ms
    pong from openwrt-cu (100.10.100.30) via DERP(pbulic901) in 42ms
    
    pong from openwrt-cu (100.10.100.30) via [IPv6 address]:41641 in 252ms   ##looks like through Warp IPv6 Network ? 
    
    root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
    pong from openwrt-cu (100.10.100.30) via DERP(pbulic901) in 42ms
           NOT SHOW  
           
    root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
    pong from openwrt-cu (100.10.100.30) via [IPv4 address]:21744 in 37ms
    

    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 ?

  4. gemnioo commented on Oct 8, 2024

    @gemnioo
    Author

    And status of INPUT OUTPUT FORWARD or other kernel parameters below:

    root@1983:~# iptables -L
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:443
    ACCEPT     udp  --  anywhere             anywhere             udp dpt:443
    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:80
    ACCEPT     udp  --  anywhere             anywhere             udp dpt:80
    
    Chain FORWARD (policy DROP)
    target     prot opt source               destination         
    DOCKER-USER  all  --  anywhere             anywhere            
    DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere            
    ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
    DOCKER     all  --  anywhere             anywhere            
    ACCEPT     all  --  anywhere             anywhere            
    ACCEPT     all  --  anywhere             anywhere            
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain DOCKER (1 references)
    target     prot opt source               destination         
    
    Chain DOCKER-ISOLATION-STAGE-1 (1 references)
    target     prot opt source               destination         
    DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
    RETURN     all  --  anywhere             anywhere            
    
    Chain DOCKER-ISOLATION-STAGE-2 (1 references)
    target     prot opt source               destination         
    DROP       all  --  anywhere             anywhere            
    RETURN     all  --  anywhere             anywhere            
    
    Chain DOCKER-USER (1 references)
    target     prot opt source               destination         
    RETURN     all  --  anywhere             anywhere 
    
    root@1983:~# cat /etc/sysctl.conf
    # Memory usage
    # https://blog.cloudflare.com/the-story-of-one-latency-spike/
    # https://cloud.google.com/architecture/tcp-optimization-for-network-performance-in-gcp-and-hybrid/
    # https://github.com/redhat-performance/tuned/blob/master/profiles/network-throughput/tuned.conf
    # ReceiveBuffer: X - (X / (2 ^ tcp_adv_win_scale)) = RTT * Bandwidth / 8
    # SendBuffer: RTT * Bandwidth / 8 * 0.7
    net.core.netdev_max_backlog = 262144
    net.ipv4.tcp_max_syn_backlog = 8192
    net.core.rmem_max = 134217728
    net.core.wmem_max = 134217728
    net.ipv4.tcp_rmem = 16384 131072 67108864
    net.ipv4.tcp_wmem = 4096 16384 33554432
    net.ipv4.udp_rmem_min = 131072
    net.ipv4.udp_wmem_min = 131072
    
    # Layer 2
    # No Proxy ARP, obviously
    net.ipv4.conf.default.proxy_arp = 0
    net.ipv4.conf.all.proxy_arp = 0
    # Do not reply ARP requests if the target IP address is not configured on the incoming interface
    net.ipv4.conf.default.arp_ignore = 1
    net.ipv4.conf.all.arp_ignore = 1
    # When sending ARP requests, use the best IP address configured on the outgoing interface
    net.ipv4.conf.default.arp_announce = 2
    net.ipv4.conf.all.arp_announce = 2
    # Enable gratuitous arp requests
    net.ipv4.conf.default.arp_notify = 1
    net.ipv4.conf.all.arp_notify = 1
    
    # IPv4 routing
    net.ipv4.ip_forward = 1
    net.ipv4.conf.default.rp_filter = 0
    net.ipv4.conf.all.rp_filter = 0
    net.ipv4.conf.default.send_redirects = 0
    net.ipv4.conf.all.send_redirects = 0
    # Enable when there are 1-2K hosts
    net.ipv4.neigh.default.gc_thresh1 = 2048
    net.ipv4.neigh.default.gc_thresh2 = 4096
    net.ipv4.neigh.default.gc_thresh3 = 8192
    
    # IPv6 routing
    net.ipv6.conf.default.disable_ipv6 = 0
    net.ipv6.conf.all.disable_ipv6 = 0
    net.ipv6.conf.default.forwarding = 1
    net.ipv6.conf.all.forwarding = 1
    # Enable when there are 1-2K hosts
    net.ipv6.neigh.default.gc_thresh1 = 4096
    net.ipv6.neigh.default.gc_thresh2 = 8192
    net.ipv6.neigh.default.gc_thresh3 = 16384
    
    # PMTUD
    # https://blog.cloudflare.com/path-mtu-discovery-in-practice/
    net.ipv4.ip_no_pmtu_disc = 0
    net.ipv4.tcp_mtu_probing = 1
    net.ipv4.tcp_base_mss = 1024
    
    # MPLS & L3VPN support
    # https://web.archive.org/web/20210301222346/https://cumulusnetworks.com/blog/vrf-for-linux/
    # net.mpls.ip_ttl_propagate = 1
    # net.mpls.default_ttl = 255
    # net.mpls.platform_labels = 1048575
    net.ipv4.tcp_l3mdev_accept = 0
    net.ipv4.udp_l3mdev_accept = 0
    net.ipv4.raw_l3mdev_accept = 0
    # net.mpls.conf.lo.input = 1
    
    # ICMP
    # net.ipv4.icmp_errors_use_inbound_ifaddr = 1
    # net.ipv4.icmp_ratelimit = 0
    # net.ipv6.icmp.ratelimit = 0
    net.ipv4.icmp_echo_ignore_all = 1
    # net.ipv6.icmp_echo_ignore_all = 1
    
    # TCP connection accepting
    # https://serverfault.com/questions/518862/will-increasing-net-core-somaxconn-make-a-difference
    net.core.somaxconn = 8192
    net.ipv4.tcp_abort_on_overflow = 0
    
    # TCP connection recycling
    # https://dropbox.tech/infrastructure/optimizing-web-servers-for-high-throughput-and-low-latency
    net.ipv4.tcp_tw_reuse = 1
    net.ipv4.tcp_fin_timeout = 30
    net.ipv4.tcp_max_tw_buckets = 4096
    
    # TCP congestion control
    # https://blog.cloudflare.com/http-2-prioritization-with-nginx/
    net.core.default_qdisc = fq
    net.ipv4.tcp_congestion_control = bbr
    net.ipv4.tcp_notsent_lowat = 16384
    net.ipv4.tcp_window_scaling = 1
    
    # TCP keepalive
    net.ipv4.tcp_keepalive_time = 120
    net.ipv4.tcp_keepalive_intvl = 60
    net.ipv4.tcp_keepalive_probes = 3
    
    # TCP auxiliary
    # https://dropbox.tech/infrastructure/optimizing-web-servers-for-high-throughput-and-low-latency
    net.ipv4.tcp_fastopen = 3
    net.ipv4.tcp_syncookies = 1
    net.ipv4.tcp_no_metrics_save = 1
    net.ipv4.tcp_sack = 1
    net.ipv4.tcp_synack_retries = 2
    net.ipv4.tcp_timestamps = 1
    net.ipv4.tcp_rfc1337 = 1
    net.ipv4.tcp_slow_start_after_idle = 0
    net.ipv4.tcp_adv_win_scale = 1
    
    # ECN
    net.ipv4.tcp_ecn = 0
    net.ipv4.tcp_ecn_fallback = 1
    
    # ECMP hashing
    # https://web.archive.org/web/20210204031636/https://cumulusnetworks.com/blog/celebrating-ecmp-part-two/
    net.ipv4.fib_multipath_hash_policy = 1
    net.ipv4.fib_multipath_use_neigh = 1
    
    # GRE keepalive
    # https://blog.artech.se/2016/01/10/4/
    net.ipv4.conf.default.accept_local = 1
    net.ipv4.conf.all.accept_local = 1
    
    # IGMP
    # https://phabricator.vyos.net/T863
    net.ipv4.igmp_max_memberships = 512
    
    # IPv6 route table size bug fix
    # https://web.archive.org/web/20200516030405/https://lists.nat.moe/pipermail/transit-service/2020-May/000000.html
    net.ipv6.route.max_size = 2147483647
    
    # Prefer different parity for ip_local_port_range start and end value
    net.ipv4.ip_local_port_range = 1024 65535
    net.ipv4.ip_local_reserved_ports = 10000
    
    # Maximum number of open files
    fs.file-max = 1048576
    
    # Avoid the use of swap spaces where possible
    vm.swappiness = 1
    
  5. gemnioo commented on Oct 8, 2024

    @gemnioo
    Author
    root@1983:~# iperf3 -s
    -----------------------------------------------------------
    Server listening on 5201 (test #1)
    -----------------------------------------------------------
    Accepted connection from to 100.10.100.20, port 49424
    [  5] local 100.10.100.10 port 5201 connected to 100.10.100.20 port 49425
    [ ID] Interval           Transfer     Bitrate         Retr  Cwnd
    [  5]   0.00-1.00   sec  13.5 MBytes   113 Mbits/sec    0   3.51 MBytes       
    [  5]   1.00-2.00   sec  19.1 MBytes   161 Mbits/sec   50   3.51 MBytes       
    [  5]   2.00-3.00   sec  18.0 MBytes   151 Mbits/sec    0   3.54 MBytes       
    [  5]   3.00-4.00   sec  19.3 MBytes   162 Mbits/sec   22   3.54 MBytes       
    [  5]   4.00-5.00   sec  19.0 MBytes   159 Mbits/sec    0   3.54 MBytes       
    [  5]   5.00-6.00   sec  18.7 MBytes   157 Mbits/sec    0   3.54 MBytes       
    [  5]   6.00-7.00   sec  19.6 MBytes   165 Mbits/sec    0   3.54 MBytes       
    [  5]   7.00-8.00   sec  19.4 MBytes   163 Mbits/sec    0   3.57 MBytes       
    [  5]   8.00-9.00   sec  19.1 MBytes   160 Mbits/sec    0   3.57 MBytes       
    [  5]   9.00-10.00  sec  20.1 MBytes   169 Mbits/sec    0   3.57 MBytes       
    [  5]  10.00-10.11  sec   977 KBytes  73.2 Mbits/sec    0   3.57 MBytes       
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval           Transfer     Bitrate         Retr
    [  5]   0.00-10.11  sec   187 MBytes   155 Mbits/sec   72             sender
    -----------------------------------------------------------
    Server listening on 5201 (test #2)
    -----------------------------------------------------------
    Accepted connection from 100.10.100.20, port 49426
    [  5] local 100.10.100.10 port 5201 connected to 100.10.100.20 port 49427
    [ ID] Interval           Transfer     Bitrate         Retr  Cwnd
    [  5]   0.00-1.00   sec  14.6 MBytes   123 Mbits/sec    0   3.06 MBytes       
    [  5]   1.00-2.00   sec  19.6 MBytes   165 Mbits/sec   18   3.20 MBytes       
    [  5]   2.00-3.00   sec  18.5 MBytes   155 Mbits/sec    0   3.39 MBytes       
    [  5]   3.00-4.00   sec  18.9 MBytes   159 Mbits/sec    0   3.39 MBytes       
    [  5]   4.00-5.00   sec  19.1 MBytes   160 Mbits/sec    0   3.57 MBytes       
    [  5]   5.00-6.00   sec  18.8 MBytes   158 Mbits/sec    0   3.57 MBytes       
    [  5]   6.00-7.00   sec  19.8 MBytes   166 Mbits/sec    0   3.57 MBytes       
    [  5]   7.00-8.00   sec  19.8 MBytes   166 Mbits/sec    0   3.57 MBytes       
    [  5]   8.00-9.00   sec  18.9 MBytes   159 Mbits/sec    0   3.57 MBytes       
    [  5]   9.00-10.00  sec  19.8 MBytes   166 Mbits/sec    0   3.57 MBytes       
    [  5]  10.00-10.05  sec  1.85 MBytes   333 Mbits/sec    0   3.57 MBytes       
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval           Transfer     Bitrate         Retr
    [  5]   0.00-10.05  sec   190 MBytes   158 Mbits/sec   18             sender
    -----------------------------------------------------------
    Server listening on 5201 (test #3)
    
    root@1983:~# tailscale netcheck
    
    Report:
    	* UDP: true
    	* IPv4: yes, [IPv4 address]:1912
    	* IPv6: no, but OS has support
    	* MappingVariesByDestIP: false
    	* PortMapping: 
    	* Nearest DERP: location
    	* DERP latency:
    		- pbulic902: 33ms    (location1)
    		- pbulic901: 38.5ms  (location2)
    		
    
  6. bradfitz commented on Oct 8, 2024

    @bradfitz
    Member

    I think what you're asking for is #1552.

  7. gemnioo commented on Oct 9, 2024

    @gemnioo
    Author

    I think what you're asking for is #1552.

    Read the #1552. let me try 'tailgate' or 'RestrictNetworkInterfaces'. hope it works.

  8. gemnioo commented on Oct 9, 2024

    @gemnioo
    Author

    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

    root@1983:~# cat /etc/systemd/system/tailscaled.service.d/override.conf 
    [Unit]
       Wants=network-pre.target [email protected]@1983:~# 
    

    and the tailscale ping command also show IPv6 like I mentioned kinds of same as @mbilker #1552 (comment)

    root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic901) in 43ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic901) in 43ms
    ping "100.10.100.20" timed out
    ping "100.10.100.20" timed out
    ping "100.10.100.20" timed out
    pong from openwrt-cu (100.10.100.20) via [IPv6 Address]:41641 in 243ms
    
    root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
    pong from openwrt-cu (100.10.100.20) via [IPv6 Address]:41641 in 243ms
    
    root@1983:~# tailscale ping openwrt-cu
    ping "100.10.100.20" timed out
    ping "100.10.100.20" timed out
    pong from openwrt-cu (100.10.100.20) via [IPv6 Address]:41641 in 244ms
    
    root@1983:~# tailscale ping openwrt-ct (Only IPv4)
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic901) in 43ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic901) in 43ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic901) in 43ms
    pong from openwrt-ct (100.10.100.30) via [IPv4 address]:28585 in 41ms
    
    root@1983:~# tailscale ping iphone15 (Both IPv4 and v6)
    pong from iphone13 (100.10.100.50) via DERP(pbulic901) in 78ms
    pong from iphone13 (100.10.100.50) via DERP(pbulic901) in 127ms
    pong from iphone13 (100.10.100.50) via DERP(pbulic901) in 122ms
    ping "100.10.100.50" timed out
    ping "100.10.100.50" timed out
    pong from iphone13 (100.10.100.50) via [IPv6 Address_2]:41641 in 247ms
    
  9. gemnioo commented on Oct 9, 2024

    @gemnioo
    Author

    After disable the wgcf WireGuard tunnel. still can't have traffic in "Exit mode" it's weird

    [INFO] Status check in progress...
    
     ----------------------------
     WARP Client	: Stopped
     SOCKS5 Port	: Off
     ----------------------------
     WireGuard	: Stopped
     IPv4 Network	: Normal
     IPv6 Network	: Unconnected
     ----------------------------
    
    root@s2983:~# ip add
    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 noprefixroute 
          valid_lft forever preferred_lft forever
    2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
       link/ether 00:16:3e:06:69:07 brd ff:ff:ff:ff:ff:ff
       altname enp0s5
       inet 10.3.12.153/16 metric 100 brd 10.3.255.255 scope global dynamic ens5
          valid_lft 315102259sec preferred_lft 315102259sec
       inet6 fe80::216:3eff:fe06:6907/64 scope link 
          valid_lft forever preferred_lft forever
    3: tailscale0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc fq state UNKNOWN group default qlen 500
       link/none 
       inet 100.10.100.10/32 scope global tailscale0
          valid_lft forever preferred_lft forever
       inet6 fd7a:115c:a1e0::ed01:ce73/128 scope global 
          valid_lft forever preferred_lft forever
       inet6 fe80::ce3f:1239:c719:752b/64 scope link stable-privacy 
          valid_lft forever preferred_lft forever
    4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
       link/ether 02:42:36:31:ff:33 brd ff:ff:ff:ff:ff:ff
       inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
          valid_lft forever preferred_lft forever
       inet6 fe80::42:36ff:fe31:ff33/64 scope link 
          valid_lft forever preferred_lft forever
    
  10. fernandoenzo commented on Oct 9, 2024

    @fernandoenzo

    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

    root@1983:~# cat /etc/systemd/system/tailscaled.service.d/override.conf 
    [Unit]
       Wants=network-pre.target [email protected]@1983:~# 
    

    and the tailscale ping command also show IPv6 like I mentioned kinds of same as @mbilker #1552 (comment)

    root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic901) in 43ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic901) in 43ms
    ping "100.10.100.20" timed out
    ping "100.10.100.20" timed out
    ping "100.10.100.20" timed out
    pong from openwrt-cu (100.10.100.20) via [IPv6 Address]:41641 in 243ms
    
    root@1983:~# tailscale ping openwrt-cu (Both IPv4 and v6)
    pong from openwrt-cu (100.10.100.20) via [IPv6 Address]:41641 in 243ms
    
    root@1983:~# tailscale ping openwrt-cu
    ping "100.10.100.20" timed out
    ping "100.10.100.20" timed out
    pong from openwrt-cu (100.10.100.20) via [IPv6 Address]:41641 in 244ms
    
    root@1983:~# tailscale ping openwrt-ct (Only IPv4)
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic901) in 43ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic901) in 43ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic901) in 43ms
    pong from openwrt-ct (100.10.100.30) via [IPv4 address]:28585 in 41ms
    
    root@1983:~# tailscale ping iphone15 (Both IPv4 and v6)
    pong from iphone13 (100.10.100.50) via DERP(pbulic901) in 78ms
    pong from iphone13 (100.10.100.50) via DERP(pbulic901) in 127ms
    pong from iphone13 (100.10.100.50) via DERP(pbulic901) in 122ms
    ping "100.10.100.50" timed out
    ping "100.10.100.50" timed out
    pong from iphone13 (100.10.100.50) via [IPv6 Address_2]:41641 in 247ms
    

    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!

  11. gemnioo commented on Oct 9, 2024

    @gemnioo
    Author

    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.

    root@1983:~# ip route show table all
    100.10.100.10 dev tailscale0 table 52 
    100.10.100.20 dev tailscale0 table 52 
    100.10.100.30 dev tailscale0 table 52 
    100.100.100.100 dev tailscale0 table 52 
    100.10.100.40 dev tailscale0 table 52 
    100.10.100.50 dev tailscale0 table 52 
    100.10.100.60 dev tailscale0 table 52 
    100.10.100.70 dev tailscale0 table 52 
    192.168.10.0/24 dev tailscale0 table 52 
    192.168.100.0/24 dev tailscale0 table 52 
    default dev wgcf table 51888 scope link 
    default via 10.3.255.253 dev ens5 proto dhcp src 10.3.12.253 metric 100 
    10.3.0.0/16 dev ens5 proto kernel scope link src 10.3.12.253 metric 100 
    10.3.255.253 dev ens5 proto dhcp scope link src 10.3.12.253 metric 100 
    100.100.2.13* via 10.3.255.253 dev ens5 proto dhcp src 10.3.12.253 metric 100 
    100.100.2.13* via 10.3.255.253 dev ens5 proto dhcp src 10.3.12.253 metric 100 
    172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
    local 10.3.12.253 dev ens5 table local proto kernel scope host src 10.3.12.253 
    broadcast 10.3.255.255 dev ens5 table local proto kernel scope link src 10.3.12.253 
    local 100.10.100.10 dev tailscale0 table local proto kernel scope host src 100.10.100.10
    local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1 
    local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1 
    broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1 
    local 172.16.0.2 dev wgcf table local proto kernel scope host src 172.16.0.2 
    local 172.17.0.1 dev docker0 table local proto kernel scope host src 172.17.0.1 
    broadcast 172.17.255.255 dev docker0 table local proto kernel scope link src 172.17.0.1 linkdown 
    fd7a:115c:a1e0::53 dev tailscale0 table 52 metric 1024 pref medium
    fd7a:115c:a1e0::/48 dev tailscale0 table 52 metric 1024 pref medium
    default dev wgcf table 51888 metric 1024 pref medium
    2606:4700:110:821e:81e:3644:df34:8826 dev wgcf proto kernel metric 256 pref medium
    fd7a:115c:a1e0::ed01:ce73 dev tailscale0 proto kernel metric 256 pref medium
    fe80::/64 dev ens5 proto kernel metric 256 pref medium
    fe80::/64 dev tailscale0 proto kernel metric 256 pref medium
    fe80::/64 dev docker0 proto kernel metric 256 linkdown pref medium
    local ::1 dev lo table local proto kernel metric 0 pref medium
    local 2606:4800:110:521e:81e:3644:df34:8826 dev wgcf table local proto kernel metric 0 pref medium
    local fd7a:115c:a1e0::ed01:ce73 dev tailscale0 table local proto kernel metric 0 pref medium
    anycast fe80:: dev ens5 table local proto kernel metric 0 pref medium
    anycast fe80:: dev tailscale0 table local proto kernel metric 0 pref medium
    anycast fe80:: dev docker0 table local proto kernel metric 0 pref medium
    local fe80::42:36ff:fe31:ff33 dev docker0 table local proto kernel metric 0 pref medium
    local fe80::216:3eff:fe06:6907 dev ens5 table local proto kernel metric 0 pref medium
    local fe80::ce3f:1239:c719:752b dev tailscale0 table local proto kernel metric 0 pref medium
    multicast ff00::/8 dev ens5 table local proto kernel metric 256 pref medium
    multicast ff00::/8 dev tailscale0 table local proto kernel metric 256 pref medium
    multicast ff00::/8 dev docker0 table local proto kernel metric 256 linkdown pref medium
    multicast ff00::/8 dev wgcf table local proto kernel metric 256 pref medium
    
  12. gemnioo commented on Oct 11, 2024

    @gemnioo
    Author

    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....

    root@1983:~# docker-compose exec tailscale /bin/sh
    WARN[0000] /root/docker-compose.yml: `version` is obsolete
    / # tailscale up --ssh --accept-dns=false --accept-routes --advertise-exit-node --netfilter-mode=off
    Warning: netfilter=off; configure iptables yourself.
    Warning: IPv6 forwarding is disabled.
    Subnet routes and exit nodes may not work correctly.
    See https://tailscale.com/s/ip-forwarding
    / # tailscale status
    100.10.100.10 
    100.10.100.50 mac-mini             emailadd@    macOS   -
    100.10.100.30   openwrt-ct        emailadd@    linux   -
    100.10.100.20   openwrt-cu        emailadd@    linux   idle; offers exit node
    
    / # tailscale ping openwrt-cu
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 41ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    pong from openwrt-cu (100.10.100.20) via DERP(pbulic903) in 40ms
    direct connection not established
    / # tailscale ping japan
    pong from japan (100.10.100.100) via [IPv4 address]:41641 in 51ms
    / # tailscale ping openwrt-ct
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 45ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 44ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 43ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 43ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 44ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 44ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 43ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 44ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 44ms
    pong from openwrt-ct (100.10.100.30) via DERP(pbulic903) in 43ms
    direct connection not established
    / # tailscale ping mac-mini
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 42ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    pong from mac-mini (100.10.100.50) via DERP(pbulic903) in 41ms
    direct connection not established
    / # ping google.com
    PING google.com (142.250.66.46) 56(84) bytes of data.
    64 bytes from nchkgb-ag-in-f14.1e100.net (142.250.66.46): icmp_seq=1 ttl=57 time=2.85 ms
    64 bytes from nchkgb-ag-in-f14.1e100.net (142.250.66.46): icmp_seq=2 ttl=57 time=2.87 ms
    64 bytes from nchkgb-ag-in-f14.1e100.net (142.250.66.46): icmp_seq=3 ttl=57 time=2.82 ms
    64 bytes from nchkgb-ag-in-f14.1e100.net (142.250.66.46): icmp_seq=4 ttl=57 time=2.87 ms
    64 bytes from nchkgb-ag-in-f14.1e100.net (142.250.66.46): icmp_seq=5 ttl=57 time=2.84 ms
    ^C
    --- google.com ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4007ms
    rtt min/avg/max/mdev = 2.817/2.851/2.871/0.019 ms
    / # exit
    root@1983:~# ping google.com
    PING google.com(nchkga-ag-in-x0e.1e100.net (2404:6800:4005:81f::200e)) 56 data bytes
    64 bytes from nchkga-ag-in-x0e.1e100.net (2404:6800:4005:81f::200e): icmp_seq=1 ttl=117 time=306 ms
    64 bytes from nchkga-ag-in-x0e.1e100.net (2404:6800:4005:81f::200e): icmp_seq=2 ttl=117 time=5.05 ms
    64 bytes from nchkga-ag-in-x0e.1e100.net (2404:6800:4005:81f::200e): icmp_seq=3 ttl=117 time=5.13 ms
    ^C
    
  13. gemnioo commented on Nov 21, 2024

    @gemnioo
    Author

    update with the fix methods:just stop the WireGuard tunnnel and modify "nano /etc/wireguard/wgcf.conf" set to only Allow IPv6 traffic

    update 2.0: still not fixed. as the tailscale still traffic IPv6 to wgcf WireGuard Tunnel Interface when trying to connect IPv6 address

    [Interface]
    PrivateKey = [your client's private key]
    Address = [Wireguard-internal IPv6 address, e.g., fd00:abcd:1234::2/128]  \\delete any IPv4 address
    DNS = 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111, 2606:4700:4700::1001  \\set 1.1.1.1 and is okay as it's dual stack 
    
    [Peer]
    PublicKey = [public key of the server]
    Endpoint = [your server's public IP or domain]:51820
    AllowedIPs = ::/0  # This allows only IPv6 traffic through the tunnel  \\delete other line like  0.0.0.0/0
    PersistentKeepalive = 25
    

    then you can check with "ip add" to confirm wgcf network interface only working on IPv6

  14. gemnioo commented on Nov 21, 2024

    @gemnioo
    Author

    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:

    wgcf logs: ip -6 rule add not fwmark 51820 table 51820 
    

    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:

    wgcf logs: ip -6 route add ::/0 dev wgcf table 51820
    

    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.

    ip -6 rule add from fd7a:115c:a1e0<ur last IPv6 address> lookup main priority 100
    

    Viewing the main Routing Table

    ip -6 rule list
    

    Viewing the main Routing Table

    ip -6 route show table main
    
  15. gemnioo commented on Nov 21, 2024

    @gemnioo
    Author

    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.

    Wants=network-pre.target tailgate-allow ens5.service: This means that before tailscaled (the Tailscale daemon) starts, it will attempt to start the tailgate-allow ens5.service. This ensures that firewall rules are in place to allow Tailscale's traffic through the ens5 interface.
    

    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.

  16. gemnioo commented on Nov 21, 2024

    @gemnioo
    Author

    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]

    [Interface]
    PrivateKey = keykeykey
    Address = <IPv6 address>/128
    DNS = 1.1.1.1,2001:4860:4860::8888,2001:4860:4860::8844
    PostUp = ip -6 rule add from fd7a:115c:a1e0::d001:4a10 lookup main priority 100
    PostDown = ip -6 rule del from fd7a:115c:a1e0::d001:4a10 lookup main priority 100 || true
    
  17. gemnioo commented on Nov 22, 2024

    @gemnioo
    Author

    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:

    1. Tailscale is trying multiple connection methods:
    - via DERP(derp node) in 41ms                                     # Relay server
    - via [Private IPv6 address]:41641 in 245ms               # Direct IPv6
    - via <Private IPv4 Address>:35751 in 35ms               # Direct IPv4
    
    1. This is because Tailscale uses a protocol called "DERP" (Designated Encrypted Relay for Packets) and implements a feature called "path finding" which:
    • Attempts direct connections (both IPv4 and IPv6)
    • Falls back to DERP relay servers
    • Continuously probes all possible paths
    • Chooses the best available path based on latency and reliability

    Even though you've set up routing rules to prevent regular IPv6 traffic from going through wgcf, Tailscale's ping command

    • Bypasses normal routing tables
    • Directly attempts connections using all available network interfaces
    • Tests all possible paths regardless of system routing preferences

    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.

  18. locked as off topic and limited conversation to collaborators on Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    frneeds-triagevpn-interopwaiting-for-info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions