<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>System Network Programming Solution - Linux - windows - centos- security- cpanel - plesk -directadmin helm&#187; Firewall</title>
	<atom:link href="http://thegioinguonmo.com/tag/firewall/feed/" rel="self" type="application/rss+xml" />
	<link>http://thegioinguonmo.com</link>
	<description>SHARING EVERYTHING</description>
	<lastBuildDate>Sat, 19 May 2012 21:40:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Detecting DoS / DDoS Attack on a Windows 2003 / 2008 Server</title>
		<link>http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html</link>
		<comments>http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html#comments</comments>
		<pubDate>Tue, 27 Mar 2012 09:39:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[DDoS Attack]]></category>
		<category><![CDATA[Detecting DoS]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2548</guid>
		<description><![CDATA[Question: How do I detect a DDOS (Distributed denial of service) / DOS attack on a Windows Server 2003 / 2000 / 2008? Can I use Linux netstat command syntax to detect DDoS attacks? Answer:A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer resource unavailable to its intended users. [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>Question</strong></span>: How do I detect a DDOS (Distributed denial of service) / DOS attack on a Windows Server 2003 / 2000 / 2008? Can I use <a rel="nofollow" target="_blank" href="http://www.cyberciti.biz/tips/netstat-command-tutorial-examples.html">Linux netstat command syntax to detect DDoS</a> attacks?</p>
<p><strong><span style="color: #008000;">Answer</span></strong>:A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer resource unavailable to its intended users.</p>
<p>You can always use netstat command to get list of connections under Windows. Open command prompt by visiting Start &gt; Run &gt; Type “cmd” in box.</p>
<p>netstat is a command line utility which displays protocol statistics and current TCP/IP network connections in a system. Type the following command to see all connections:<br />
<code>netstat -noa</code><br />
Where,</p>
<ol>
<li><strong>n</strong>: Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.</li>
<li><strong>o</strong>: Displays active TCP connections and includes the process ID (PID) for each connection. You can find the application based on the PID on the Processes tab in Windows Task Manager.</li>
<li><strong>a</strong>: Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.</li>
</ol>
<p>You can use find command as filter to searches for a specific string of text in a file. In the following example you are filtering out port 80 traffic:<br />
<code>netstat -ano | find /c "80"</code><br />
Find the IP address which is having maximum number of connection and block it using Cisco firewall or IPSec. Another protective measurement is to <a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/library/aa302363.aspx">harden the TCP/IP stack</a>.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html" title="ddos programing">ddos programing</a> (1)</li><li><a href="http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html" title="detecting dos on web server">detecting dos on web server</a> (1)</li><li><a href="http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html" title="netstat cmd udp tcp ip">netstat cmd udp tcp ip</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Add iptable modules on a VPS</title>
		<link>http://thegioinguonmo.com/security/howto-add-iptable-modules-on-a-vps.html</link>
		<comments>http://thegioinguonmo.com/security/howto-add-iptable-modules-on-a-vps.html#comments</comments>
		<pubDate>Mon, 19 Mar 2012 21:41:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[modprobe]]></category>
		<category><![CDATA[VEID]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=481</guid>
		<description><![CDATA[If you receive the following error on restating iptables on a VPS: error message: from firewall software ~ iptables: Unknown error 4294967295 you need to make sure the required iptable modules are loaded in the host server kernel. You have to use modprobe to load the following modules in the kernel: modprobe ipt_MASQUERADE modprobe ipt_helper [...]]]></description>
			<content:encoded><![CDATA[<p>If you receive the following error on restating iptables on a VPS:</p>
<blockquote><p>error message: from firewall software ~ iptables: Unknown error 4294967295</p></blockquote>
<p>you need to make sure the required iptable modules are loaded in the host server kernel. You have to use modprobe to load the following modules in the kernel:</p>
<p><strong><code>modprobe ipt_MASQUERADE<br />
modprobe ipt_helper<br />
modprobe ipt_REDIRECT<br />
modprobe ipt_state<br />
modprobe ipt_TCPMSS<br />
modprobe ipt_LOG<br />
modprobe ipt_TOS<br />
modprobe tun<br />
modprobe iptable_nat<br />
modprobe ipt_length<br />
modprobe ipt_tcpmss<br />
modprobe iptable_mangle<br />
modprobe ipt_limit<br />
modprobe ipt_tos<br />
modprobe iptable_filter<br />
modprobe ipt_helper<br />
modprobe ipt_tos<br />
modprobe ipt_ttl<br />
modprobe ipt_REJECT</code></strong></p>
<p>Once the modules are loaded, add the modules to your VPS using the vzctl command. You will have to stop the VPS first</p>
<p><strong><code>vzctl stop VEID</code></strong></p>
<p>and then add the modules to a VPS</p>
<blockquote><p><strong>vzctl set VEID –iptables ipt_REJECT –iptables ipt_tos –iptables ipt_TOS –iptables ipt_LOG –iptables ip_conntrack –iptables ipt_limit –iptables ipt_multiport –iptables iptable_filter –iptables iptable_mangle –iptables ipt_TCPMSS –iptables ipt_tcpmss –iptables ipt_ttl –iptables ipt_length –iptables ipt_state –iptables iptable_nat –iptables ip_nat_ftp –save</strong></p></blockquote>
<p>Once the above command is executed, start the VPS</p>
<p><strong><code>vzctl start VEID</code></strong></p>
<p>Now you are set to use iptables on your VPS.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/howto-add-iptable-modules-on-a-vps.html" title="modprobe ipt_redirect vps">modprobe ipt_redirect vps</a> (2)</li><li><a href="http://thegioinguonmo.com/security/howto-add-iptable-modules-on-a-vps.html" title="geoip database 갱신 centos iptables">geoip database 갱신 centos iptables</a> (1)</li><li><a href="http://thegioinguonmo.com/security/howto-add-iptable-modules-on-a-vps.html" title="plesk iptables 4294967295">plesk iptables 4294967295</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/howto-add-iptable-modules-on-a-vps.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Perfect Linux Firewall Part II &#8212; IPCop &amp; Copfilter</title>
		<link>http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html</link>
		<comments>http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html#comments</comments>
		<pubDate>Fri, 23 Dec 2011 04:39:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Installing Copfilter]]></category>
		<category><![CDATA[ipcop]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[NOTE]]></category>
		<category><![CDATA[Red]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=36</guid>
		<description><![CDATA[This document is the second segment in a series on installing IPCop firewall. We will be creating a &#8220;DMZ&#8221; for hosting your own web server or mail server and the Copfilter proxy for filtering your application layer ingress and egress network traffic. This is intended to be a rough overview on creating a IPCop firewall [...]]]></description>
			<content:encoded><![CDATA[<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>T</strong>his document is the second segment in a series on installing IPCop firewall. We will be creating a &#8220;DMZ&#8221; for hosting your own web server or mail server and the Copfilter proxy for filtering your application layer ingress and egress network traffic. This is intended to be a rough overview on creating a IPCop firewall with Copfilter and comes without warranty of any kind.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Using your IPCop for web hosting/mail hosting</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Given the instructions from the previous article, you should have a full installation of IPCop running. The current focus remains two-fold: to get your server in the Orange (DMZ) segment of your IPCop Network and opening up the ports on your firewall to allow web traffic to it.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop/example_ipcop_network.png" alt="example ipcop network The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Additionally, our second goal in this article will be securing our (application layer) web traffic, email and personal privacy with a wonderful add-in, called Copfilter.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">As we detailed in part one, I suggested the 192.168.10.x network for our &#8220;Orange&#8221; DMZ segment. In this part of the network I will place hosts that I want visible to the outside world. Port forwarding will permit the flow of traffic from external RED (DHCP interface/network) to DMZ ORANGE network.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Orange Network Requirements</span></strong></p>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Installed and configured server with the Distro of your choice with the email (SMTP &amp; POP3 or IMAP and webserver of your choice. </span><a rel="nofollow" target="_blank" id="Free" name="Free" href="http://en.wikipedia.org/wiki/Free_and_Open_Source_Software" target="new"></a><span style="font-family: verdana,arial,helvetica,sans-serif;">Free &amp; Open Source Software (FOSS)</span><span style="font-family: verdana,arial,helvetica,sans-serif;"> is all about choice so pick what fits your needs..</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">This orange network server must have a static IP address and not be on DHCP. For the sake of this article, we are using the static IP of 192.168.10.25 for our single internal ORANGE hosting server.</span></div>
</li>
</ul>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Secure your Orange Network Hosts</span></strong></p>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Security is a process not any one tool or technology. Rather, it is many tools, technologies and processes. Consider a holistic view.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Remember to consistently patch and monitor logs patches are an important measure to mitigate known vulnerabilities.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Make sure you fully patched, secured and backed up any host before you expose it to the Internet.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The best security is a layered approach so consider using a </span><a rel="nofollow" target="_blank" id="Host" name="Host" href="http://en.wikipedia.org/wiki/Host_based_intrusion_detection_system" target="new"></a><span style="font-family: verdana,arial,helvetica,sans-serif;">HID (Host Intrusion Detection)</span><span style="font-family: verdana,arial,helvetica,sans-serif;">, </span><a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Chroot" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">chroot</span></a><span style="font-family: verdana,arial,helvetica,sans-serif;">, </span><a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Xinetd" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">xinetd</span></a><span style="font-family: verdana,arial,helvetica,sans-serif;"> and </span><a rel="nofollow" target="_blank" href="ftp://ftp.porcupine.org/pub/security/index.html" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">Tcpwrappers</span></a><span style="font-family: verdana,arial,helvetica,sans-serif;"> to name a few.</span></div>
</li>
<li>
<div align="left"><span style="font-family: Verdana;">Shut down any unnecessary network services on this node.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Join the mailing lists or RSS feed for the Free/Open Source applications you are using and general security mailing lists so you are sure to be aware of vulnerabilities and issues that might arise. Also check out CERT for a general mailing list or RSS feed on security vulnerabilities. </span><a rel="nofollow" target="_blank" href="http://www.us-cert.gov/current/" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">http://www.us-cert.gov/current/</span></a></div>
</li>
</ul>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Secure your Green Network</span></strong></p>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Don&#8217;t have a false sense of security just because you have strong and extensive IPCop/Copfilter configuration. Be sure to secure ALL of your machines. Consider a holistic view of security.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Consistently patch your internal green nodes</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Have a Anti-Virus/Malware Scanner and Anti-Spyware Defense. In my view that extends to ALL Operating Systems.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable a software firewall on your machines.</span></div>
</li>
</ul>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Hosting a server on a dynamic connection</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">As you are using a cable modem that gives your RED IPCop network interface a dynamic DHCP address, you will need to set up Dynamic DNS services to resolve to this host via a human usable form, other than IP Address.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><em>NOTE</em> â€“ Some ISPs block TCP port 80 (HTTP) 110 (POP3) and 25 (SMTP). To navigate around this, you can purchase port forwarding services from some of these dynamic DNS providers, run services on different non-blocked ports or upgrade to another provider. For the sake of this article we assume you have no ISP blocked ports.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Setting up Dynamic DNS</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Along with your dynamically assigned IP address (RED), you will want to use a Dynamic DNS service to be able to allow external access to your external web/mail. Setting up Dynamic DNS with IPCop is easily achieved. Simply pick a Dynamic DNS provider listed in the IPCop DYNDNS settings.</span></p>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Go into your IPCop settings in Service Pulldown &#8212; <strong>Services</strong> &gt;&gt; <strong>Dynamic DNS</strong> and under &gt;&gt; <strong>Add a host</strong>. Pick one of these supported DYNDNS providers.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Open up your favorite browser and go to the DYNDNS provider you have chosen from the list above and register with them.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Return to your IPCop web administration GUI and add the information in to your IPCop settings in Service Pulldown &#8212; <strong>Services</strong> &gt;&gt; <strong>Dynamic DNS.</strong></span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Now return to your IPCop web administration GUI and fill in the information as listed below and then click <strong>Add</strong>. It will then display under &#8220;current hosts&#8221;.</span></div>
</li>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_dynamic_dns_setup.png" alt="copfilter dynamic dns setup The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">What is Copfilter</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">An amazing project by open source developer Markus Madlener, to extend his IPCop&#8217;s capabilities to the application layer (see OSI Model). Copfilter greatly enhances the capabilities of the already powerful IPCop by offering the jaw dropping and impressive large list of capabilities:</span></p>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>POP3/SMTP Scanning</strong> &#8211; via P3Scan and ProxSMTP which allow for scanning of incoming and outgoing Email.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>HTTP Scanning</strong> &#8211; via HAVP which is a powerful HTTP scanning engine for scanning and securing your web traffic.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>FTP Scanning</strong> &#8211; via frox which allows for proxying of FTP traffic.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>Privacy Protection</strong> &#8211; via Privoxy which is an extremely powerful HTTP privacy protection filter which filters and or removes cookies, web ads, pop-ups and other annoying Internet junk.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>Antivirus Scanning</strong> &#8211; via ClamAV or F-Prot which can be used to scan your traffic for the ever prevalent malware. Please note F-Prot is a commercial product and you have to acquire a license to use it. This article utilizes the FOSS email scanner ClamAV.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>AntiSpam</strong> &#8211; via Spam Assassin, Vipul&#8217;s Razor, DCC, renattach, RulesDuJour which coupled together make a very effective anti-spam defense.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>Process Monitoring</strong> &#8211; via Monit which allows you to monitor all of these processes and restart them as needed.</span></div>
</li>
</ul>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Why Copfilter?</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">You might ask yourself, if I have a IPCop firewall why would I need Copfilter? As a network security mechanism, the firewall has undergone a serious metamorphosis from a simple packet filter that only understood little of what it carried across the wire, to fully stateful inspection mechanisms that understand layer 5-7. This a far cry from the days of a simple packet filtering router or even a stripped down set of ipchains. And as security is not one technology, process or technique alone, but many of them, Copfilter is another powerful mechanism of defense in protecting your application layer.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Installing Copfilter</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">IPCop does not contain add-on binaries by default so they need to be copied via SCP to your IPCop. Then you will be logging in securely via SSH to your IPCop to install these binaries.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Turn on SSH on your IPCop</span></strong></p>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Via the Webgui -&gt; <strong>System</strong> -&gt; <strong>Ssh Access</strong></span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Then click <strong>Save</strong></span></div>
</li>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><em>NOTE</em> &#8211; It is recommended that you shut off SSH access after you finish copying this code as SSH has many exploits.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable Squid on your IPCop</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Via the Webgui go to -&gt; <strong>Services</strong> -&gt; <strong>Proxy</strong></span></p>
<ul>
<li>
<div align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Enabled on Green</span></strong></div>
</li>
<li>
<div align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Transparent on Green</span></strong></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Then click <strong>Save.</strong></span></div>
</li>
</ul>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">SSH and SCP Clients</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Depending on your OS you may or may not have a native SCP or SSH client on your machine. Note the port number as TCP port 222 and NOT the default SSH/SCP port.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">GNU/Linux, Unix, BSD &amp; OSX Clients &#8211; Command Line #</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Command Line <em>SCP</em></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">scp -P 222 &lt;Copfilterpackage_version.tar.gz root@ipcop_green_address&gt;:/root</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Command Line <em>SSH</em></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">ssh -p 222 -l root ipcop_green_address</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Graphical SCP/SSH &#8211;&gt;</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">If you are wary of the command line or not interested, alternatively, there are several GUI clients in almost every OS. I will not address each and every one as they are so easy to use, simply requiring a drag and drop, or point and click operation.</span></p>
<p align="left"><em><span style="font-family: verdana,arial,helvetica,sans-serif;">OS X Clients &#8211;&gt;</span></em></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Cyberduck</span></strong></p>
<p align="left"><a rel="nofollow" target="_blank" href="http://cyberduck.ch/" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">http://cyberduck.ch/</span></a></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Fugu</span></strong></p>
<p align="left"><a rel="nofollow" target="_blank" href="http://rsug.itd.umich.edu/software/fugu/" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">http://rsug.itd.umich.edu/software/fugu/</span></a></p>
<p align="left"><em><span style="font-family: verdana,arial,helvetica,sans-serif;">Windows &#8211;&gt;</span></em></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">WinSCP &#8211; SCP Client</span></strong></p>
<p align="left"><a rel="nofollow" target="_blank" href="http://www.winscp.net/" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">http://www.winscp.net/</span></a></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Putty â€“ SSH Client</span></strong></p>
<p align="left"><a rel="nofollow" target="_blank" href="http://www.putty.nl/" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">http://www.putty.nl/</span></a></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">OpenSSH for Windows</span></strong></p>
<p align="left"><a rel="nofollow" target="_blank" href="http://sshwindows.sourceforge.net/" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">http://sshwindows.sourceforge.net/</span></a></p>
<p align="left"><em><span style="font-family: verdana,arial,helvetica,sans-serif;">*NIX &#8211;&gt;</span></em></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">gFtp</span></strong></p>
<p align="left"><strong><a rel="nofollow" target="_blank" href="http://gftp.seul.org/" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">http://gftp.seul.org/</span></a></strong></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Installing Copfilter</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">After you have SCP copied the Copfilter-x.x.tgz file to /root on your IPCop as detailed above you are now ready to install it.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">SSH into your IPCop with whatever client you possess on your respective Operating System.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">MD-What?</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Takes an MD5 to assure that the code you downloaded is not altered or corrupted by an external source. Doing this is a simple step verifying that what you have the original, legitimate binary.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Linux/UNIX MD5</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Md5sum is available in GNU/Linux and Unix by default</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">md5sum Copfilter-x.x.tgz and compare the output to what is listed on the download link as the MD5.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Microsoft Windows</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Windows users can use the easy to use and GPLd wxChecksums or MD5Summer. Both are FOSS software which is freedom geared and light on cost.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Apple OS X</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Apple users will need to open up a terminal window and type md5 Copfilter-x.x.tgz to verify the file.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Extract and Install the Binary</span></strong></p>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">cd /root</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">tar xzvf Copfilter-x.x.tgz (change x to your version number)</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">cd Copfilter-x.x.x</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">./install</span></div>
</li>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Follow the prompts and you are all done. Reboot your IPCop and to be safe empty your browsers cache. After rebooting your IPCop you should see the Copfilter navigation item on the right most top part of the screen (next to the IPCop penguin).</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Initial Copfilter Configuration</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Go to Copfilter -&gt; <strong>Email</strong> and configure your email address, SMTP server and then save those settings. The email address is your (root or administrator) email address and it will be used to notify you of updates and other important Copfilter messages.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">IMPORTANT &#8211; It is strongly recommended that you READ the Copfilter documentation to have an in-depth understanding of the configuration options that you choose to implement. RTFM before you design and definitely before you deploy.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Monit &#8211; Monitoring Copfilter</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">This service enables you to monitor the core services of the Copfilter application. It provides you some resilience by automatically restarting applications should they fail.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Your Configuration Monitoring</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_monitoring_setup.png" alt="copfilter monitoring setup The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Go to <strong>Copfilter</strong> &gt;&gt; <strong>Monitoring</strong></span></div>
</li>
<li>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Monitor all enabled services <strong>ON</strong></span></p>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Then click on <strong>Save settings</strong> (and restart service)</span></div>
</li>
</ul>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Copfilter Configuration Options</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">In controlling the three network services we are going to have ingress (ingoing) and egress (outgoing) control of in our IPCop/Copfilter configuration we have many granular options. Copfilter is going to be filtering our HTTP traffic, POP3, and SMTP traffic. The wonder of the Copfilter add-on is the plethora of options one can chose to deploy our configuration is of course only one of the many.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Copfilter &#8211; POP3 configuration &#8211; P3Scan</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The Post Office Protocol Version 3 is the industry standard for receiving email. The goal of our configuration is to block spam/malware from being received via our email clients.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">To access these setting go to <strong>Copfilter</strong> &gt;&gt; <strong>POP3 configuration</strong></span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">P3Scan Configuration</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_pop3_setup.png" alt="copfilter pop3 setup The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The following options detail those to be turned ON and all others will be left in the default OFF configuration.</span></p>
<ul>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable P3scan on incoming traffic on Green ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable P3scan on incoming traffic on Orange ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Add Copfilter Comment to Email Header</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Quarantine Spam if &#8230; *** OFF</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Tag Spam in Emails and modify the subject ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Stop Virus email and send virus notification instead ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Send a copy of virus notification to Email address ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Quarantine virus infected emails ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Remove emails in quarantine if older than (in days) 7</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Then click on Save settings (and restart service)</span></div>
</li>
</ul>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The net effect of this configuration will be an aggressive stance on scanning, dropping and notifying you of the spam/malware, before it reaches your internal network.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Copfilter &#8211; SMTP configuration &#8211; ProxSMTP</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Simple mail transfer protocol is the standard for email transmission on the the Internet today. With the power of Copfilter one can get very granular on controlling the flow of mail message to and from our network. </span><span style="font-family: verdana,arial,helvetica,sans-serif;">The goal of our configuration is to block spam/malware from being sent/received via our email clients.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">To access these setting go to <strong>Copfilter</strong> &gt;&gt; <strong>SMTP configuration</strong></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The following options are to be turned ON and all others will be left in the default OFF configuration.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">SMTP Filtering Configuration</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_smtp_setup.png" alt="copfilter smtp setup The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<ul>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable ProxSMTP to filter outgoing traffic on GREEN ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable ProxSMTP to filter outgoing traffic on ORANGE ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Add Copfilter Comment to Email Header ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable ProxSMTP to filter incoming traffic on RED </span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Email Server is located in network ORANGE</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Email Server IP Address 192.168.10.25</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Red IP Alias Ethernet Interface &#8211; eth2:1</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Tag Spam in emails and modify the subject ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Stop virus emails and opt. Send virus notification instead ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Send user a virus notification ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Use Copfilter Whitelist and Blacklist ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Remove emails in quarantine if older than (in days) 7</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Then click on Save settings (and restart service)</span></div>
</li>
</ul>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><em>NOTE</em> &#8211; Choices of the ProxSMTP on RED interface entails 2 options:</span></p>
<ul>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>RED scanning ON</strong> &#8211; Copfilter manages the creation of Iptables rules so these are not needed to be created manually through IPCop.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>RED scanning OFF</strong> &#8211; Copfilter with portforwarding rule to orange mail server with scanning done at the server. I.e. you could do your ingress smtp scanning on the Email server itself &amp; not with Copfilter. </span></div>
</li>
</ul>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">This configuration will be an proactive stance on the capturing, quarantining and deleting malware before it infect our trusted machines in the GREEN network. With quarantining ON it is recommended that an administrator be very responsive to the systems warnings about quarantine Spam, and process consistently, or it will be deleted on a weekly basis. I would not recommend keeping a Spam Quarantine setup if you are short on disk space and or want to increase this interval beyond one week. If you do you run the risk of filling up your disk. Also as whitelisting and blacklisting has been turned on remember to add in your whitelisted domains (trusted email sources) and blacklisted (domains you do not trust or want spam from).</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">HTTP Scanning &#8211; HAVP/Privoxy</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">HyperText Transfer Protocol is the protocol we use when we are surfing the Internet. HAVP (HTTP Antivirus Proxy) is a proxy server with the ClamAV anti-virus scanner. This will be crucial in your configuration to scan incoming HTTP traffic and keep malware off your machines.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">To access these setting go to <strong>Copfilter</strong> &gt;&gt; <strong>HTTP Filter</strong></span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">HTTP Configuration</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_httpscanning_setup.png" alt="copfilter httpscanning setup The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The following options are to be turned ON and all others will be left in the default OFF configuration.</span></p>
<ul>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Deny access to HTTP traffic ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable Transparent mode ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Filter HTTP traffic for Internet Junk ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Then click on Save settings (and restart service)</span></div>
</li>
</ul>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">This configuration will allow for malware to be filtered out at our IPCop box, such as browser exploits, phishing attempts and viruses. Additionally, ads, banners and other Internet advertising junk with Privoxy.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">With web banners and such that are blocked you will either see the item labeled &#8220;Advertisement&#8221; or an image of a checkered pattern indicating it has been blocked. If you hate ads as much as do I you can get an add-on for Firefox called Adblock that will allow client side blocking as well. Adblock </span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">AntiSpam &#8211; SpamAssassin and Rules Du Jour</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Spam Assassin will help your email server identify and filter Spam before it reaches your email client inbox. SpamAssassin uses Bayesian filtering, DNS blocklist, header and text analysis and collaborative filtering databases to keep your Spam at a minimum. Please note that the more filtering you do before delivering to the client the higher the load on the server.</span></p>
<ul>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>Rules Du Jour</strong> is a simple back script which will download new versions of Spam Assassin rules. This is very helpful in keeping your anti-spam defense in optimal shape.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>Razor</strong> is a distributed, collaborative spam detection and filtering network.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>DCC</strong> or Distributed Checksum Clearinghouse is an anti-spam content filter.</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>DNSBL</strong> are DNS Blacklists or ban lists based upon DNS entries of known spammers or known nodes/networks that once emanated Spam.</span></div>
</li>
</ul>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">To access these setting go to <strong>Copfilter</strong> &gt;&gt; <strong>AntiSpam</strong> configuration</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">AntiSpam Configuration</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_antispam2_setup.png" alt="copfilter antispam2 setup The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The following options are to be turned ON and all others will be left in the default OFF configuration.</span></p>
<ul>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Enable Spamassasin ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Score required to identify email as spam 6</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Send daily spam digest ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Razor, DCC, DNSBL ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Rules Du Jour &#8211; ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Automatic Update Enable every 1 days</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Then click on Save settings (and restart service)</span></div>
</li>
</ul>
</ul>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">AntiVirus &#8211; ClamAV</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">ClamAV is an amazing FOSS project virus scanner. Within Copfilter this is used to virus scan email and web traffic for malware.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">To access these settings go to Copfilter &gt;&gt; Antivirus</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Copfilter &#8211; Antivirus Configuration</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_antivirus_setup.png" alt="copfilter antivirus setup The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<ul>
<ul>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">ClamAV ON</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Automatic Update &#8211; Enable every 24 hours</span></div>
</li>
<li>
<div align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Then click on Save settings (and restart service)</span></div>
</li>
</ul>
</ul>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The effect of these settings is that ClamAV is going to update its virus definitions on its own and be available for scanning your SMTP/POP3 and HTTP traffic.</span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Allowing traffic between Different Networks</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Please note that there are certain default rules that IPCop implements on your network and be aware of the implications. See the following link for further details. </span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">By default the configuration uses the /etc/rc.d/rc.firewall.local and changes can be made through web GUI or via SSH. Any good firewall by default setup to deny any external connections behind its trusted networks. In IPCop speak that means that there is no ingress (incoming) access by default from the RED interface/network to any other Network. By default access from ORANGE to RED is Open so there is no need for any special configuration in this example. If you for whatever reason need access from your Orange &#8220;DMZ&#8221; to Internal GREEN you can define rules via DMZ Pinholes. </span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">IPCop Port Forwarding &#8211; HTTP</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">As detailed above SMTP and POP3 rules are created by Copfilter are automatically created. As for HTTP (RED to ORANGE) it is NOT so you have to create it in Port Forwarding as below. If you would like to open other ports to external access (ex. FTP, SSH) please be aware the services should be hardened and security as much as possible (see layered approach I detail above). </span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_portforwarding_setup.png" alt="copfilter portforwarding setup The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Copfilter Test &amp; Log</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">The most obvious way is via surf the web. Send and receive a test email. The Copfilter Test &amp; Log page can help you ascertain if your configuration is proper. The tests listed are very self-explanatory in that you can examine your Email/Spam defense by clicking on the buttons in the Test POP3 &amp; SMTP Scanning section. Below is the Test HTTP &amp; FTP Scanning section which you can click on to verify the functionality of your HAVP HTTP virus scanner by clicking on the link to the Eicar &#8220;test&#8221; virus. This page will come up blocked with the default HAVP message to show you that your HTTP is now secured from common malware, phishing attempts, and other threats.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Sending and testing the variety of email options on the test page will allow you to verify your SMTP/POP3 configuration. If you can send and receive your emails and see the following in your email headers &#8212; you are all set.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif; font-size: x-small;"><em>X-Filtered-With-Copfilter: Version 0.82 (ProxSMTP 1.3.91)</em></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif; font-size: x-small;"><em>X-Copfilter-Virus-Scanned: ClamAV 0.88/1291 &#8211; Thu Feb 16 21:15:09 2006</em></span></p>
<p align="left"><strong><span style="font-family: verdana,arial,helvetica,sans-serif;">Copfilter Test and Logs Screen</span></strong></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop2/copfilter_test_and_logs.png" alt="copfilter test and logs The Perfect Linux Firewall Part II    IPCop & Copfilter"  title="The Perfect Linux Firewall Part II    IPCop & Copfilter" /></span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Lastly, your log files are to the right bottom of your Copfilter Test &amp; Log page where you can see all the details of your Copfilter configuration.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Bravo! You are good to go! =) Now you can enjoy the fact you are much more secure than when you began this article!</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">If you like what you see, I welcome you to join our FOSS community. Free and Open Software (FOSS) does not sustain on developers alone but by the work of all sorts in technical writing, support, marketing, graphics, web developers and a multitude of other supporters like you! FOSS is built upon community, so join us and take part in reinventing computing in the positive directions from which we all collectively benefit.</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">In speaking with Markus I was able to ask him why he was motivated to create Copfilter and he answered, he said: &#8220;I created Copfilter to help protect the computers of my friends and family and the greater Internet community.&#8221; Markus I don&#8217;t think there is a better way to describe the spirit of FOSS. Much thanks to Markus and the entire IPCop Team and all the other projects that made this possible!</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>..::Check out the FOSS community Projects related to this article</strong> ::..</span></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">IPCop Homepage &#8211;&gt;</span><a rel="nofollow" target="_blank" href="http://www.ipcop.org/" target="new"><span style="font-family: verdana,arial,helvetica,sans-serif;">http://www.ipcop.org</span></a></p>
<p align="left"><span style="font-family: verdana,arial,helvetica,sans-serif;">Copfilter Homepage &#8211;&gt; <a rel="nofollow" target="_blank" href="http://www.copfilter.org/" target="new">http://www.copfilter.org</a><br />
</span></p>
<p><span style="font-family: verdana,arial,helvetica,sans-serif;">Copfilter Forum &#8211;&gt; <a rel="nofollow" target="_blank" href="http://copfilter.endlich-mail.de/" target="new">http://copfilter.endlich-mail.de/</a></span></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="copfilter admin">copfilter admin</a> (22)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="privoxy how to install on ipcop">privoxy how to install on ipcop</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="linux firewall">linux firewall</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="iptables firewall webgui centos">iptables firewall webgui centos</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="ipcop web proxy tutorial">ipcop web proxy tutorial</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="ipcop oprt to forward for mssql database connection">ipcop oprt to forward for mssql database connection</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="ipcop firewall blacklist block incoming">ipcop firewall blacklist block incoming</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="ipcop block port 80">ipcop block port 80</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="how to create dmz with ipcop">how to create dmz with ipcop</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html" title="free download cpanel ipcop">free download cpanel ipcop</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-ii-ipcop-copfilter.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Perfect Linux Firewall Part I &#8212; IPCop</title>
		<link>http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html</link>
		<comments>http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html#comments</comments>
		<pubDate>Thu, 22 Dec 2011 16:40:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Initial Setup]]></category>
		<category><![CDATA[ipcop]]></category>
		<category><![CDATA[layer]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[machine]]></category>
		<category><![CDATA[NOTE]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=34</guid>
		<description><![CDATA[The Perfect Linux Firewall Part I &#8212; IPCop Version 2.3 Author: Joseph Guarino Last edited 02/22/2006 This document describes how to install the GNU/Linux GPL IPCop firewall and create a small home office network. In the second installment we cover creating a DMZ for hosting your own web server or mail server and the Copfilter [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong>The Perfect Linux Firewall Part I &#8212; IPCop</strong><br />
Version 2.3<br />
Author: Joseph Guarino<br />
Last edited 02/22/2006</span></p>
<p>This document describes how to install the GNU/Linux GPL IPCop firewall and create a small home office network. In the second installment we cover creating a DMZ for hosting your own web server or mail server and the Copfilter proxy for filtering web and email traffic.</p>
<p>This is intended to be a quick and dirty overview on creating a IPCop firewall and comes without warranty of any kind!<br />
<strong><br />
What is IPCop</strong><br />
The IPCop project is a GNU/GPL project that offers an exceptional feature packed stand alone firewall to the internet community. Its comprehensive web interface, well documented administration guides, and its involved and helpful user/administrative mailing lists make users of any technical capacity feel at home. It goes far beyond a simple ipchains / netfilter implementation available in most Linux distributions and even the firewall feature sets of commercial competitors.</p>
<p>Firewalls have had to undergo a tremendous metamorphosis as a result of evolving threats. IPCop is exemplary in offering such a range of default features and even further a large set of optional plug-ins which can provide further functionality.</p>
<p>Some of IPCops impressive base install features include: secure https web administration GUI, DHCP Server, Proxying (Squid), DNS Proxying, Dynamic DNS, Time Server, Traffic Shaping, Traffic/Systems/Firewall/IDS graphing, Intrusion Detection (Snort), ISDN/ADSL device support and VPN (IPSec/PPTP) functionality. As if these base features were not an astounding enough there are dozens of add-ons which can further expand the functionality of your IPCop from Web Filtering to Anti virus scanning.</p>
<p><strong>Pre-Requisites for Your IPCop</strong><br />
IPCop installation generally runs 25 minutes, and you can complete it with relatively modest hardware requirements such as a 386 processor with 32MB RAM and &gt;300MB of disk, and 3 Network Cards (2 if there is no need for a DMZ). If you plan to utilize caching proxy, IDS or other add-ons, consider additional horsepower in terms of RAM/Processor.</p>
<p><strong>Building Your IPCop What you need</strong></p>
<ul>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">386 Processor with 32MB RAM, 300MB hard disk and 3 Network Cards </span></li>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">2 x 5 port 10/100/1000 switch or a Layer 3 switch </span></li>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">Network Cables</span></li>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">Burned ISO CD</span></li>
</ul>
<p><span style="font-family: verdana,arial,helvetica,sans-serif;"><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop/example_ipcop_network.png" alt="example ipcop network The Perfect Linux Firewall Part I    IPCop" border="0" hspace="0" title="The Perfect Linux Firewall Part I    IPCop" /></span></span></p>
<p><strong>Architectural Decisions: Segmentation</strong><br />
One essential consideration you have to make before installing is network architecture (segmentation/address space). IPCop uses color-coding system of Red, Green, Blue and Orange to describe the roles or security levels which an interface/network segment will have in protecting your network. Color coding is logical in that it represents a continuum of network access from restricted to permissive. A RED interface is your untrusted interface/segment like the Internet, whereas Green is the trusted interface/segment of your internal network. Additionally, Blue is for a separate segment for Wireless Devices, while Orange is for a DMZ or where any publicly accessible servers you want available to the Internet. In this case we are only configuring a Green/Red/Orange network installation with 3 network interfaces one of which is your cable broadband providers cable modem (Ethernet).<br />
<strong><br />
Understanding and Picking your address space</strong><br />
Before you begin it is important to know how your ISP TCP/IP settings. Does your ISP give you a DHCP address or a static IP address? In many cases simply going to your ISP&#8217;s Support page offers you this information. Most ISPs use DHCP to dynamically allocate IP address space so you get a non-static IP address that applies to your RED interface. Make note of the TCP/IP setting your ISP would have you use before you install.<br />
In architecting your IPCop solution you have the choice of setting up NAT (Network Address Translation) network address space. Green, Blue and Orange networks depend entirely on how many nodes or machines you will have on each network. There are 3 network spaces defined by the standards body, IETF, that can be used for these NAT&#8217;ed networks and they are:</p>
<p>10.0.0.0 &#8211; 10.255.255.255 (10/8 prefix)<br />
172.16.0.0 &#8211; 172.31.255.255 (172.16/12 prefix)<br />
192.168.0.0 &#8211; 192.168.255.255 (192.168/16 prefix)</p>
<p>If your Green network contains 15 hosts you can use 192.168.1.2-16. Your Green interface will run DHCP and pass out addresses to your internal network in this range. The same logic applies to address space on your Orange or DMZ network select a network space appropriate for the number of hosts/networks you will require.</p>
<p>&nbsp;</p>
<p>Installing your IPCop</p>
<p><span style="font-family: verdana,arial,helvetica,sans-serif;"><strong></strong>Verify hardware compatibility at IPCop website.<br />
Download the ISO&#8217;s and burn them.<br />
Connect all the physical layer i.e. Ethernet cables, hook up your monitor, keyboard and mouse to the machine that will be your IPCop<br />
Boot off the CD.<br />
Run through the simple prompt-based installation. NOTE: These are all very self-explanatory steps such as selecting your Language. The arrow Keys, Tab and Enter will help you navigate.</span></p>
<p><strong>Install Process</strong></p>
<ul>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">Select your language.</span></li>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">Select your Installation Medium, a CD in this case.</span></li>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">Configure your network cards The fastest way to configure your network interface cards is by selecting Probe option. If you know the network card information you can choose to your exact interface from Select. </span></li>
</ul>
<p><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop/ipcop_probe_interfaces.PNG" alt=" The Perfect Linux Firewall Part I    IPCop"  title="The Perfect Linux Firewall Part I    IPCop" /></span></p>
<p>Next, when you are asked enter your Green Interface an address which must be within your chosen address space (192.168.1.x in our example). Enter in place 192.168.1.1 in the IP address field.</p>
<p><span style="font-family: verdana,arial,helvetica,sans-serif;"><img src="http://static.howtoforge.com/images/ipcop/ipcop_green_interface_setup.PNG" alt=" The Perfect Linux Firewall Part I    IPCop"  title="The Perfect Linux Firewall Part I    IPCop" /><br />
Following this, IPCop will format and copy itself to your hard drive. See below.<br />
<img src="http://static.howtoforge.com/images/ipcop/ipcop_initial_install.PNG" alt=" The Perfect Linux Firewall Part I    IPCop"  title="The Perfect Linux Firewall Part I    IPCop" /></span></p>
<p>After the install has completed you will be prompted to reboot and run setup as shown. See below.<br />
<img src="http://static.howtoforge.com/images/ipcop/ipcop_congrats.PNG" alt=" The Perfect Linux Firewall Part I    IPCop"  title="The Perfect Linux Firewall Part I    IPCop" /></p>
<p><strong>Initial Setup</strong><br />
Having installed IPCop we now have to enter some further configuration information in setup for our setup to be complete.</p>
<ul>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">Enter in Keyboard, Time Zone and Hostname/Domain. </span></li>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">ISDN Setup As you are not using ISDN you should select to disable it </span></li>
<li><span style="font-family: verdana,arial,helvetica,sans-serif;">Network Configuration Type &#8211; Select the Interface configuration you will be running by tabbing to Network Configuration Type and hit the Enter key. </span></li>
</ul>
<p><span style="font-family: verdana,arial,helvetica,sans-serif;"><em><img src="http://static.howtoforge.com/images/ipcop/ipcop_network_config_menu.PNG" alt=" The Perfect Linux Firewall Part I    IPCop"  title="The Perfect Linux Firewall Part I    IPCop" /></em><br />
In our case you would select Red / Orange / Green.<br />
<img src="http://static.howtoforge.com/images/ipcop/ipcop_network_config_gor.PNG" alt=" The Perfect Linux Firewall Part I    IPCop"  title="The Perfect Linux Firewall Part I    IPCop" /></span></p>
<p>Since we have 3 interfaces and only have set up Green, repeat the interface setup options for the Red and Orange interfaces as described above.<br />
Configure the RED interface to use DHCP as this is interface connected to the Internet (i.e. Your ISP). Then configure your ORANGE interface to use the 192.168.10.x address space. For Red tab over to the DHCP box and select it by hitting Enter. So if your Green network will contain 15 hosts you can use 192.168.1.2-16. To set this up simply add in this range 192.168.1.2-16 and tab down to OK.</p>
<p><img src="http://static.howtoforge.com/images/ipcop/ipcop_setup_red_interface.PNG" alt=" The Perfect Linux Firewall Part I    IPCop"  title="The Perfect Linux Firewall Part I    IPCop" /></p>
<p>Password Setup &#8211; IPCop has 2 users which you will be asked to setup passwords for the root and admin. Set these both to a strong password &gt; 8 character password that is not a word in any language and contains Caps. A good example would be 1luv19c0p. Root password will be used to log on and add any add-ons or upgrades via SSH. Admin user is used to manage your IPCop day to day.</p>
<p>At the end of the IPCop installation you will be asked to reboot. After reboot go to another machine on your LAN and force your network interface card to update your dynamic (DHCP) address with ifconfig (Linux/Unix) or ipconfig (Windows). Verify you are live and active on the new network you have setup with an address on 192.168.1.x. With this validated connect to secure https web interface of IPCop. Type https://192.168.1.1:445 or https://192.168.1.1:81 and log in as the admin user.</p>
<p>Validate all your settings and connectivity. Then check out all the features you get with this great GNU Open Source Firewall. In the second installment of this how to we will discuss setting up a dynamic DNS, filtering email/web/proxing with Copfilter and allowing access to web/mail server of your choice in the DMZ or orange network. Until then go check out the <a rel="nofollow" target="_blank" title="IPCop.org" href="http://www.ipcop.org/" target="_blank">www.IPCop.org</a> website &amp; Happy Hacking!!</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="ipcop snort">ipcop snort</a> (10)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="xen ipcop">xen ipcop</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="the perfect linux firewall ipcop">the perfect linux firewall ipcop</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="how to further secure ipcop">how to further secure ipcop</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="perfect ip cop build">perfect ip cop build</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="linux proxy firewall with traffic shaping">linux proxy firewall with traffic shaping</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="open source firewall linux">open source firewall linux</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="perfect firewall">perfect firewall</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="perfect firewall server">perfect firewall server</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html" title="perfect linux proxy">perfect linux proxy</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/the-perfect-linux-firewall-part-i-ipcop.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Creating Firewall and Cluster Objects In Firewall Builder</title>
		<link>http://thegioinguonmo.com/security/howto-creating-firewall-cluster-objects-firewall-builder.html</link>
		<comments>http://thegioinguonmo.com/security/howto-creating-firewall-cluster-objects-firewall-builder.html#comments</comments>
		<pubDate>Mon, 19 Dec 2011 07:49:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=1938</guid>
		<description><![CDATA[Here I present an abbreviated explanation of the process of creating firewall and cluster objects. More detailed step-by-step guides are available in sections &#8220;Firewall Object&#8221; and &#8220;Cluster Object&#8221; of the Firewall Builder Users Guide. As usual, to create a firewall object I use main menu &#8220;Object/New object&#8221; which opens a menu of object types: Figure 4. Creating [...]]]></description>
			<content:encoded><![CDATA[<p>Here I present an abbreviated explanation of the process of creating firewall and cluster objects. More detailed step-by-step guides are available in sections &#8220;Firewall Object&#8221; and &#8220;Cluster Object&#8221; of the Firewall Builder Users Guide.</p>
<p>As usual, to create a firewall object I use main menu &#8220;Object/New object&#8221; which opens a menu of object types:</p>
<p><a name="web_server_cluster_fw_1"></a></p>
<p><strong>Figure 4. Creating first member firewall object</strong></p>
<p>&nbsp;</p>
<div id="attachment_6522"><strong><strong><img title="Linux Creating first member firewall object" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-1.png" alt="web server cluster fw 1 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="401" height="283" /></strong></strong>Figure 4. Creating first member firewall object</p>
</div>
<p>&nbsp;</p>
<p>After I choose the type &#8220;Firewall&#8221;, a wizard used to create new firewall object opens:</p>
<p><a name="web_server_cluster_fw_2"></a></p>
<p><strong>Figure 5. Choosing the name, platform and host OS for the firewall object</strong></p>
<p>&nbsp;</p>
<div id="attachment_6523"><strong><strong><img title="Linux Choosing the name, platform and host OS for the firewall object" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-2.png" alt="web server cluster fw 2 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="578" height="253" /></strong></strong>Figure 5. Choosing the name, platform and host OS for the firewall object</p>
</div>
<p>To make things simpler, I am going to use preconfigured template object &#8220;web server&#8221; that comes with the package. This object represents a machine with one interface &#8220;eth0&#8243; and comes with some basic firewall policy that can be useful as a starting point for the firewall configuration for a web server.</p>
<p><a name="web_server_cluster_fw_3"></a></p>
<p><strong>Figure 6. Choosing template firewall object</strong></p>
<p>&nbsp;</p>
<div id="attachment_6530"><strong><strong><img title="Linux Choosing template firewall object" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-3.png" alt="web server cluster fw 3 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="579" height="433" /></strong></strong>Figure 6. Choosing template firewall object</p>
</div>
<p>&nbsp;</p>
<p>Template firewall object has IP address that does not match address chosen for this example. The next page of the wizard allows me to change the address and add two more:</p>
<p><a name="web_server_cluster_fw_4"></a></p>
<p><strong>Figure 7. Changing ip address of the firewall object</strong></p>
<div id="attachment_6531"><img title="Linux Changing ip address of the firewall object" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-4.png" alt="web server cluster fw 4 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="567" height="598" />Figure 7. Changing ip address of the firewall object</p>
</div>
<p>Once I am done changing ip addresses and click &#8220;Finish&#8221;, the new firewall object is created and is added to the library of objects that was opened at the moment. In this example this library is called &#8220;Cookbook2&#8243;. I &#8220;floated&#8221; the object tree panel to make the screenshot more compact. You can see the new firewall object in the tree, its interfaces and ip addresses, as well as preconfigured policy rule set on screenshot Figure 8:</p>
<p><a name="web_server_cluster_fw_5"></a></p>
<p><strong>Figure 8. Firewall object created from the template</strong></p>
<p>&nbsp;</p>
<div id="attachment_6532"><strong><strong><img title="Linux Firewall object created from the template" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-5-300x243.png" alt="web server cluster fw 5 300x243 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="300" height="243" /></strong></strong>Figure 8. Firewall object created from the template</p>
</div>
<p>&nbsp;</p>
<p>The member firewall object&#8217;s interface &#8220;eth0&#8243; has only one IP address which is its own, in our example 10.3.14.108. Virtual addresses managed by heartbeat will be added to the cluster object later.</p>
<p>Next, I create the second member firewall linux-test-2 with its own ip address:</p>
<p><a name="web_server_cluster_fw_6"></a></p>
<p><strong>Figure 9. Two member firewall objects</strong></p>
<p>&nbsp;</p>
<div id="attachment_6535"><strong><strong><img title="Linux Two member cluster firewall objects" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-6.png" alt="web server cluster fw 6 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="500" height="519" /></strong></strong>Figure 9. Two member firewall objects</p>
</div>
<p>Because our firewall objects represent web servers which should never have to forward packets, we should turn ip forwarding off. To do this, double click the firewall object in the tree to open it in the editor, then click &#8220;Host OS settings&#8221; button and turn IP forwarding off as shown in Figure 10. Turning ip forwarding off in this dialog has several consequences: generated firewall script will actually turn it off on the server and Firewall Builder policy compiler will not generate any rules in the FORWARD chain.</p>
<p><a name="web_server_cluster_fw_6_1"></a></p>
<p><strong>Figure 10. Turn off ip forwarding</strong></p>
<p>&nbsp;</p>
<div id="attachment_6538"><strong><strong><img title="Linux Firewall Turn off ip forwarding" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-6-1.png" alt="web server cluster fw 6 1 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="439" height="356" /></strong></strong>Figure 10. Turn off ip forwarding</p>
</div>
<p>&nbsp;</p>
<p>Now that I have both firewall objects, I can create cluster object that will represent my HA pair. To do this, I select both firewall objects in the tree by clicking on them while holding Ctrl key, then click right mouse button to open context menu and choose item &#8220;New cluster from selected firewalls&#8221;:</p>
<div>
<p><a name="web_server_cluster_fw_7"></a><strong>Figure 11. Create cluster object from two member firewalls</strong></p>
<div id="attachment_6539"><img title="Linux Create cluster object from two member firewalls" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-7.png" alt="web server cluster fw 7 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="454" height="470" />Figure 11. Create cluster object from two member firewalls</p>
</div>
<div>
<div>
<p>This opens a wizard that will walk you through the process of creating new cluster object. The wizard was opened using &#8220;New cluster from selected firewalls&#8221; menu, because of that there are only two firewall objects in the list. If I used main menu &#8220;Object/New Object&#8221; and then &#8220;New Cluster&#8221;, I would see all firewalls defined in my data file in the list which can be quite long.</p>
<p><a name="web_server_cluster_fw_8"></a><strong>Figure 12. Choosing the name for the new cluster object</strong></p>
</div>
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_6540"><strong><strong><img title="Linux Choosing the name for the new cluster object" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-8-300x96.png" alt="web server cluster fw 8 300x96 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="300" height="96" /></strong></strong>Figure 12. Choosing the name for the new cluster object</p>
</div>
<p>&nbsp;</p>
<div title="Note">
<h3>Note</h3>
<p>A word about &#8220;Master&#8221; column. Not all failover protocols require one of the member firewalls to be designated as &#8220;master&#8221;. Most protocols used on Linux don&#8217;t, so you can disregard this setting on the first page of the wizard. It is needed for other platforms, such as PIX. In this sense setting &#8220;master&#8221; on the first page of the wizard is not optimal. We will rectify this in the future versions of Firewall Builder.</p>
</div>
<p><a name="web_server_cluster_fw_9"></a></p>
<p><strong>Figure 13. Choosing interfaces of the member firewalls</strong></p>
<p>&nbsp;</p>
<div id="attachment_6543"><strong><strong><img title="Linux Choosing interfaces of the member firewalls" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-9.png" alt="web server cluster fw 9 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="522" height="629" /></strong></strong>Figure 13. Choosing interfaces of the member firewalls</p>
</div>
<p>&nbsp;</p>
<p>This page of the wizard allows me to establish correspondence between interfaces of the member firewalls create cluster interface objects that will represent them. Cluster interface object should have the same name as corresponding member firewall interfaces. The program tries to guess what interfaces of the member firewalls can be used for the cluster and in a simple configuration like the one I am working with, guesses right.</p>
<p>On the next page of the wizard I can choose failover protocol used by the cluster on each interface (in principle, I can run different protocols on different interfaces) and virtual IP addresses.</p>
<p><a name="web_server_cluster_fw_10"></a></p>
<p><strong>Figure 14. Choosing IP addresses for the interfaces of the cluster</strong></p>
<p>&nbsp;</p>
<div id="attachment_6544"><strong><strong><img title="Linux Choosing IP addresses for the interfaces of the cluster" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-10.png" alt="web server cluster fw 10 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="523" height="627" /></strong></strong>Figure 14. Choosing IP addresses for the interfaces of the cluster</p>
</div>
<p>Next page of the wizard is particularly interesting. Here I can choose which member firewall policy to use for the cluster. This feature is designed mostly for those who convert from the old manually maintained configuration of redundant firewalls to the new cluster object and want to reuse policy rules that used to belong to one of the member firewalls.</p>
<p><a name="web_server_cluster_fw_11"></a></p>
<p><strong>Figure 15. Cluster will inherit rules of one of the member firewalls</strong></p>
<p>&nbsp;</p>
<div id="attachment_6547"><strong><strong><img title="Linux Cluster will inherit rules of one of the member firewalls" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-11.png" alt="web server cluster fw 11 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="524" height="259" /></strong></strong>Figure 15. Cluster will inherit rules of one of the member firewalls</p>
</div>
<p>&nbsp;</p>
<p>When new cluster object inherits policy and other rule sets of one of the members, the program copies rules from the designated member to the cluster, then it creates copies of all member firewalls, clears their rule sets and sets the cluster up to use these copies as members. It keeps old member firewall objects in the file, but they are marked as inactive and renamed. These objects are kept as a backup in case you may want to check their configuration or copy rules. New cluster object is shown in Figure 16:</p>
<p><a name="web_server_cluster_fw_12"></a></p>
<p><strong>Figure 16. New cluster object</strong></p>
<p>&nbsp;</p>
<div id="attachment_6548"><strong><strong><img title="Linux Firewall New cluster object" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-12.png" alt="web server cluster fw 12 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="599" height="480" /></strong></strong>Figure 16. New cluster object</p>
</div>
<p>&nbsp;</p>
<p>Each cluster interface has child &#8220;Failover group&#8221; object with the name &#8220;firewall:eth0:members&#8221; or similar. This is where you configure associated member firewall interfaces. Double click this object in the tree and then click &#8220;Manage Members&#8221; button in the dialog. Select interfaces of the member firewalls in the panel on the left hand side and click arrow button to add them to the list on the right. When you create cluster object using the wizard, the Failover Group objects are created automatically.</p>
<p><a name="web_server_cluster_fw_13"></a></p>
<p><strong>Figure 17. Failover group object</strong></p>
<p>&nbsp;</p>
<div id="attachment_6549"><strong><strong><img title="Linux Firewall Failover group object" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-13-300x255.png" alt="web server cluster fw 13 300x255 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="300" height="255" /></strong></strong>Figure 17. Failover group object</p>
</div>
<p>&nbsp;</p>
<p>Failover Group object not only ties interfaces of the member firewalls together, it is also the place where you configure failover protocol and its parameters. I am using heartbeat in this example and failover group object &#8220;web_server_cluster:eth0:members&#8221; is configured with this protocol as shown in Figure 17. To configure parameters of the protocol, click &#8220;Edit protocol parameters&#8221; button. This opens dialog Figure 18:</p>
<p><a name="web_server_cluster_fw_14"></a></p>
<p><strong>Figure 18. Parameters of heartbeat protocol</strong></p>
<p>&nbsp;</p>
<div id="attachment_6550"><strong><strong><img title="Linux Set Parameters of heartbeat protocol" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-14.png" alt="web server cluster fw 14 HowTo: Creating Firewall and Cluster Objects In Firewall Builder" width="402" height="264" /></strong></strong>Figure 18. Parameters of heartbeat protocol</p>
</div>
<p><strong> </strong>These parameters are used to generate policy rules that permit packets of the protocol.</p>
<p><em>About the author</em>: This article seires is contributed by Vadim Kurland {vadim at fwbuilder DOT org}, the main author of Firewall Builder.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/howto-creating-firewall-cluster-objects-firewall-builder.html" title="howto firewall builder kvm">howto firewall builder kvm</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/howto-creating-firewall-cluster-objects-firewall-builder.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firewall Builder: Convert Linux Iptables Configuration to OpenBSD and PF</title>
		<link>http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html</link>
		<comments>http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html#comments</comments>
		<pubDate>Mon, 19 Dec 2011 07:47:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=1936</guid>
		<description><![CDATA[Lets see how much effort it is going to take to convert this configuration to entirely different firewall platform &#8211; PF on OpenBSD. There are different ways to do this. I could make a copy of each member firewall (linux-test-1 and linux-test-2), set platform and host OS in the copy to PF and OpenBSD and [...]]]></description>
			<content:encoded><![CDATA[<p>Lets see how much effort it is going to take to convert this configuration to entirely different firewall platform &#8211; PF on OpenBSD. There are different ways to do this. I could make a copy of each member firewall (linux-test-1 and linux-test-2), set platform and host OS in the copy to PF and OpenBSD and then create new cluster object. This would be a sensible way because it preserves old objects which helps to roll back in case something does not work out. However, to make the explanation shorter, I am going to make the changes in place by modifying existing objects.</p>
<p>I start with member firewalls. Open each one in the editor and change its name, platform and host OS as shown in Figure 26 for the first member:</p>
<p><a name="web_server_cluster_fw_22"></a></p>
<p><strong>Figure 26. Converting member firewall to PF/OpenBSD</strong></p>
<p>&nbsp;</p>
<div id="attachment_6571"><strong><strong><img title="Converting Linux member firewall to PF/OpenBSD" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-22-272x300.png" alt="web server cluster fw 22 272x300 Firewall Builder: Convert Linux Iptables Configuration to OpenBSD and PF" width="272" height="300" /></strong></strong>Figure 26. Converting member firewall to PF/OpenBSD</p>
</div>
<p>&nbsp;</p>
<p>Set version of PF to match version of your OpenBSD machine. Do the same change to the second member firewall, then check failover group of interface &#8220;eth0&#8243; of the cluster object:</p>
<p><a name="web_server_cluster_fw_23"></a></p>
<p><strong>Figure 27. Failover group indicates that the cluster configuration does not match members</strong></p>
<p>&nbsp;</p>
<div id="attachment_6572"><strong><strong><img title="PF: Failover group indicates that the cluster configuration does not match members" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-23-300x104.png" alt="web server cluster fw 23 300x104 Firewall Builder: Convert Linux Iptables Configuration to OpenBSD and PF" width="300" height="104" /></strong></strong>Figure 27. Failover group indicates that the cluster configuration does not match members</p>
</div>
<p>&nbsp;</p>
<p>Failover group declares status of both members &#8220;Invalid&#8221;, this is because the platform and host OS of members do not match configuration of the cluster object anymore. They should match exactly, so we have to reconfigure the cluster object to platform &#8220;PF&#8221; and host OS &#8220;OpenBSD&#8221; as well. This should fix the status of both members in the failover group dialog.</p>
<p>To switch to OpenBSD from Linux we need to change failover protocol from heartbeat to CARP as well. The protocol is configured in the failover group object. List of available protocols depends on the firewall platform chosen in the parent cluster object. While cluster was set up as &#8220;iptables&#8221;, possible choices of failover protocols were &#8220;heartbeat&#8221;, &#8220;VRRP&#8221;, &#8220;OpenAIS&#8221; and &#8220;None&#8221;. &#8220;CARP&#8221; was not in the list because it is not available on Linux. After the cluster is switched to &#8220;PF&#8221;, the list consists only of &#8220;CARP&#8221; and &#8220;None&#8221; as shown in Figure 28:</p>
<p><a name="web_server_cluster_fw_24"></a></p>
<p><strong>Figure 28. Failover protocol choices for PF/OpenBSD </strong></p>
<p><strong><br />
</strong></p>
<p>&nbsp;</p>
<div id="attachment_6573"><strong><strong><img title="Firewall Builder: Failover protocol choices for PF/OpenBSD " src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-24-300x107.png" alt="web server cluster fw 24 300x107 Firewall Builder: Convert Linux Iptables Configuration to OpenBSD and PF" width="300" height="107" /></strong></strong>Figure 28. Failover protocol choices for PF/OpenBSD</p>
</div>
<p>&nbsp;</p>
<p>Firewall Builder can configure CARP interfaces on BSD. For that, it needs some parameters of the CARP protocol. You can configure these if you click &#8220;Edit protocol parameters&#8221; button in the failover group object dialog. This brings another dialog where you can configure CARP password, vhid and some other parameters:</p>
<p><a name="web_server_cluster_fw_24-1"></a></p>
<p><strong>Figure 29. CARP parameters </strong></p>
<p>&nbsp;</p>
<div id="attachment_6574"><strong><strong><img title="Firewall Builder OneBSD PF CARP parameters " src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-24-1.png" alt="web server cluster fw 24 1 Firewall Builder: Convert Linux Iptables Configuration to OpenBSD and PF" width="409" height="393" /></strong></strong>Figure 29. CARP parameters</p>
</div>
<p>&nbsp;</p>
<p>Last thing we have to change is the names of interfaces. On OpenBSD loopback is &#8220;lo0&#8243; and ethernet interface can be for example &#8220;pcn0&#8243;. To rename interfaces find them in the tree, open in the editor and change the name. This needs to be done with interface objects of both member firewalls and the cluster. Significant difference between CARP protocol and heartbeat on Linux is that CARP creates its own network interfaces named <em>&#8220;carpNN&#8221;</em>. In Firewall Builder terms this means we need to name cluster interface object <em>&#8220;carp0&#8243;</em> (remmber that in case of Linux cluster, cluster interface name was the same as names of corresponding member firewalls). After all interfaces have been renamed, my final configuration looks like shown in <a title="Figure 30. Final configuration for PF cluster">Figure 30</a>:</p>
<div title="Note">
<h3>Note</h3>
<p>I also changed ip addresses of interfaces pcn0 of both member firewalls to avoid conflict with still running linux firewalls.</p>
</div>
<p><a name="web_server_cluster_fw_25"></a></p>
<p><strong>Figure 30. Final configuration for PF cluster</strong></p>
<p>&nbsp;</p>
<div id="attachment_6575"><strong><strong><img title="Firewall Builder Final configuration for PF cluster" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-25.png" alt="web server cluster fw 25 Firewall Builder: Convert Linux Iptables Configuration to OpenBSD and PF" width="599" height="734" /></strong></strong>Figure 30. Final configuration for PF cluster</p>
</div>
<p>&nbsp;</p>
<p>Now we can recompile the cluster again. For PF fwbuilder generates two files for each member firewall. One file has extension .conf and contains PF configuration. The other file has extension .fw and is an activation script.</p>
<p>Looking inside the generated .conf file, we see PF implementation of the same policy rules (this is just a fragment with first few rules):</p>
<pre># Tables: (2)
table &lt;tbl.r0.d&gt; { 10.3.14.50 , 10.3.14.152 , 10.3.14.151 , 10.3.14.150 }
table &lt;tbl.r0.s&gt; { 10.3.14.152 , 10.3.14.151 , 10.3.14.150 , 10.3.14.50 }
# # Rule -2 CARP (automatic)
pass quick on pcn0 inet proto carp from any to any label "RULE -2 -- ACCEPT "
#
# Rule backup ssh access rule
# backup ssh access rule
pass in quick inet proto tcp from 10.3.14.0/24 to &lt;tbl.r0.d&gt; port 22 \
    flags any label "RULE -1 -- ACCEPT "
#
# Rule 0 (carp0)
block in log quick on pcn0 inet from &lt;tbl.r0.s&gt; to &lt;tbl.r0.s&gt; \
    no state label "RULE 0 -- DROP "
#
# Rule 1 (lo0)
pass quick on lo0 inet from any to any no state label "RULE 1 -- ACCEPT "</pre>
<p><a name="web_server_cluster_fw_26"></a></p>
<p><strong>Figure 31. Example of a rule associated with a cluster interface</strong></p>
<p>&nbsp;</p>
<div id="attachment_6576"><strong><strong><img title="Firewall Build Example of a rule associated with a cluster interface" src="http://files.cyberciti.biz/uploads/tips/2010/03/web-server-cluster-fw-26-300x21.png" alt="web server cluster fw 26 300x21 Firewall Builder: Convert Linux Iptables Configuration to OpenBSD and PF" width="300" height="21" /></strong></strong>Figure 31. Example of a rule associated with a cluster interface</p>
</div>
<p>&nbsp;</p>
<p>Look at the rule #0 in the screenshot Figure 19 (the anti-spoofing rule). The same rule is shown in Figure 31, except I removed label &#8220;outside&#8221; from the interface carp0 to make it clear which interface is placed in the &#8220;Interface&#8221; column of the rule.</p>
<p>This rule has interface object that belongs to the cluster in its &#8220;Interface&#8221; column. Firewall Builder GUI does not accept member firewall interface in this column. Only interfaces of the cluster are allowed in the &#8220;Interface&#8221; column of the rule set that belongs to the cluster. Interfaces of the Linux cluster have the same names as corresponding member firewall interfaces. In my example above member interfaces were &#8220;eth0&#8243; and cluster interface had the same name. This is because cluster interface object is an abstraction that serves several purposes: it is a place where failover protocol parameters are configured and also it represents member firewall interfaces in rules when the program compiles the policy and generates firewall script or configuration file. Cluster interface object will be replaced with interface of the member firewall for which the policy is being compiled. When fwbuilder compiles it for the member #1, it replaces cluster interface objects with interfaces of member #1. When it then compiles the same rules for member #2, it replaces cluster interfaces with interfaces of member #2.</p>
<p>This feels intuitive when we build Linux cluster because names of member interfaces and cluster interfaces are the same. When I use cluster interface &#8220;eth0&#8243; in the rule, it is essentially the same as using firewall&#8217;s interface with the same name (except it is not the same, internally) so it is the configuration I am used to when I start configuring clusters have spent some time working with regular firewalls in fwbuilder.</p>
<p>Interfaces of BSD cluster have names that directly correspond to the names of failover protocol interfaces <em>carpNN</em> which really exist on the firewall machine. The problem is that PF does not inspect packets on these interfaces and therefore PF rules should not be attached to these interfaces. Yet, fwbuilder uses BSD cluster interfaces <em>carpNN</em> in the same way as explained above. if you want to attach rules to particular interfaces using &#8220;on &lt;intf&gt;&#8221; clause, you need to use cluster interface object in the rules. In this case, just like when we were building Linux cluster, fwbuilder will replace <em>carpNN</em> with interfaces of member firewall that are configured in the failover group of the cluster interface.</p>
<p>I realize this can be counter-intuitive, especially to those who know all details of BSD cluster configuration by heart and are very used to working with CARP. We may be able to improve the model in future versions of fwbuilder if there is enough user demand.</p>
<div title="Note">
<h3>Note</h3>
<p>In addition to rules for the failover protocol, Firewall Builder can automatically add rules to permit packets used by the state synchronization protocol. In case of PF this is <em>pfsync</em>. Protocol parameters are configured in the &#8220;State Sync Group&#8221; object that is located in the tree immediately under the cluster. Generated script can also configure pfsync interface and some parameters of the protocol.</p>
</div>
<p>The bottom part of the activation script is interesting. This is where CARP interface is configured and PF configuration is activated. Here is how this looks like:</p>
<pre>configure_interfaces() {
    sync_carp_interfaces carp0
    $IFCONFIG carp0 vhid 100 pass secret    carpdev pcn0
    update_addresses_of_interface \
  "carp0 10.3.14.152/0xffffff00 10.3.14.151/0xffffff00 10.3.14.150/0xffffff00" ""
    update_addresses_of_interface "lo0 ::1/128 127.0.0.1/0xff000000" ""
    update_addresses_of_interface "pcn0 10.3.14.50/0xffffff00" ""
}
log "Activating firewall script generated Thu Mar 18 20:19:42 2010 by vadim"
set_kernel_vars
configure_interfaces
prolog_commands
$PFCTL   \
     -f \
    ${FWDIR}/bsd-test-1.conf || exit 1</pre>
<p>Shell function &#8220;sync_carp_interfaces&#8221; is defined at the beginning of the same script, it compares list of carp interfaces defined in Firewall Builder with carp interfaces that really exist on the firewall machine. Interfaces that are missing are created and those that exist but are not defined in fwbuilder are deleted. If the set of carp interfaces matches those defined in fwbuilder, this function does nothing. Next, the script configured interface carp0 using parameters entered in the failover protocol dialog <a title="Figure 29. CARP parameters">Figure 29</a> shown above. Calls to shell function &#8220;update_addresses_of_interface&#8221; update ip addresses of interfaces, including carp0. This function also does it incrementally by comparing required list of addresses with those that really are configured on the interface. If lists match, the function does not do anything, otherwise it adds or deletes addresses as appropriate.</p>
<p>Basically, you can start with OpenBSD or FreeBSD machine configured with one IP address on the interface that you can use to communicate with it. Script generated by fwbuilder will set up other addresses and failover protocol.</p>
<p>As you can see, conversion required few changes but not that much. I had to change firewall platform and host OS in member firewalls and cluster object, rename interfaces, possibly change IP addresses, change the name of the failover protocol and its parameters. Relationships between the cluster and member firewalls remained the same and so I did not have to add or remove firewalls to cluster failover group objects. Most importantly, I did not have to touch rules at all. Granted, this was very simple example and in more complicated cases some rules may need to be adjusted. Most often this is the case when original iptables policy used some modules and features unique to iptables. Most typical rules can be translated automatically with no change in the GUI.</p>
<p><em>About the author</em>: This article seires is contributed by Vadim Kurland {vadim at fwbuilder DOT org}, the main author of Firewall Builder.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html" title="cluster firewall linux">cluster firewall linux</a> (2)</li><li><a href="http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html" title="cpanel login errors because of iptables">cpanel login errors because of iptables</a> (1)</li><li><a href="http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html" title="firewall builder guide high availability">firewall builder guide high availability</a> (1)</li><li><a href="http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html" title="iptables comments change # to --comment">iptables comments change # to --comment</a> (1)</li><li><a href="http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html" title="linux script iptables example cluster rules file">linux script iptables example cluster rules file</a> (1)</li><li><a href="http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html" title="openbsd cluster">openbsd cluster</a> (1)</li><li><a href="http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html" title="uninstall fwbuilder centos">uninstall fwbuilder centos</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/firewall-builder-convert-linux-iptables-configuration-openbsd-pf.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: Linux flush or remove all iptables rules</title>
		<link>http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html</link>
		<comments>http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html#comments</comments>
		<pubDate>Sun, 18 Dec 2011 06:25:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[gnu linux]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[stop]]></category>
		<category><![CDATA[ubuntu linux]]></category>
		<category><![CDATA[use]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=1830</guid>
		<description><![CDATA[Here is small script that does this. Debian or Ubuntu GNU/Linux does not comes with any SYS V init script (located in /etc/init.d directory) . You create a script as follows and use it to stop or flush the iptables rules. Please don&#8217;t type rules at command prompt. Use the script to speed up work. [...]]]></description>
			<content:encoded><![CDATA[<p>Here is small script that does this. Debian or Ubuntu GNU/Linux does not comes with any SYS V init script (located in /etc/init.d directory) .</p>
<p>You create a script as follows and use it to stop or flush the iptables rules.</p>
<p>Please don&#8217;t type rules at command prompt. Use the script to speed up work.</p>
<h3>Procedure for Debian / Ubuntu Linux</h3>
<p>A) Create /root/fw.stop /etc/init.d/fw.stop script using text editor such as vi:</p>
<pre>#!/bin/sh
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT</pre>
<p>(B) Make sure you can execute the script:<br />
<code># chmod +x /root/fw.stop</code></p>
<p>(C) You can run the script:<br />
<code># /root/fw.stop</code></p>
<h2>A note for RedHat and friends Linux user</h2>
<p>Please note that RedHat enterprise Linux (RHEL) and Fedora / Centos Linux comes with pre-installed script, which can be used to stop the firewall:<br />
<code>#/etc/init.d/iptables stop</code></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="/etc/init d/iptables stop no such file or directory centos">/etc/init d/iptables stop no such file or directory centos</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="script ipchains plesk">script ipchains plesk</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="plesk flush firewall">plesk flush firewall</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="flush plesk iptables">flush plesk iptables</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="flush plesk firewall">flush plesk firewall</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="flush firewalll rules plesk">flush firewalll rules plesk</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="debian iptables directadmin">debian iptables directadmin</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="cpanel remove iptables rules">cpanel remove iptables rules</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="cpanel iptables rules delete">cpanel iptables rules delete</a> (1)</li><li><a href="http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html" title="cpanel init network iptables">cpanel init network iptables</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/how-to-linux-flush-or-remove-all-iptables-rules.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / UNIX: Scanning network for open ports with nmap command</title>
		<link>http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html</link>
		<comments>http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html#comments</comments>
		<pubDate>Sat, 17 Dec 2011 16:25:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=1761</guid>
		<description><![CDATA[You can use nmap tool for this job. It is flexible in specifying targets. User can scan entire network or selected host or single server. Nmap is also useful to test your firewall rules. namp is metwork exploration tool and security / port scanner. According to nmap man page: It is an open source tool [...]]]></description>
			<content:encoded><![CDATA[<p>You can use nmap tool for this job. It is flexible in specifying targets. User can scan entire network or selected host or single server. Nmap is also useful to test your firewall rules. namp is metwork exploration tool and security / port scanner. According to nmap man page:<br />
It is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. While Nmap is commonly used for security audits, many systems and network administrators find it useful for routine tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime.</p>
<h2>nmap port scanning</h2>
<p>TCP Connect scanning for localhost and network 192.168.0.0/24<br />
<code># nmap -v -sT localhost<br />
# nmap -v -sT 192.168.0.0/24</code></p>
<h3>nmap TCP SYN (half-open) scanning</h3>
<p><code># nmap -v -sS localhost<br />
# nmap -v -sS 192.168.0.0/24</code></p>
<h3>nmap TCP FIN scanning</h3>
<p><code># nmap -v -sF localhost<br />
# nmap -v -sF 192.168.0.0/24</code></p>
<h3>nmap TCP Xmas tree scanning</h3>
<p>Useful to see if firewall protecting against this kind of attack or not:<br />
<code># nmap -v -sX localhost<br />
# nmap -v -sX 192.168.0.0/24</code></p>
<h3>nmap TCP Null scanning</h3>
<p>Useful to see if firewall protecting against this kind attack or not:<br />
<code># nmap -v -sN localhost<br />
# nmap -v -sN 192.168.0.0/24</code></p>
<h3>nmap TCP Windows scanning</h3>
<p><code># nmap -v -sW localhost<br />
# nmap -v -sW 192.168.0.0/24</code></p>
<h3>nmap TCP RPC scanning</h3>
<p>Useful to find out RPC (such as portmap) services<br />
<code># nmap -v -sR localhost<br />
# nmap -v -sR 192.168.0.0/24</code></p>
<h3>nmap UDP scanning</h3>
<p>Useful to find out UDP ports<br />
<code># nmap -v -O localhost<br />
# nmap -v -O 192.168.0.0/24</code></p>
<h3>nmap remote software version scanning</h3>
<p>You can also find out what software version opening the port.<br />
<code># nmap -v -sV localhost<br />
# nmap -v -sV 192.168.0.0/24</code></p>
<h3>A note about Windows XP / 2003 / Vista version</h3>
<p>Windows user can find <a rel="nofollow" target="_blank" href="http://ntsecurity.nu/toolbox/ipeye/">ipEye</a> and <a rel="nofollow" target="_blank" href="http://ntsecurity.nu/toolbox/ipsecscan/">IPSecScan</a> utilities useful. Please note that <a rel="nofollow" target="_blank" href="http://www.insecure.org/nmap/nmap_download.html">Nmap</a> also runes on Windows OS.</p>
<p>Read the man page of nmap for more information:<br />
<code>$ man nmap</code></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html" title="bash nmap">bash nmap</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html" title="bash nmap script found">bash nmap script found</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html" title="nmap detect plesk version">nmap detect plesk version</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html" title="nmap open port scan">nmap open port scan</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html" title="open port scanner command in linux">open port scanner command in linux</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html" title="port scan network script linux">port scan network script linux</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html" title="unix scan system">unix scan system</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/linux-unix-scanning-network-for-open-ports-with-nmap-command.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>csf got an error: not klogd which logs kernel firewall messages to syslog</title>
		<link>http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html</link>
		<comments>http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html#comments</comments>
		<pubDate>Fri, 16 Dec 2011 16:46:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[nano]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=1476</guid>
		<description><![CDATA[E: syslogd appears to be running, but not klogd which logs kernel firewall messages to syslog. You should ensure that klogd is running R: nano -c /etc/init.d/syslog Search the line below, (nearly at line # 42) passed klogd skipped #daemon klogd $KLOGD_OPTIONS Replace it with lines below, #passed klogd skipped daemon klogd $KLOGD_OPTIONS Now search [...]]]></description>
			<content:encoded><![CDATA[<p>E: syslogd appears to be running, but not klogd which logs kernel firewall messages to syslog. You should ensure that klogd is running<br />
R: <code>nano -c /etc/init.d/syslog</code><br />
Search the line below, (nearly at line # 42)</p>
<blockquote><p>passed klogd skipped #daemon klogd $KLOGD_OPTIONS</p></blockquote>
<p>Replace it with lines below,</p>
<blockquote><p>#passed klogd skipped<br />
daemon klogd $KLOGD_OPTIONS</p></blockquote>
<p>Now search ‘status klogd’ (nearly at line #61) and uncomment it.</p>
<p>If you change the file, remember to restart syslog via <code>/etc/init.d/syslog restart</code></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="syslogd appears to be running but not klogd which logs kernel firewall messages to syslog you should ensure that klogd is running">syslogd appears to be running but not klogd which logs kernel firewall messages to syslog you should ensure that klogd is running</a> (28)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="syslogd appears to be running but not klogd which logs kernel firewall messages to syslog you should ensure that klogd is running csf">syslogd appears to be running but not klogd which logs kernel firewall messages to syslog you should ensure that klogd is running csf</a> (2)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="csf syslogd appears to be running but not klogd which logs kernel firewall messages to syslog you should ensure that klogd is running">csf syslogd appears to be running but not klogd which logs kernel firewall messages to syslog you should ensure that klogd is running</a> (2)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="but not klogd which logs kernel firewall messages to syslog">but not klogd which logs kernel firewall messages to syslog</a> (1)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="where is klogd on centos">where is klogd on centos</a> (1)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="syslogd appears to be running but not klogd which logs kernel firewall messages to syslog you should ensure that klogd is running csf centos">syslogd appears to be running but not klogd which logs kernel firewall messages to syslog you should ensure that klogd is running csf centos</a> (1)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="syslogd appears to be running but not klogd which logs kernel firewall messages to syslog">syslogd appears to be running but not klogd which logs kernel firewall messages to syslog</a> (1)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="syslogd appears to be running">syslogd appears to be running</a> (1)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="should ensure that klogd is running">should ensure that klogd is running</a> (1)</li><li><a href="http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html" title="make klogd running centos">make klogd running centos</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/csf-got-an-error-not-klogd-which-logs-kernel-firewall-messages-to-syslog.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: Block Port With IPtables</title>
		<link>http://thegioinguonmo.com/security/linux-block-port-with-iptables.html</link>
		<comments>http://thegioinguonmo.com/security/linux-block-port-with-iptables.html#comments</comments>
		<pubDate>Wed, 14 Dec 2011 12:11:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sbin]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=1381</guid>
		<description><![CDATA[How do I block port number with iptables under Linux operating systems? Port numbers which are recognized by Internet and other network protocols, enabling the computer to interact with others. Each Linux server has a port number (see /etc/services file). For example: TCP port 80 – HTTP Server TCP port 443 – HTTPS Server TCP [...]]]></description>
			<content:encoded><![CDATA[<p>How do I block port number with iptables under Linux operating systems?</p>
<p>Port numbers which are recognized by Internet and other network protocols, enabling the computer to interact with others. Each Linux server has a port number (see <a rel="nofollow" target="_blank" href="http://www.cyberciti.biz/faq/find-out-which-service-listening-specific-port/">/etc/services</a> file). For example:</p>
<ol>
<li>TCP port 80 – HTTP Server</li>
<li>TCP port 443 – HTTPS Server</li>
<li>TCP port 25 – Mail Server</li>
<li>TCP port 22 – OpenSSH (remote) secure shell server</li>
<li>TCP port 110 – POP3 (Post Office Protocol v3) server</li>
<li>TCP port 143 – Internet Message Access Protocol (IMAP) — management of email messages</li>
<li>TCP / UDP port 53 – Domain Name System (DNS)</li>
</ol>
<h2>Block Incoming Port</h2>
<p>The syntax is as follows to block incoming port using IPtables:</p>
<blockquote>
<pre class="brush:plain">/sbin/iptables -A INPUT -p tcp –destination-port {PORT-NUMBER-HERE} -j DROP

### interface section use eth1 ###
/sbin/iptables -A INPUT -i eth1 -p tcp –destination-port {PORT-NUMBER-HERE} -j DROP

### only drop port for given IP or Subnet ##
/sbin/iptables -A INPUT -i eth0 -p tcp –destination-port {PORT-NUMBER-HERE} -s {IP-ADDRESS-HERE} -j DROP
/sbin/iptables -A INPUT -i eth0 -p tcp –destination-port {PORT-NUMBER-HERE} -s {IP/SUBNET-HERE} -j DROP</pre>
</blockquote>
<p>To block port 80 (HTTP server), enter (or add to your iptables shell script):</p>
<pre class="brush:plain"># /sbin/iptables -A INPUT -p tcp --destination-port 80 -j DROP
# /sbin/service iptables save</pre>
<h3>Block Incomming Port 80 except for IP Address 1.2.3.4</h3>
<blockquote>
<pre class="brush:plain">    # /sbin/iptables -A INPUT -p tcp -i eth1 -s ! 1.2.3.4 –dport 80 -j DROP</pre>
</blockquote>
<h2>Block Outgoing Port</h2>
<p>The syntax is as follows:</p>
<blockquote><p>&nbsp;</p>
<pre class="brush:plain">/sbin/iptables -A OUTPUT -p tcp –dport {PORT-NUMBER-HERE} -j DROP

### interface section use eth1 ###
/sbin/iptables -A OUTPUT -i eth1 -p tcp –dport {PORT-NUMBER-HERE} -j DROP

### only drop port for given IP or Subnet ##
/sbin/iptables -A OUTPUT -i eth0 -p tcp –destination-port {PORT-NUMBER-HERE} -s {IP-ADDRESS-HERE} -j DROP
/sbin/iptables -A OUTPUT -i eth0 -p tcp –destination-port {PORT-NUMBER-HERE} -s {IP/SUBNET-HERE} -j DROP</pre>
</blockquote>
<p>To block outgoing port # 25, enter:</p>
<pre class="brush:plain"># /sbin/iptables -A OUTPUT -p tcp --dport 25 -j DROP
# /sbin/service iptables save
You can block port # 1234 for IP address 192.168.1.2 only:
# /sbin/iptables -A OUTPUT -p tcp -d 192.168.1.2 --dport 1234 -j DROP
# /sbin/service iptables save</pre>
<h2>How Do I Log Dropped Port Details?</h2>
<p>Use the following syntax:</p>
<blockquote>
<pre class="brush:plain"># Logging #
### If you would like to log dropped packets to syslog, first log it ###
/sbin/iptables -A INPUT -m limit –limit 5/min -j LOG –log-prefix “PORT 80 DROP: ” –log-level 7

### now drop it ###
/sbin/iptables -A INPUT -p tcp –destination-port 80 -j DROP</pre>
</blockquote>
<h2>How Do I Block Cracker (IP: 123.1.2.3) Access To UDP Port # 161?</h2>
<blockquote><p>&nbsp;</p>
<pre class="brush:plain">/sbin/iptables -A INPUT -s 123.1.2.3 -i eth1 -p udp -m state –state NEW -m udp –dport 161 -j DROP

# drop students 192.168.1.0/24 subnet to port 80
/sbin/iptables -A INPUT -s 192.168.1.0/24 -i eth1 -p tcp -m state –state NEW -m tcp –dport 80 -j DROP</pre>
</blockquote>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/linux-block-port-with-iptables.html" title="how to block a port plesk centos">how to block a port plesk centos</a> (2)</li><li><a href="http://thegioinguonmo.com/security/linux-block-port-with-iptables.html" title="plesk block outbound port 25 iptables">plesk block outbound port 25 iptables</a> (2)</li><li><a href="http://thegioinguonmo.com/security/linux-block-port-with-iptables.html" title="blocking port iptables windows">blocking port iptables windows</a> (1)</li><li><a href="http://thegioinguonmo.com/security/linux-block-port-with-iptables.html" title="close port 25 directadmin">close port 25 directadmin</a> (1)</li><li><a href="http://thegioinguonmo.com/security/linux-block-port-with-iptables.html" title="iptables block outbound port">iptables block outbound port</a> (1)</li><li><a href="http://thegioinguonmo.com/security/linux-block-port-with-iptables.html" title="plesk centos iptables">plesk centos iptables</a> (1)</li><li><a href="http://thegioinguonmo.com/security/linux-block-port-with-iptables.html" title="port blocking in windows similar to iptables in linux">port blocking in windows similar to iptables in linux</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/linux-block-port-with-iptables.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: thegioinguonmo.com @ 2012-05-20 18:30:19 -->
