Trying to run TCP and UDP side by side

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • derrickblast
    Junior Member
    • Dec 2024
    • 2

    Trying to run TCP and UDP side by side

    Greetings! I am running two instances (2.6) on the same server, one is TCP and one is UDP.

    I set the UDP server to be 10.8.0.0/255.255.255.0 and the TCP server to be 10.8.1.0/255.255.255.0.

    TCP server:
    Code:
    port 1111
    proto tcp-server
    dev tun
    topology subnet
    push "topology subnet"
    server 10.8.1.0 255.255.255.0 nopool
    push "route 10.8.0.0 255.255.255.0"
    client-config-dir ccd-tcp
    ccd-exclusive
    client-to-client
    UDP server:
    Code:
    port 2222
    proto udp
    dev tun
    topology subnet
    push "topology subnet"
    server 10.8.0.0 255.255.255.0 nopool
    push "route 10.8.1.0 255.255.255.0"
    client-config-dir ccd
    ccd-exclusive
    client-to-client​
    ​

    I would like all the clients to be able to communicate even across the two subnets. Reason I am running TCP and UDP: So if whatever WiFi I am on is blocking UDP, I can switch to TCP and am able to connect.

    But since my client TCP subnet is 10.8.1.x it can't reach other UDP clients on the 10.8.0.x network. They are all the same clients, with the same certificates, since they will only ever connect once (either via TCP or UDP). I am able to ping both gateways (10.8.0.1 and 10.8.1.1) but can't ping from my client (10.8.1.100) to for example another client 10.8.0.106. I ran TCPDUMP on the server on both tun0 and tun1, and I see the ping ECHO request, but no reply. I can ping any IP from the server.

    I have not added ANY other routes (that actually worked).

    So.. is there a way I can simplify and still run a TCP and UDP server? I tried sharing the subnet but that seemed not to work.

    I tried adding lots of different routes on the server to no avail, but I am not a network expert so I think I am doing something wrong. Any help is greatly appreciated!
  • derrickblast
    Junior Member
    • Dec 2024
    • 2

    #2
    Well I have a solution but it was by accident. Originally I was running UFW (a.k.a. iptables firewall) but it was blocking too much tunnel traffic so I just disabled it in order to try to test different routes. Well, I turned it back on and ran some tests, and of course, it was blocking tunnel traffic. I added some "ufw route" entries for tunnel traffic (probably too many...) and incredibly I can cross subnets now! So with firewall disabled, it wasn't working, but with firewall on and tunnel forwarding in iptables, it is working.

    Comment

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎