Skip to content

Commit 61a5af2

Browse files
committed
more text
1 parent d2bc2d9 commit 61a5af2

File tree

2 files changed

+42
-15
lines changed

2 files changed

+42
-15
lines changed

README.md

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,45 @@ Internet----(eth0/wlan0)-Linux-(virtual interface)-----VM/container
6262

6363
### Provide Internet to an interface
6464

65+
No matter which interface (other than `eth1`) you're getting Internet from
66+
6567
```
6668
sudo lnxrouter -i eth1
6769
```
6870

69-
### Provide an interface's Internet to another interface
71+
### Create Wifi hotspot
72+
73+
No matter which interface you're getting Internet from (even from `wlan0`)
7074

7175
```
72-
sudo lnxrouter -i eth1 -o vpn0 --dhcp-dns 1.1.1.1 -6 --dhcp-dns6 [2606:4700:4700::1111]
76+
sudo lnxrouter --ap wlan0 MyAccessPoint -p MyPassPhrase
7377
```
74-
> Read _Notice 1_
7578

76-
### Create Wifi hotspot
79+
It will create virtual Interface `x0wlan0` for hotspot.
80+
81+
### Provide an interface's Internet to another interface
82+
83+
Clients access Internet through only `isp5`
84+
85+
<details>
7786

7887
```
79-
sudo lnxrouter --ap wlan0 MyAccessPoint -p MyPassPhrase
88+
sudo lnxrouter -i eth1 -o isp5 --no-dns --dhcp-dns 1.1.1.1 -6 --dhcp-dns6 [2606:4700:4700::1111]
8089
```
8190

91+
It's recommended to:
92+
93+
1. Stop serving local DNS to clients on our Linux host
94+
2. Tell clients which DNS to use (ISP5's DNS. Or, a safe public DNS, like above example)
95+
96+
> Also, read *Notice 1*
97+
98+
</details>
99+
82100
### LAN without Internet
83101

84102
<details>
85103

86-
87104
```
88105
sudo lnxrouter -n -i eth1
89106
sudo lnxrouter -n --ap wlan0 MyAccessPoint -p MyPassPhrase
@@ -118,14 +135,14 @@ sudo lnxrouter -i lxcbr5
118135

119136
</details>
120137

121-
### Transparent proxy
138+
### Transparent proxy
122139

123-
For example through Tor
140+
All clients' Internet traffic go through, for example, Tor
124141

125142
<details>
126143

127144
```
128-
sudo lnxrouter -i eth1 --tp 9040 --dns 9053 -g 192.168.55.1 --p6 fd00:5:6:7::
145+
sudo lnxrouter -i eth1 --tp 9040 --dns 9053 -g 192.168.55.1 -6 --p6 fd00:5:6:7::
129146
```
130147

131148
In `torrc`
@@ -237,7 +254,7 @@ sudo brctl addbr firejail5
237254

238255
```
239256
sudo lnxrouter -i firejail5 -g 192.168.55.1 --tp 9040 --dns 9053
240-
firejail --net=firejail5 --dns=192.168.55.1 --blacklist=/var/run/nscd # nscd is cache service, which shouldn't be accessable here
257+
firejail --net=firejail5 --dns=192.168.55.1 --blacklist=/var/run/nscd # nscd is cache service, which shouldn't be accessed in jail here
241258
```
242259

243260
</details>
@@ -283,11 +300,13 @@ Options:
283300
whose destination port is 53 to this host
284301
--log-dns Show DNS query log
285302
--dhcp-dns <IP1[,IP2]>|no
286-
Set IPv4 DNS offered by DHCP (default: this host)
303+
Set IPv4 DNS offered by DHCP (default: this host).
304+
This will enable '--no-dns' (Do not serve DNS)
287305
--dhcp-dns6 <IP1[,IP2]>|no
288306
Set IPv6 DNS offered by DHCP (RA)
289307
(default: this host)
290308
(Note IPv6 addresses need '[]' around)
309+
This will enable '--no-dns' (Do not serve DNS)
291310
--hostname <name> DNS server associate this name with this host.
292311
Use '-' to read name from /etc/hostname
293312
-d DNS server will take into account /etc/hosts
@@ -344,7 +363,15 @@ Options:
344363
--stop <id> Stop a running instance
345364
For <id> you can use PID or subnet interface name.
346365
You can get them with '--list-running'
366+
```
347367

368+
</details>
369+
370+
## Notice
371+
372+
<details>
373+
374+
```
348375
Notice 1: This script assume your host's default policy won't forward
349376
packets, so the script won't explictly ban forwarding in any
350377
mode. In some unexpected case may cause unwanted packets
@@ -356,9 +383,7 @@ Options:
356383

357384
## What changes are done to Linux system
358385

359-
On exit of an instance, script will do cleanup, i.e. undo the changes to system. Though, some changes won't be restored.
360-
361-
These changes to system will **not** be restored by script's cleanup:
386+
On exit of a linux-router instance, script **will do cleanup**, i.e. undo most changes to system. Though, **some** changes will **not** be undone, which are:
362387

363388
1. `/proc/sys/net/ipv4/ip_forward = 1` and `/proc/sys/net/ipv6/conf/all/forwarding = 1`
364389
2. dnsmasq (if used) in Apparmor complain mode

lnxrouter

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ Options:
5252
whose destination port is 53 to this host
5353
--log-dns Show DNS query log
5454
--dhcp-dns <IP1[,IP2]>|no
55-
Set IPv4 DNS offered by DHCP (default: this host)
55+
Set IPv4 DNS offered by DHCP (default: this host).
56+
This will enable '--no-dns' (Do not serve DNS)
5657
--dhcp-dns6 <IP1[,IP2]>|no
5758
Set IPv6 DNS offered by DHCP (RA)
5859
(default: this host)
5960
(Note IPv6 addresses need '[]' around)
61+
This will enable '--no-dns' (Do not serve DNS)
6062
--hostname <name> DNS server associate this name with this host.
6163
Use '-' to read name from /etc/hostname
6264
-d DNS server will take into account /etc/hosts

0 commit comments

Comments
 (0)