mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
doc: add example for reject. #94
This commit is contained in:
1 parent
0ef3d72e2e
commit
8fa411cf52
7 files changed
+41
-58
No files matched your search
@@ -26,6 +26,7 @@ listen=redir://:1081
|
||||
# as a dns forwarding server
|
||||
dns=:53
|
||||
dnsserver=8.8.8.8:53
|
||||
dnsserver=8.8.4.4:53
|
||||
|
||||
# specify rule files
|
||||
rules-dir=rules.d
|
||||
@@ -73,22 +74,28 @@ cidr=172.16.102.0/24
|
||||
#### Configure iptables on your linux gateway
|
||||
```bash
|
||||
iptables -t nat -I PREROUTING -p tcp -m set --match-set glider dst -j REDIRECT --to-ports 1081
|
||||
#iptables -t nat -I OUTPUT -p tcp -m set --match-set glider dst -j REDIRECT --to-ports 1081
|
||||
iptables -t nat -I OUTPUT -p tcp -m set --match-set glider dst -j REDIRECT --to-ports 1081
|
||||
```
|
||||
|
||||
#### Server DNS settings
|
||||
Set server's nameserver to glider:
|
||||
```bash
|
||||
echo nameserver 127.0.0.1 > /etc/resolv.conf
|
||||
```
|
||||
|
||||
#### Client DNS settings
|
||||
use the linux server's ip as your dns server
|
||||
Use the linux server's ip as your dns server.
|
||||
|
||||
#### When client requesting to access http://example1.com (in office.rule), the whole process:
|
||||
DNS Resolving:
|
||||
1. client sends a udp dns request to linux server, and glider will receive the request(as it listen on default dns port :53)
|
||||
2. upstream dns server choice: glider will lookup it's rule config and find out the dns server to use for this domain(matched "example1.com" in office.rule, so 208.67.222.222:53 will be chosen)
|
||||
3. glider uses the forwarder in office.rule to ask 208.67.222.222:53 for the resolve answers
|
||||
4. glider updates it's office rule config, add the resolved ip address to it
|
||||
5. glider adds the resolved ip into ipset "glider", and return the dns answer to client
|
||||
3. glider uses the forwarder in office.rule to ask 208.67.222.222:53 for the resolve answers.
|
||||
4. glider updates it's office rule config, add the resolved ip address to it.
|
||||
5. glider adds the resolved ip into ipset "glider", and return the dns answer to client.
|
||||
|
||||
Destination Accessing:
|
||||
1. client sends http request to the resolved ip of example1.com
|
||||
2. linux gateway server will get the request
|
||||
1. client sends http request to the resolved ip of example1.com.
|
||||
2. linux gateway server will get the request.
|
||||
3. iptabes matches the ip in ipset "glider" and redirect this request to :1081(glider)
|
||||
4. glider finds the ip in office rule, and then choose a forwarder in office.rule to complete the request
|
||||
4. glider finds the ip in office rule, and then choose a forwarder in office.rule to complete the request.
|
||||
Reference in new issue
Block a user