You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-35Lines changed: 34 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,24 @@ Set Linux as router in one command. Able to Provide Internet, or create Wifi hot
4
4
5
5
It wraps `iptables`, `dnsmasq` etc. stuff. Use in one command, restore in one command or by `control-c` (or even by closing terminal window).
6
6
7
-
[More tools and projects](https://garywill.github.io) | [🍻 Buy me a coffee ❤️](https://github.com/garywill/receiving/blob/master/receiving_methods.md)
7
+
[More tools and projects 🛠️](https://garywill.github.io) | [🍻 Buy me a coffee ❤️](https://github.com/garywill/receiving/blob/master/receiving_methods.md)
8
8
9
9
## Features
10
10
11
11
Basic features:
12
12
13
13
- Create a NATed sub-network
14
14
- Provide Internet
15
-
- DHCP server and RA
16
-
- DNS server
15
+
- DHCP server (and RA) + DNS server
16
+
- Configuring what DNS the DHCP server offers to clients
17
+
- Configuring upstream DNS for local DNS server (kind of a DNS proxy)
17
18
- IPv6 (behind NATed LAN, like IPv4)
18
19
- Creating Wifi hotspot:
19
20
- Channel selecting
20
21
- Choose encryptions: WPA2/WPA, WPA2, WPA, No encryption
21
-
- Create AP on the same interface you are getting Internet (require same channel)
22
+
- Create AP on the same interface you are getting Internet (usually require same channel)
22
23
- Transparent proxy (redsocks)
23
-
- DNS proxy
24
+
-Transparent DNS proxy (hijack port 53 packets)
24
25
- Compatible with NetworkManager (automatically set interface as unmanaged)
25
26
26
27
**For many other features, see below [CLI usage](#cli-usage-and-other-features)**
--no-haveged Do not run haveged automatically when needed
355
354
356
355
Instance managing:
@@ -366,7 +365,7 @@ Options:
366
365
```
367
366
368
367
</details>
369
-
368
+
370
369
## Notice
371
370
372
371
<details>
@@ -400,11 +399,11 @@ On exit of a linux-router instance, script **will do cleanup**, i.e. undo most c
400
399
- dnsmasq
401
400
- iptables (or nftables with `iptables-nft` translation linked)
402
401
- WiFi hotspot dependencies
403
-
- hostapd
404
-
- iw
405
-
- iwconfig (you only need this if 'iw' can not recognize your adapter)
406
-
- haveged (optional)
407
-
- qrencode (optional)
402
+
- hostapd
403
+
- iw
404
+
- iwconfig (you only need this if 'iw' can not recognize your adapter)
405
+
- haveged (optional)
406
+
- qrencode (optional)
408
407
409
408
## TODO
410
409
@@ -478,12 +477,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
478
477
479
478
## Meet developer(s) and become one of them
480
479
481
-
Visit [**my homepage**](https://garywill.github.io) to see **more tools and projects**.
480
+
Visit [**my homepage** 🏡](https://garywill.github.io) to see **more tools and projects** 🛠️.
482
481
483
-
> [Buy me a coffee](https://github.com/garywill/receiving/blob/master/receiving_methods.md) , this project took me lots of time! ([打赏一个!](https://github.com/garywill/receiving/blob/master/receiving_methods.md))
482
+
> [❤️ Buy me a coffee](https://github.com/garywill/receiving/blob/master/receiving_methods.md) , this project took me lots of time! ([❤️ 打赏一个!](https://github.com/garywill/receiving/blob/master/receiving_methods.md))
484
483
>
485
484
> 🥂 ( ^\_^) o自自o (^_^ ) 🍻
486
485
487
486
🤝 Bisides, thank [create_ap](https://github.com/oblique/create_ap) by [oblique](https://github.com/oblique). This script was forked from create\_ap. Now they are quite different. (See `history` branch for how I modified create_ap). 🤝 Also thank those who contributed to that project.
488
487
489
-
🤝 You can be contributor, too! There're some TO-DOs listed, at both above and in the code file. Your name can be here!
488
+
👨💻 You can be contributor, too! 🍃 There're some TO-DOs listed, at both above and in the code file. Also some unfulfilled enhancements in the Issues. Your name can be here!
if [[ "$(firewall-cmd --state)"=="running" ]];then
826
+
if [[ "$(firewall-cmd --state2>&1)"=="running" ]];then
825
827
echo"firewalld is running ($(firewall-cmd --version))"
826
828
echo -e "\nWARN: We haven't completed the compatibility with firewalld.\nWARN: If you see any trouble, try:\nWARN: 1) 'firewall-cmd --zone=trusted --add-interface=<SUBN_IFACE>'\nWARN: 2) disable firewalld\n">&2
827
829
# TODO
@@ -887,6 +889,7 @@ start_ban_lan() {
887
889
echo
888
890
echo"iptables: Disallow clients to access LAN"
889
891
iptables_ -N BANLAN-f-${SUBNET_IFACE}|| die
892
+
# TODO: allow '--dhcp-dns(6)' address port 53, which can be something needed, e.g. a VPN's internal private IP
890
893
iptables_ -v -I BANLAN-f-${SUBNET_IFACE} -d 0.0.0.0/8 -j REJECT || die # TODO: use array
891
894
iptables_ -v -I BANLAN-f-${SUBNET_IFACE} -d 10.0.0.0/8 -j REJECT || die
892
895
iptables_ -v -I BANLAN-f-${SUBNET_IFACE} -d 100.64.0.0/10 -j REJECT || die
@@ -902,7 +905,7 @@ start_ban_lan() {
902
905
iptables_ -N BANLAN-i-${SUBNET_IFACE}
903
906
#iptables_ -v -I BANLAN-i-${SUBNET_IFACE} -i ${SUBNET_IFACE} -j REJECT || die
@@ -2060,7 +2066,7 @@ if [[ "$SHARE_METHOD" == "none" ]]; then
2060
2066
2061
2067
elif [[ "$SHARE_METHOD"=="nat" ]];then
2062
2068
2063
-
[[ "$INTERNET_IFACE"&&"$dnsmasq_NO_DNS"-eq 0 ]] &&echo -e "\nWARN: You specified Internet interface but this host is providing local DNS, queries may leak to other interfaces!!!\n">&2
2069
+
[[ "$INTERNET_IFACE"&&"$dnsmasq_NO_DNS"-eq 0 ]] &&echo -e "\nWARN: You specified Internet interface but this host is providing local DNS. In some unexpected case (eg. mistaken configurations), queries may leak to other interfaces, which you should be aware of.\n">&2
echo 1 >"/proc/sys/net/ipv6/conf/$SUBNET_IFACE/forwarding"|| die "Failed enabling $SUBNET_IFACE ipv6 forwarding"# to set NA router bit
2083
2089
fi
2084
2090
2085
-
[[ "$dnsmasq_NO_DNS"-eq 0 &&!$DNS ]] &&echo -e "\nWARN: You are using in transparent proxy mode but this host is providing local DNS, this may cause privacy leak !!!\n">&2
2091
+
[[ "$dnsmasq_NO_DNS"-eq 0 &&!$DNS ]] &&echo -e "\nWARN: You are using in transparent proxy mode but this host is providing local DNS. In some unexpected case (eg. mistaken configurations), queries may leak to other interfaces, which you should be aware of.\n">&2
0 commit comments