Browse Source

changes & fixes to router docs & freeswitch

master
Mario Alegre 5 years ago
parent
commit
d96a867978
  1. 14
      linux/router/dnsmasq.md
  2. 52
      linux/router/nftables.md
  3. 15
      linux/voip/freeswitch.md

14
linux/router/dnsmasq.md

@ -27,8 +27,16 @@ local=/mar.alemor.org/
# Repeat the line for more than one interface.
interface=lan0
# If you don't want dnsmasq to read /etc/hosts, uncomment the
# following line.
no-hosts
# Set this (and domain: see below) if you want to have a domain
# automatically added to simple names in a hosts-file.
expand-hosts
# Set a domain for a particular subnet
domain=mar.alemor.org,192.168.80.0/24
domain=mar.alemor.org,192.168.82.0/24
# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
@ -53,9 +61,9 @@ dhcp-authoritative
# If you want to disable negative caching, uncomment this.
no-negcache
```
after you've set the config you want, reload with `service dnsmasq restart`
after you've set the config you want, reload with `service dnsmasq restart`.
- hosts in `/etc/hosts` and MAC addresses in `/etc/ethers`
Put your static hosts in `/etc/dnsmasq.d/hosts`.
## make interface static

52
linux/router/nftables.md

@ -30,50 +30,58 @@ in `/etc/nftables.conf`:
# flush only my tables
table inet myfilter
delete table inet myfilter
table ip mynatv4
delete table ip mynatv4
table ip mynat
delete table ip mynat
table inet myfilter {
chain myinput {
# use the "input" hook for this chain
chain input {
# accepts packets by default, because we don't want
# to have to keep track of all interfaces we don't want
# firewalled (lan0, wlan0, lxdbr0, veths, etc)
# firewalled (lan0, wlan0, bridges, veths, etc)
type filter hook input priority 0; policy accept;
# allow established/related connections
ct state {established, related} accept
# drop invalid connections
ct state invalid drop
# packets that are received on a firewalled interface
# are sent to the firewall chain for evaluation
iifname "wan0" jump myfirewall
iifname wan0 jump firewall
}
chain myfirewall { # handle firewall
chain firewall {
# allow established/related connections
ct state {established, related} accept
# accept incoming HTTP(s) connections
tcp dport {http, https} accept
tcp dport {80, 443} accept
# accept incoming SSH connections
tcp dport 4322 accept
# accept incoming SSH connections for gitea
tcp dport 4323 accept
# accept incoming minecraft MP connections
udp dport {19132, 19133} accept
tcp dport {19132, 19133} accept
# block mDNS broadcasts
udp dport 5353 drop
# reject everything else
reject with icmpx type port-unreachable
reject
}
chain myforward {
chain forward {
# forward everything by default
type filter hook forward priority 0; policy accept;
# forward incoming on wan0 for established/related connections
iifname wan0 ct state {established, related} accept
# drop everything else
iifname wan0 drop
# drop invalid connections
ct state invalid drop
# send packets recieved on WAN to firewall chain
iifname wan0 jump firewall
}
chain myoutput {
chain output {
# let everything out by default
type filter hook output priority 0; policy accept;
@ -82,15 +90,15 @@ table inet myfilter {
}
}
table ip mynatv4 {
chain myprerouting {
table ip mynat {
chain prerouting {
type nat hook prerouting priority -100;
# if I wanted to do port forwarding I could do it like this:
# forward http to 192.168.82.10
#tcp dport http dnat to 192.168.82.10
}
chain mypostrouting {
chain postrouting {
type nat hook postrouting priority 100;
# masquerade outbound packets going to WAN

15
linux/voip/freeswitch.md

@ -0,0 +1,15 @@
# install and configure freeswitch
## install from apt repo
add repo:
```
apt-get update && apt-get install -y gnupg2 wget lsb-release
wget -O - https://files.freeswitch.org/repo/deb/debian-release/fsstretch-archive-keyring.asc | apt-key add -
echo "deb http://files.freeswitch.org/repo/deb/debian-release/ `lsb_release -sc` main" > /etc/apt/sources.list.d/freeswitch.list
echo "deb-src http://files.freeswitch.org/repo/deb/debian-release/ `lsb_release -sc` main" >> /etc/apt/sources.list.d/freeswitch.list
```
install package:
```
apt update && apt install freeswitch-meta-all
```
Loading…
Cancel
Save