garywill / linux-router

Set Linux as router in one command. Support Internet sharing, redsocks, Wifi hotspot, IPv6. Can also be used for routing VM/containers 🛰️ (也欢迎关注B站 https://space.bilibili.com/2123686105 )
GNU Lesser General Public License v2.1
1.71k stars 152 forks source link

Request for clarification regarding OpenWrt #24

Open sheilbronn opened 2 years ago

sheilbronn commented 2 years ago

Hi! This is more a request for clarification rather than filing an concrete issue: Will linux-router also work with OpenWrt?

garywill commented 2 years ago

Hi there! Thanks for question. This is the first time we hearing from OpenWrt user!

Our script has been used by many computer and RPi users. As for router devices, I myself have (only) one running Linux. It has a broadcom chip. masquerade/forwarding is not handled by Linux, but by hardware. So no iptables. And it hasn't hostapd, wifi is handled by hardware too. So I've never tested this script on that router.

Though, router devices have different models. Looking forward to hearing other router device users' feedback!

sheilbronn commented 2 years ago

So you're saying that - since OpenWrt has iptables and hostapd - I should be giving it a try?!

garywill commented 2 years ago

Yes, why not? Just one command. Make sure meet the required dependencies

atrent commented 2 years ago

What would be the purpose of linux-router on a... router?

garywill commented 2 years ago

I think I didn't make clear enough on yesterday's reply.

Having hostapd and iptables installed is not the key. Key is: Hardware or software mode the device is

If one router

then I believe 99% there's chance we can make our script work.

To check S or H, we can check:

That's not all. Router may have something set by default, eg VLANs, which not taken into account by our script yet. (So welcome users' feedback)

What would be the purpose of linux-router on a... router?

Hmmm... maybe our transparent proxy feature?

sheilbronn commented 2 years ago

What would be the purpose of linux-router on a... router?

... easily added additional SSID's...

sheilbronn commented 2 years ago

I think I didn't make clear enough on yesterday's reply.

... If one router

* is a "software router"

* or is a "hardware router" which can also be set to "software" mode

then I believe 99% there's chance we can make our script work.

To check S or H, we can check:

* use `tcpdump` to see if all traffics passing the router physically reach Linux or not
  (not only those traffic from/to router itself, eg our SSH connection from PC to router)

* is iptables (or nft) empty or not

* is a `hostapd` process running when wifi's on

* ......

I wanted to try it on a Freifunk node (based on Gluon, based on OpenWrt, hardware is TP-Link TL-WR810N) to add an additional SSID. The node (being based on OpenWrt) has a non-empty iptables (iptables --list), a running hostapd process and all traffic is encrypted before being tunneled through a Wireguard VPN. So I assume strongly, that the kernel sees all traffic....

atrent commented 2 years ago

What would be the purpose of linux-router on a... router?

... easily added additional SSID's...

this is a standard (and easily configured via luci or config files) feature of OpenWrt

sheilbronn commented 2 years ago

What would be the purpose of linux-router on a... router?

... easily added additional SSID's...

this is a standard (and easily configured via luci or config files) feature of OpenWrt

Yes, regarding OpenWrt you're right, but maybe not for Gluon and/or Freifunk (which I would like try out as soon as I have another device to experiment with)