Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:services:tor:client [2023/09/16 12:15] – [2. Firewall] vgaetera | docs:guide-user:services:tor:client [2023/10/14 13:39] – [Introduction] vgaetera | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| * This how-to describes the method for setting up [[wp> | * This how-to describes the method for setting up [[wp> | ||
| * Tor is limited to DNS and TCP traffic, use [[docs: | * Tor is limited to DNS and TCP traffic, use [[docs: | ||
| - | * Follow [[docs: | + | * Follow [[docs: |
| ===== Goals ===== | ===== Goals ===== | ||
| Line 42: | Line 42: | ||
| uci add_list tor.conf.tail_include="/ | uci add_list tor.conf.tail_include="/ | ||
| uci commit tor | uci commit tor | ||
| - | / | + | service |
| </ | </ | ||
| Line 54: | Line 54: | ||
| # Intercept TCP traffic | # Intercept TCP traffic | ||
| cat << " | cat << " | ||
| - | TOR_ZONE=" | + | TOR_CHAIN="dstnat_$(uci -q get firewall.tcp_int.src)" |
| TOR_RULE=" | TOR_RULE=" | ||
| | sed -n -e "/ | | sed -n -e "/ | ||
| - | nft replace rule inet fw4 dstnat_${TOR_ZONE} \ | + | nft replace rule inet fw4 ${TOR_CHAIN} \ |
| handle ${TOR_RULE## | handle ${TOR_RULE## | ||
| fib daddr type != { local, broadcast } ${TOR_RULE} | fib daddr type != { local, broadcast } ${TOR_RULE} | ||
| Line 77: | Line 77: | ||
| uci -q delete firewall.@forwarding[0] | uci -q delete firewall.@forwarding[0] | ||
| uci commit firewall | uci commit firewall | ||
| - | / | + | service |
| </ | </ | ||
| Line 87: | Line 87: | ||
| <code bash> | <code bash> | ||
| # Enable DNS over Tor | # Enable DNS over Tor | ||
| - | / | + | service |
| uci set dhcp.@dnsmasq[0].boguspriv=" | uci set dhcp.@dnsmasq[0].boguspriv=" | ||
| uci set dhcp.@dnsmasq[0].rebind_protection=" | uci set dhcp.@dnsmasq[0].rebind_protection=" | ||
| Line 95: | Line 95: | ||
| uci add_list dhcp.@dnsmasq[0].server=":: | uci add_list dhcp.@dnsmasq[0].server=":: | ||
| uci commit dhcp | uci commit dhcp | ||
| - | / | + | service |
| </ | </ | ||
| - | |||
| - | ==== Automated ==== | ||
| - | Automated Tor client installation. | ||
| - | |||
| - | <code bash> | ||
| - | URL=" | ||
| - | cat << EOF > tor-client.sh | ||
| - | $(wget -U "" | ||
| - | $(wget -U "" | ||
| - | $(wget -U "" | ||
| - | $(wget -U "" | ||
| - | $(wget -U "" | ||
| - | EOF | ||
| - | sh tor-client.sh | ||
| - | </ | ||
| - | |||
| ===== Testing ===== | ===== Testing ===== | ||
| Line 127: | Line 111: | ||
| <code bash> | <code bash> | ||
| # Restart services | # Restart services | ||
| - | / | + | service |
| # Log and status | # Log and status | ||