After installing netbird in openwrt, how can I enable the machine behind openwrt to use netbird's routes? #527

Closed
opened 2025-11-20 05:13:01 -05:00 by saavagebueno · 4 comments
Owner

Originally created by @Horus-K on GitHub (Nov 30, 2023).

when op connect netbird
image
image

Nodes behind openwrt cannot connect to routed IPs

Originally created by @Horus-K on GitHub (Nov 30, 2023). when op connect netbird ![image](https://github.com/netbirdio/netbird/assets/48319268/f51c2b79-ddc2-48c7-a449-37b5e6bf2f68) ![image](https://github.com/netbirdio/netbird/assets/48319268/1300cee8-b5c7-4388-849c-b424076afa94) Nodes behind openwrt cannot connect to routed IPs
Author
Owner

@viccom commented on GitHub (Dec 12, 2023):

This problem does exist when using netbird on openwrt, and the OP's intranet cannot be accessed.
At first, I thought it was a configuration problem.
Under C:\ ProgramData\ Netbird, I found a config.json file with the following content:
"IFaceBlackList": [
"Wt0",
"Wt",
"Utun",
"Tun0",
"Zt",
"ZeroTier",
"Wg",
"Ts",
"Tailscale",
"The tailscale",
"Docker",
"Veth",
"Br-",
"Lo"
],
It was later discovered that the config.json file is not a configuration file, but a status file.

@viccom commented on GitHub (Dec 12, 2023): This problem does exist when using netbird on openwrt, and the OP's intranet cannot be accessed. At first, I thought it was a configuration problem. Under C:\ ProgramData\ Netbird, I found a config.json file with the following content: "IFaceBlackList": [ "Wt0", "Wt", "Utun", "Tun0", "Zt", "ZeroTier", "Wg", "Ts", "Tailscale", "The tailscale", "Docker", "Veth", "Br-", "Lo" ], It was later discovered that the config.json file is not a configuration file, but a status file.
Author
Owner

@Horus-K commented on GitHub (Dec 12, 2023):

set iptable

iptables -I FORWARD -o br-lan -j ACCEPT
iptables -I FORWARD -o wt0 -j ACCEPT
iptables -t nat -I POSTROUTING -o wt0 -j MASQUERADE
This is effective

@Horus-K commented on GitHub (Dec 12, 2023): # set iptable iptables -I FORWARD -o br-lan -j ACCEPT iptables -I FORWARD -o wt0 -j ACCEPT iptables -t nat -I POSTROUTING -o wt0 -j MASQUERADE This is effective
Author
Owner

@jiangslee commented on GitHub (Dec 19, 2023):

set iptable

iptables -I FORWARD -o br-lan -j ACCEPT iptables -I FORWARD -o wt0 -j ACCEPT iptables -t nat -I POSTROUTING -o wt0 -j MASQUERADE This is effective

@Horus-K 老哥,我也遇到你这个问题:

  • 这样不行:mbp(netbird)--->openwrt(netbird)--->外网--->远端设备(netbird route)--->内网设备
  • 这样就OK:mbp--->openwrt(netbird)--->外网--->远端设备(netbird route)--->内网机器

按你这个iptable设置后好像还是不行,你那解决了吗?

@jiangslee commented on GitHub (Dec 19, 2023): > # set iptable > iptables -I FORWARD -o br-lan -j ACCEPT iptables -I FORWARD -o wt0 -j ACCEPT iptables -t nat -I POSTROUTING -o wt0 -j MASQUERADE This is effective @Horus-K 老哥,我也遇到你这个问题: - 这样不行:mbp(netbird)--->openwrt(netbird)--->外网--->远端设备(netbird route)--->内网设备 - 这样就OK:mbp--->openwrt(netbird)--->外网--->远端设备(netbird route)--->内网机器 按你这个iptable设置后好像还是不行,你那解决了吗?
Author
Owner

@jiangslee commented on GitHub (Dec 19, 2023):

root@iStoreOS:~# iptables -I FORWARD -o br-lan -j ACCEPT
root@iStoreOS:~# iptables -I FORWARD -o wt0 -j ACCEPT
root@iStoreOS:~# iptables -t nat -I POSTROUTING -o wt0 -j MASQUERADE
root@iStoreOS:~# exit
Connection to 192.168.100.1 closed.
~$ ping 192.168.2.10                                                                                                                                       
PING 192.168.2.10 (192.168.2.10): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- 192.168.2.10 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss

关闭mbp的netbird,就能通过openwrt ping通远端内网设备

~$ netbird status                                                                                                                                          
Daemon version: 0.24.4
CLI version: 0.24.4
Management: Disconnected
Signal: Disconnected
FQDN: 
NetBird IP: N/A
Interface type: N/A
Peers count: 0/0 Connected
~$ ping 192.168.2.10                                                                                                                                       
PING 192.168.2.10 (192.168.2.10): 56 data bytes
64 bytes from 192.168.2.10: icmp_seq=0 ttl=62 time=11.710 ms
64 bytes from 192.168.2.10: icmp_seq=1 ttl=62 time=5.434 ms
64 bytes from 192.168.2.10: icmp_seq=2 ttl=62 time=11.927 ms
^C
--- 192.168.2.10 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 5.434/9.690/11.927/3.011 ms
@jiangslee commented on GitHub (Dec 19, 2023): ``` root@iStoreOS:~# iptables -I FORWARD -o br-lan -j ACCEPT root@iStoreOS:~# iptables -I FORWARD -o wt0 -j ACCEPT root@iStoreOS:~# iptables -t nat -I POSTROUTING -o wt0 -j MASQUERADE root@iStoreOS:~# exit Connection to 192.168.100.1 closed. ~$ ping 192.168.2.10 PING 192.168.2.10 (192.168.2.10): 56 data bytes Request timeout for icmp_seq 0 Request timeout for icmp_seq 1 ^C --- 192.168.2.10 ping statistics --- 3 packets transmitted, 0 packets received, 100.0% packet loss ``` 关闭mbp的netbird,就能通过openwrt ping通远端内网设备 ``` ~$ netbird status Daemon version: 0.24.4 CLI version: 0.24.4 Management: Disconnected Signal: Disconnected FQDN: NetBird IP: N/A Interface type: N/A Peers count: 0/0 Connected ~$ ping 192.168.2.10 PING 192.168.2.10 (192.168.2.10): 56 data bytes 64 bytes from 192.168.2.10: icmp_seq=0 ttl=62 time=11.710 ms 64 bytes from 192.168.2.10: icmp_seq=1 ttl=62 time=5.434 ms 64 bytes from 192.168.2.10: icmp_seq=2 ttl=62 time=11.927 ms ^C --- 192.168.2.10 ping statistics --- 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 5.434/9.690/11.927/3.011 ms ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#527