Any recipes for IPTABLES?
#9
Worth a try. Debian does have ufw.

Here's a real script I've written as an example. It's designed to be used in conjunction with the older version of this Raspberry Pi guide, where the Pi is used as a Wireless Access Point (and a web server).

Inbound and outbound traffic is restricted as much as possible. I hope this helps as a visual to what can be achieved with ufw and iptables.


Quote:#! /usr/bin/env dash -e

# Allow DHCP leasing (for eth0 and wlan0)
ufw allow in to any port 67      # DHCP (server)
ufw allow out to any port 68    # DHCP (client)

# Allow connections to destination ports (for local network addresses)
ufw allow in on eth0 from 192.168.0.0/16 to any port 80    # HTTP (to local webserver)

# Allow connections to destination ports (for local network addresses)
ufw allow in on eth0 from 192.168.0.0/16 to any port 80    # HTTP (to local webserver)
ufw allow out from 192.168.0.0/16 to any port 53               # DNS
ufw allow out from 192.168.0.0/16 to any port 123             # NTP
ufw allow out from 192.168.0.0/16 to any port 443             # HTTPS

# Allow connections to destination ports (for wlan0 DHCP addresses)
ufw allow in on wlan0 from 192.168.4.0/28 to any port 53    # DNS (query the local DNS server)

# Forward internet-facing incoming wlan0 connections to eth0 outgoing
ufw route allow in on wlan0 from 192.168.4.0/28 to any port 80 out on eth0      # HTTP
ufw route allow in on wlan0 from 192.168.4.0/28 to any port 443 out on eth0    # HTTPS


Messages In This Thread
Any recipes for IPTABLES? - by vidarr - 09-08-2020, 09:25 PM
RE: Any recipes for IPTABLES? - by User 18618 - 09-10-2020, 03:40 AM
RE: Any recipes for IPTABLES? - by vidarr - 09-10-2020, 03:07 PM
RE: Any recipes for IPTABLES? - by vidarr - 09-10-2020, 04:39 PM
RE: Any recipes for IPTABLES? - by User 18618 - 09-11-2020, 08:48 AM
RE: Any recipes for IPTABLES? - by vidarr - 09-11-2020, 07:27 PM
RE: Any recipes for IPTABLES? - by User 18618 - 09-12-2020, 07:46 AM
RE: Any recipes for IPTABLES? - by vidarr - 09-13-2020, 04:27 PM
RE: Any recipes for IPTABLES? - by User 18618 - 09-14-2020, 04:42 AM
RE: Any recipes for IPTABLES? - by thatrandomguy - 10-16-2020, 07:06 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)