Alternative firewalls is a quite hot potato, in this forum, so I guess it will eventuelly be tested on an other Linux distro than the SME server. But any how, here is some notes I wrote down once doing some tests with a bridge mode firewall.
To make the bridge itself, with or without an IP:
ifconfig eth0 0.0.0.0
ifconfig eth1 0.0.0.0
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
# ifconfig br0 10.0.0.35 netmask 255.255.255.0
ifconfig br0 up
And then a firewall for a bridge as experiementet/tested it out:
### ESTABLISHING FIREWALL RULES
# Flushing out the old firewall rules.
iptables -F
iptables -X
iptables -Z
# Samtlige policies settes til drop, dvs stengt.
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
# Preventing DOS attack (May be not needed)
iptables -N syn-flood
iptables -A FORWARD -p tcp –syn -j syn-flood
# iptables -A FORWARD -p tcp –tcp-flags SYN SYN -j syn-flood
iptables -A syn-flood -m limit –limit 4/s –limit-burst 8 -j RETURN
iptables -A syn-flood -j DROP
# Drop spoofed packets (May be not needed)
iptables -A FORWARD -p tcp –tcp-flags ALL NONE -j DROP
iptables -A FORWARD -p tcp –tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -A FORWARD -p tcp –tcp-flags SYN,RST SYN,RST -j DROP
iptables -A FORWARD -p tcp –tcp-flags FIN,RST FIN,RST -j DROP
iptables -A FORWARD -p tcp –tcp-flags ACK,FIN FIN -j DROP
iptables -A FORWARD -p tcp –tcp-flags ACK,PSH PSH -j DROP
iptables -A FORWARD -p tcp –tcp-flags ACK,URG URG -j DROP
# Statefull inspection, for return traffic
iptables -A FORWARD -m state –state ESTABLISHED,RELATED -j ACCEPT
# Drop spoofed packed releated to statefull inspection
iptables -A FORWARD -m state –state INVALID -j DROP
# Full open for traffic out
# iptables -A FORWARD -s 10.0.0.0/24 -j LOG –log-prefix “TESTREG:”
iptables -A FORWARD -s 10.0.0.55/24 -j ACCEPT
# Fitrering of trafick i inbound trafick direction
iptables -A FORWARD -d 10.0.0.2/24 -p tcp –dport 25 -j ACCEPT
iptables -A FORWARD -d 10.0.0.2/24 -p udp –dport 53 -j ACCEPT
iptables -A FORWARD -d 10.0.0.2/24 -p tcp –dport 80 -j ACCEPT
iptables -A FORWARD -d 10.0.0.2/24 -p tcp –dport 110 -j ACCEPT
iptables -A FORWARD -d 10.0.0.2/24 -p tcp –dport 143 -j ACCEPT
iptables -A FORWARD -d 10.0.0.2/24 -p tcp –dport 443 -j ACCEPT
# SSH remote logon + web server on the firewaLL MACHINE
iptables -A INPUT -s 10.0.0.55/24 -p tcp –dport 22 -j ACCEPT
iptables -A INPUT -s 10.0.0.55/24 -p tcp –dport 80 -j ACCEPT
iptables -A INPUT -s 10.0.0.55/24 -p tcp –dport 443 -j ACCEPT
iptables -A OUTPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
I guess that a bridge mode firewall/gateway/printer server can be local to both networks, and still separating them using configuration of the bridge mode firewall.
I don't remeber my setup completely, but this are my notes. Configuring a bridgemode firewall is slightly different from a routing firewall as specifying adapters like eth0 and eth1 will not work. It will have to be used network numbers / ip-addresses instead.
Establishing experimental security systems for two lawyer companies might be two more hot potatos
