I try to access C with Zerotier net from A. Only B and C in the same Zerotir net.
Client A
|
Internet
|
Zerotier B($WAN_IP/192.168.194.1)
|
Internet(through Zerotier Network 192.168.194.0/24)
|
Zerotier C (192.168.194.75)
@B: ip route show
192.168.194.0/24 dev $ZT proto kernel scope link src 192.168.194.1
and route udp traffic with iptables from eth0
to $ZT
@B: iptables -t nat -A PREROUTING -p udp --dport $B_port -j DNAT --to-destination 192.168.194.75:$C_port
@B: iptables -A FORWARD -p udp -i eth0 -o $ZT -d 192.168.194.75 -j ACCEPT
@B: iptables -t nat -A POSTROUTING -o $ZT -p udp --dport $C_PORT -j LOG --log-prefix "POSTROUTING: " --log-level 4
rule 1 and 2 hit but 3 has no pkts
Should I bridge $ZT and eth0
?
nc -u
works between A to B
@A: echo "Test" | nc -u $WAN_IP $B_PORT
and @B: nc -u -l $B_PORT
and B to C
@B: nc -u 192.168.194.75 $CPORT
and @C: nc -u -l $B_PORT
and tcpdump
in B shows
@B:tcpdump -i eth0 udp
IP $A_IP.56388 > $B_Host.21116: UDP, length 15
@B:tcpdump -i $ZT udp
Nothing