Shorewall FAQs |
1a. Ok -- I followed those instructions
but it doesn't work.
1b. I'm still having problems with port forwarding
3. I want to use Netmeeting or MSN Instant Messenger with Shorewall. What do I do?
4a. I just ran an nmap UDP scan of my firewall and it showed 100s of ports as open!!!!
5. I've installed Shorewall and now I can't ping through the firewall
6. Where are the log messages written and how do I change the destination?
6a. Are there any log parsers that work with Shorewall?
6b. DROP messages on port 10619 are flooding the logs with their connect
requests. Can i exclude these error messages for this port temporarily
from logging in Shorewall?
8. When I try to start Shorewall on RedHat I get messages about insmod failing -- what's wrong?
9. Why can't Shorewall detect my interfaces properly?
10. What distributions does it work with?
11. What features does it support?
12. Is there a GUI?
13. Why do you call it "Shorewall"?
15. My local systems can't see out to the net
16. Shorewall is writing log messages
all over my console making it unusable!
Answer: The first example in the rules file documentation shows how to do port forwarding under Shorewall. The format of a port-forwarding rule to a local system is as follows:
ACTION SOURCE DESTINATION PROTOCOL PORT SOURCE PORT ORIG. DEST. DNAT net loc:<local IP address>[:<local port>] <protocol> <port #>
So to forward UDP port 7777 to internal system 192.168.1.5, the rule is:
ACTION SOURCE DESTINATION PROTOCOL PORT SOURCE PORT ORIG. DEST. DNAT net loc:192.168.1.5 udp 7777
Finally, if you need to forward a range of ports, in the PORT column specify the range as low-port:high-port.
ACTION SOURCE DESTINATION PROTOCOL PORT SOURCE PORT ORIG. DEST. DNAT net loc:<local IP address>[:<local port>] <protocol> <port #> - <external IP>
Answer: That is usually the result of one of two things:
Answer: I have two objections to this setup.
If you insist on an IP solution to the accessibility problem rather than a DNS solution, then assuming that your external interface is eth0 and your internal interface is eth1 and that eth1 has IP address 192.168.1.254 with subnet 192.168.1.0/24, in /etc/shorewall/rules, add:
ACTION SOURCE DESTINATION PROTOCOL PORT SOURCE PORT ORIG. DEST. DNAT loc:192.168.1.0/24 loc:192.168.1.5 tcp www - 130.151.100.69:192.168.1.254
That rule only works of course if you have a static external IP address. If you have a dynamic IP address and are running Shorewall 1.3.4 or later then include this in /etc/shorewall/params:
ETH0_IP=`find_interface_address eth0`
and make your DNAT rule:
ACTION SOURCE DESTINATION PROTOCOL PORT SOURCE PORT ORIG. DEST. DNAT loc:192.168.1.0/24 loc:192.168.1.5 tcp www - $ETH0_IP:192.168.1.254
Using this technique, you will want to configure your DHCP/PPPoE client to automatically restart Shorewall each time that you get a new IP address.
Answer: This is another problem that is best solved using Bind Version 9 "views". It allows both external and internal clients to access a NATed host using the host's DNS name.
Another good way to approach this problem is to switch from static NAT to Proxy ARP. That way, the hosts in Z have non-RFC1918 addresses and can be accessed externally and internally using the same address.
If you don't like those solutions and prefer routing all Z->Z traffic through your firewall then:
a) Set the Z->Z policy to ACCEPT.
b) Masquerade Z to itself.
Example:
Zone: dmz
Interface: eth2
Subnet: 192.168.2.0/24
In /etc/shorewall/interfaces:
ZONE INTERFACE BROADCAST OPTIONS dmz eth2 192.168.2.255
In /etc/shorewall/policy:
SOURCE DESTINATION POLICY LIMIT:BURST dmz dmz ACCEPT
In /etc/shorewall/masq:
INTERFACE SUBNET ADDRESS eth2 192.168.2.0/24
Answer: There is an H.323 connection tracking/NAT module that may help with Netmeeting. Look here for a solution for MSN IM but be aware that there are significant security risks involved with this solution. Also check the Netfilter mailing list archives at http://www.netfilter.org.
Answer: The common.def included with version 1.3.x always rejects connection requests on TCP port 113 rather than dropping them. This is necessary to prevent outgoing connection problems to services that use the 'Auth' mechanism for identifying requesting users. Shorewall also rejects TCP ports 135, 137 and 139 as well as UDP ports 137-139. These are ports that are used by Windows (Windows can be configured to use the DCE cell locator on port 135). Rejecting these connection requests rather than dropping them cuts down slightly on the amount of Windows chatter on LAN segments connected to the Firewall.
If you are seeing port 80 being 'closed', that's probably your ISP preventing you from running a web server in violation of your Service Agreement.
Answer: Take a deep breath and read the nmap man page section about UDP scans. If nmap gets nothing back from your firewall then it reports the port as open. If you want to see which UDP ports are really open, temporarily change your net->all policy to REJECT, restart Shorewall and do the nmap UDP scan again.
Answer: If you want your firewall to be totally open for "ping",
a) Create /etc/shorewall/common if it doesn't already exist.
b) Be sure that the first command
in the file is ". /etc/shorewall/common.def"
c) Add the following to /etc/shorewall/common
For a complete description of Shorewall 'ping' management, see this page.run_iptables -A icmpdef -p ICMP --icmp-type echo-request -j ACCEPT
Answer: NetFilter uses the kernel's equivalent of syslog (see "man syslog") to log messages. It always uses the LOG_KERN (kern) facility (see "man openlog") and you get to choose the log level (again, see "man syslog") in your policies and rules. The destination for messaged logged by syslog is controlled by /etc/syslog.conf (see "man syslog.conf"). When you have changed /etc/syslog.conf, be sure to restart syslogd (on a RedHat system, "service syslog restart").
By default, older versions of Shorewall ratelimited log messages through settings in /etc/shorewall/shorewall.conf -- If you want to log all messages, set:
LOGLIMIT=""
LOGBURST=""
Beginning with Shorewall version 1.3.12, you can set up Shorewall to log all of its messages to a separate file.
Answer: Here are several links that may be helpful:
I personnaly use Logwatch. It emails me a report each day from my various systems with each report summarizing the logged activity on the corresponding system.http://www.shorewall.net/pub/shorewall/parsefw/
http://www.fireparse.com
http://cert.uni-stuttgart.de/projects/fwlogwatch
http://www.logwatch.org
http://gege.org/iptables
DROP net fw udp 10619
Jan 8 15:50:48 norcomix kernel: Shorewall:net2all:DROP:IN=eth0 OUT= MAC=00:40:c7:2e:09:c0:00:01:64:4a:70:00:08:00Answer: There are two possibilities:
SRC=208.138.130.16 DST=24.237.22.45 LEN=53 TOS=0x00 PREC=0x00
TTL=251 ID=8288 DF PROTO=UDP SPT=53 DPT=40275 LEN=33
The above file is also include in all of my sample configurations available in the Quick Start Guides and in the common.def file in Shorewall 1.4.0 and later.#
# Include the standard common.def file
#
. /etc/shorewall/common.def
#
# The following rule is non-standard and compensates for tardy
# DNS replies
#
run_iptables -A common -p udp --sport 53 -mstate --state NEW -j DROP
The 'stop' command is intended to place your firewall into a safe state whereby only those hosts listed in /etc/shorewall/routestopped' are activated. If you want to totally open up your firewall, you must use the 'shorewall clear' command.
Answer: The output you will see looks something like this:
/lib/modules/2.4.17/kernel/net/ipv4/netfilter/ip_tables.o: init_module: Device or resource busy
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters
/lib/modules/2.4.17/kernel/net/ipv4/netfilter/ip_tables.o: insmod
/lib/modules/2.4.17/kernel/net/ipv4/netfilter/ip_tables.o failed
/lib/modules/2.4.17/kernel/net/ipv4/netfilter/ip_tables.o: insmod ip_tables failed
iptables v1.2.3: can't initialize iptables table `nat': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
This is usually cured by the following sequence of commands:
service ipchains stop
chkconfig --delete ipchains
rmmod ipchains
Also, be sure to check the errata for problems concerning the version of iptables (v1.2.3) shipped with RH7.2.
I just installed Shorewall and when I issue the start command, I see the following:
Processing /etc/shorewall/shorewall.conf ...
Processing /etc/shorewall/params ...
Starting Shorewall...
Loading Modules...
Initializing...
Determining Zones...
Zones: net loc
Validating interfaces file...
Validating hosts file...
Determining Hosts in Zones...
Net Zone: eth0:0.0.0.0/0
Local Zone: eth1:0.0.0.0/0
Deleting user chains...
Creating input Chains...
...
Why can't Shorewall detect my interfaces properly?
Answer: The above output is perfectly normal. The Net zone is defined as all hosts that are connected through eth0 and the local zone is defined as all hosts connected through eth1
Shorewall works with any GNU/Linux distribution that includes the proper prerequisites.
Answer: See the Shorewall Feature List.
Answer: Yes. Shorewall support is included in Webmin 1.060 and later versions. See http://www.webmin.com
Answer: Shorewall is a concatenation of "Shoreline" (the city where I live) and "Firewall". The full name of the product is actually "Shoreline Firewall" but "Shorewall" is must more commonly used.
Is there any way it can add a rule before the rfc1918 blocking that will let all traffic to and from the 192.168.100.1 address of the modem in/out but still block all other rfc1918 addresses?
Answer: If you are running a version of Shorewall earlier than 1.3.1, create /etc/shorewall/start and in it, place the following:
run_iptables -I rfc1918 -s 192.168.100.1 -j ACCEPT
If you are running version 1.3.1 or later, simply add the following to /etc/shorewall/rfc1918:
SUBNET TARGET 192.168.100.1 RETURN
Be sure that you add the entry ABOVE the entry for 192.168.0.0/16.
Note: If you add a second IP address to your external firewall
interface to correspond to the modem address, you must
also make an entry in /etc/shorewall/rfc1918 for that address.
For example, if you configure the address 192.168.100.2 on
your firewall, then you would add two entries to /etc/shorewall/rfc1918:
SUBNET
TARGET
192.168.100.1
RETURN
192.168.100.2
RETURN
The solution is the same as FAQ 14 above. Simply substitute the IP address of your ISPs DHCP server.
Answer: Every time I read "systems can't see out to the net", I wonder where the poster bought computers with eyes and what those computers will "see" when things are working properly. That aside, the most common causes of this problem are:
The default gateway on each local system isn't set to the IP address of the local firewall interface.
The entry for the local network in the /etc/shorewall/masq file is wrong or missing.
The DNS settings on the local systems are wrong or the user is running a DNS server on the firewall and hasn't enabled UDP and TCP port 53 from the firewall to the internet.
Answer: "man dmesg" -- add a suitable 'dmesg' command
to your startup scripts or place it in /etc/shorewall/start.
Under RedHat, the max log level that is sent to the
console is specified in /etc/sysconfig/init in the LOGLEVEL
variable.
# Accept AUTH but only on address 192.0.2.125Example 2 (NAT):
ACCEPT net fw:192.0.2.125 tcp auth
192.0.2.126 eth0 10.1.1.126/etc/shorewall/rules
# Accept HTTP on 192.0.2.126 (a.k.a. 10.1.1.126)Example 3 (DNAT):
ACCEPT net loc:10.1.1.126 tcp www
# Forward SMTP on external address 192.0.2.127 to local system 10.1.1.127
DNAT net loc:10.1.1.127 tcp smtp - 192.0.2.127
192.0.2.3 is external on my firewall... 172.16.0.0/24 is my internal LANNov 25 18:58:52 linux kernel: Shorewall:net2all:DROP:IN=eth1 OUT= MAC=00:60:1d:f0:a6:f9:00:60:1d:f6:35:50:08:00
SRC=206.124.146.179 DST=192.0.2.3 LEN=56 TOS=0x00 PREC=0x00 TTL=110 ID=18558 PROTO=ICMP TYPE=3 CODE=3
[SRC=192.0.2.3 DST=172.16.1.10 LEN=128 TOS=0x00 PREC=0x00 TTL=47 ID=0 DF PROTO=UDP SPT=53 DPT=2857 LEN=108 ]
net:<ip1>,<ip2>,...Example:
ACCEPT net:192.0.2.16/28,192.0.2.44 fw tcp 22
Copyright ©
2001, 2002, 2003 Thomas M. Eastep.