-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to the server instance (OpenWrt) #523
Comments
"Wireguard port being used" is not relevant to iptables or nftables rules or udp2raw can connect or not. If it says port occupied there must be some problem in otherwhere. Check your settings of wireguard, and see if you specific some source port to use. Remove the source port or change to another source port. On the client side it's typically not necessary to specify a source port. |
I commented out the ListenPort in the wireguard client config, so it picks a random port on startup. After bringing wireguard up, I take note of the port number and pass it to the udp2raw client command: I'm about to give up trying to run udp2raw on OpenWrt. I've used it successfully before on a Raspberry Pi. I just wonder if it's possible to keep wireguard on the router, and run udp2raw somewhere else in the LAN. EDIT: I realized I should not use the ListenPort (random) in the udp2raw |
I moved the udp2raw server to a system running Alpine Linux, and the problem persists.
At this point I turn on Wireguard...
My steps:
Relevant log line:
@wangyu- What does this mean? Server info:
|
It simply means the connection is broken.
Very likely, your wireguard is redirecting the route 0.0.0.0/0. And your udp2raw is hijacked by wireguard. Then it forms a traffic loop. Have you added the route exception for udp2raw? https://github.com/wangyu-/udp2raw/wiki/udp2raw-openvpn-config-guide
|
try on client side:
|
Ah, I think I understand now. I have AllowedIPs set to unspecified on the client — tunneling everything through Wireguard, even udp2raw. The exception you suggested ensures udp2raw can talk "in the clear", outside of the Wireguard tunnel. I just tested tunneling only local networks over Wireguard by setting AllowedIPs accordingly, and udp2raw works as expected — this is actually how I was running a few months ago, but now I need to tunnel internet traffic too. Will try the route exception now. |
Oops, accidentally posted my password just now. Ugh... will have to change it. After adding the route, I'm still having trouble.
EDIT: forgot to add command I used to add route. ip route add PUBLIC_IPV4 via 192.168.1.1 192.168.1.1 is the default gateway in this client system. EDIT 2: Server logs (shortened):
The timestamps don't match with the client because I repeated the process later just to capture the server logs. "oxygen" is the udp2raw server, but the Wireguard server is actually on another device (OpenWrt router, 192.168.1.1). I also noticed firewall counters are zeroed on both server and client:
|
In your first post you are using
But in your lastest post you removed.
why do you make the change? I tested udp2raw+wireguard with iptables, it worked well. I don't use nftables. Cannot figure out what is going wrong for you. I suggest you setup both side with iptables first, and make sure it works first. Then move to nftables and compare what is different. |
I've added the rules myself. In the at-server-side section it says I need to enable ip forwarding and apply that NAT rule. Is it really needed? |
It depends on your use case. Typically:
|
I think i am likely not going to follow up this issue in further, since many newbie mistakes and questions were showing up. |
If you still want to make it work. My suggestion:
First, as I mentioned, try stick to iptables until you are successful. (After you make sure it works then you can explore how to switch to nft) Learn from those article:
(try to understand the articles and adapt to your use case) |
Sorry about that. I'm studying the links you provided. It's working now, with the server running on OpenWrt again — it's easier there. That means that this is not a bug. One little problem remains: Client nftables:
Server nftables:
The rules have hits, and I see that the bytes keep increasing during usage — a sign that it's working. As I don't see any negative impact on the connection — and I cannot use iptables on OpenWrt — I'm ignoring the warnings for now. Do you think this could be a bug? I can file a separate issue for that. |
Have you tried to use iptables I suggested in the posts above?
I think very likely it's not a bug. you are not using udp2raw generated iptables rules. Instead you are using the ntf tables rule (that you believe it's equivalent, but in reality it might not.) It's your nft rule is not working as expected. It's not bug on udp2raw side. |
If it doesn't have negative impact on your environemnt then it's fine. But
I think ntf has iptables compatible layer have you tried this? https://openwrt.org/packages/pkgdata/iptables-nft |
You're right. I believed they were equivalent, but they're not. Ran a test with the
Thanks for the help. |
Client
System info:
udp2raw_amd64
Server
System info:
udp2raw_mips24kc_le
/etc/config/firewall
/etc/udp2raw.nft
/etc/init.d/udp2raw
[INFO](re)sent tcp syn
echoing forever). It seems the DROP rules are not working as expected.The text was updated successfully, but these errors were encountered: