Skip to content

Commit

Permalink
fix: ⚡ cleanup config txts
Browse files Browse the repository at this point in the history
config /etc/hosts for dnsmasq
  • Loading branch information
louonezime committed Oct 15, 2023
1 parent dcc0599 commit 0a83b83
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
11 changes: 6 additions & 5 deletions raspi/iptables_conf.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

function config_wireguard() {
echo "Flushing existing rules and chains..."
sudo iptables -F
Expand Down Expand Up @@ -33,17 +34,17 @@ function config_wireguard() {

}

if ["$1" == "wireguard"]; then
if [ "$1" = "wireguard" ]; then
config_wireguard
elif ["$2" == "signal-only"]; then
elif [ "$1" = "signal-only" ]; then
echo "Enabling IP Masquerading..."
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
else
echo "USAGE:\tsudo bash iptables_conf.sh [opt]"
echo "\n[opt] = wireguard or signal-only depending if you want to configure WireGuard"
echo "USAGE: sudo bash iptables_conf.sh [opt]"
echo "[opt] = wireguard or signal-only depending if you want to configure WireGuard"
exit 1
fi

echo "sudo sh -c "iptables-save > /etc/iptables/rules.v4"
sudo sh -c "iptables-save > /etc/iptables/rules.v4"
1 change: 1 addition & 0 deletions raspi/raspberrypi_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface=wlan0
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
domain=wlan
address=/gw.wlan/192.168.4.1
addn-hosts=/etc/hosts
```


Expand Down
Empty file modified raspi/refresh_network.sh
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions raspi/wireguard.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ $ sudo sh -c "iptables-save > /etc/iptables/rules.v4"
```
$ sudo wg-quick up wg0
```

8. Enable WireGuard on Boot
```
$ sudo systemctl enable wg-quick@your-config-file
```

0 comments on commit 0a83b83

Please sign in to comment.