Compare commits
4 Commits
f6995bc30c
...
9e1d985623
Author | SHA1 | Date |
---|---|---|
|
9e1d985623 | |
|
433b3b8d39 | |
|
e8284c5398 | |
|
c2da43250e |
16
README.md
16
README.md
|
@ -92,7 +92,7 @@ sudo lnxrouter -i eth1 -o isp5 --no-dns --dhcp-dns 1.1.1.1 -6 --dhcp-dns6 [26
|
||||||
> In this case of usage, it's recommended to:
|
> In this case of usage, it's recommended to:
|
||||||
>
|
>
|
||||||
> 1. Stop serving local DNS
|
> 1. Stop serving local DNS
|
||||||
> 2. Tell clients which DNS to use (ISP5's DNS. Or, a safe public DNS, like above example)
|
> 2. Tell clients which DNS to use ISP5's DNS. (Or, a safe public DNS, like above example)
|
||||||
|
|
||||||
> Also, read *Notice 1*
|
> Also, read *Notice 1*
|
||||||
|
|
||||||
|
@ -317,6 +317,7 @@ Options:
|
||||||
-d DNS server will take into account /etc/hosts
|
-d DNS server will take into account /etc/hosts
|
||||||
-e <hosts_file> DNS server will take into account additional
|
-e <hosts_file> DNS server will take into account additional
|
||||||
hosts file
|
hosts file
|
||||||
|
--dns-nocache DNS server no cache
|
||||||
|
|
||||||
--mac <MAC> Set MAC address
|
--mac <MAC> Set MAC address
|
||||||
--random-mac Use random MAC address
|
--random-mac Use random MAC address
|
||||||
|
@ -330,7 +331,7 @@ Options:
|
||||||
Create WiFi access point
|
Create WiFi access point
|
||||||
-p, --password <password>
|
-p, --password <password>
|
||||||
WiFi password
|
WiFi password
|
||||||
--qr Show WiFi QR code in terminal
|
--qr Show WiFi QR code in terminal (need qrencode)
|
||||||
|
|
||||||
--hidden Hide access point (not broadcast SSID)
|
--hidden Hide access point (not broadcast SSID)
|
||||||
--no-virt Do not create virtual interface
|
--no-virt Do not create virtual interface
|
||||||
|
@ -397,6 +398,16 @@ On exit of a linux-router instance, script **will do cleanup**, i.e. undo most c
|
||||||
5. The wifi device which is used to create hotspot is `rfkill unblock`ed
|
5. The wifi device which is used to create hotspot is `rfkill unblock`ed
|
||||||
6. WiFi country code, if user assigns
|
6. WiFi country code, if user assigns
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
1-file-script. Download and run (meet the dependencies).
|
||||||
|
|
||||||
|
I'm currently not packaging for any distro. If you do, open a PR and add the link (can be with a version badge) to list here:
|
||||||
|
|
||||||
|
| Linux distro | |
|
||||||
|
| ------------ | ---------------------------------------------------------------------------------------------------------- |
|
||||||
|
| Any | download [1-file-script](https://raw.githubusercontent.com/garywill/linux-router/master/lnxrouter) and run |
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
- bash
|
- bash
|
||||||
|
@ -409,7 +420,6 @@ On exit of a linux-router instance, script **will do cleanup**, i.e. undo most c
|
||||||
- iw
|
- iw
|
||||||
- iwconfig (you only need this if 'iw' can not recognize your adapter)
|
- iwconfig (you only need this if 'iw' can not recognize your adapter)
|
||||||
- haveged (optional)
|
- haveged (optional)
|
||||||
- qrencode (optional)
|
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
|
|
12
lnxrouter
12
lnxrouter
|
@ -67,6 +67,7 @@ Options:
|
||||||
-d DNS server will take into account /etc/hosts
|
-d DNS server will take into account /etc/hosts
|
||||||
-e <hosts_file> DNS server will take into account additional
|
-e <hosts_file> DNS server will take into account additional
|
||||||
hosts file
|
hosts file
|
||||||
|
--dns-nocache DNS server no cache
|
||||||
|
|
||||||
--mac <MAC> Set MAC address
|
--mac <MAC> Set MAC address
|
||||||
--random-mac Use random MAC address
|
--random-mac Use random MAC address
|
||||||
|
@ -80,7 +81,7 @@ Options:
|
||||||
Create WiFi access point
|
Create WiFi access point
|
||||||
-p, --password <password>
|
-p, --password <password>
|
||||||
WiFi password
|
WiFi password
|
||||||
--qr Show WiFi QR code in terminal
|
--qr Show WiFi QR code in terminal (need qrencode)
|
||||||
|
|
||||||
--hidden Hide access point (not broadcast SSID)
|
--hidden Hide access point (not broadcast SSID)
|
||||||
--no-virt Do not create virtual interface
|
--no-virt Do not create virtual interface
|
||||||
|
@ -156,6 +157,7 @@ define_global_variables(){
|
||||||
SHOW_DNS_QUERY=0 # log dns
|
SHOW_DNS_QUERY=0 # log dns
|
||||||
ETC_HOSTS=0
|
ETC_HOSTS=0
|
||||||
ADDN_HOSTS=
|
ADDN_HOSTS=
|
||||||
|
DNS_NOCACHE=
|
||||||
CONN_IFACE= # which interface user choose to use to create network
|
CONN_IFACE= # which interface user choose to use to create network
|
||||||
INTERNET_IFACE= # which interface to get Internet from
|
INTERNET_IFACE= # which interface to get Internet from
|
||||||
THISHOSTNAME= # this host's name the DNS tells clients
|
THISHOSTNAME= # this host's name the DNS tells clients
|
||||||
|
@ -322,6 +324,10 @@ parse_user_options(){
|
||||||
ADDN_HOSTS="$1"
|
ADDN_HOSTS="$1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--dns-nocache)
|
||||||
|
shift
|
||||||
|
DNS_NOCACHE=1
|
||||||
|
;;
|
||||||
|
|
||||||
--isolate-clients)
|
--isolate-clients)
|
||||||
shift
|
shift
|
||||||
|
@ -1822,6 +1828,10 @@ write_dnsmasq_conf() {
|
||||||
no-poll
|
no-poll
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
if [[ $DNS_NOCACHE -eq 1 ]]; then
|
||||||
|
echo "cache-size=0" >> "$CONFDIR/dnsmasq.conf"
|
||||||
|
echo "no-negcache" >> "$CONFDIR/dnsmasq.conf"
|
||||||
|
fi
|
||||||
if [[ $IPV6 -eq 1 ]];then
|
if [[ $IPV6 -eq 1 ]];then
|
||||||
cat <<- EOF >> "$CONFDIR/dnsmasq.conf"
|
cat <<- EOF >> "$CONFDIR/dnsmasq.conf"
|
||||||
listen-address=${GATEWAY6}
|
listen-address=${GATEWAY6}
|
||||||
|
|
Loading…
Reference in New Issue