<?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>Ubuntu Linux Help &#187; fwbuilder</title> <atom:link href="http://ubuntulinuxhelp.com/tag/fwbuilder/feed/" rel="self" type="application/rss+xml" /><link>http://ubuntulinuxhelp.com</link> <description>Tips, Tricks and How To&#039;s for the Ubuntu Linux User</description> <lastBuildDate>Thu, 19 Jan 2012 13:15:19 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator> <item><title>Using The Host Object in Firewall Builder</title><link>http://ubuntulinuxhelp.com/using-the-host-object-in-firewall-builder/</link> <comments>http://ubuntulinuxhelp.com/using-the-host-object-in-firewall-builder/#comments</comments> <pubDate>Wed, 15 Jul 2009 20:58:06 +0000</pubDate> <dc:creator>Vadim Kurland</dc:creator> <category><![CDATA[How To]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[fwbuilder]]></category> <category><![CDATA[host]]></category> <category><![CDATA[object]]></category> <category><![CDATA[policy]]></category> <category><![CDATA[rule]]></category> <category><![CDATA[security]]></category><guid
isPermaLink="false">http://ubuntulinuxhelp.com/?p=1724</guid> <description><![CDATA[This article continues the series of articles on Firewall Builder, a graphical firewall configuration and management tool that supports many Open Source firewall platforms as well as Cisco IOS access lists and Cisco ASA (PIX). Firewall Builder was introduced on this site earlier with articles Getting Started With Firewall Builder, Using Built-in Policy Importer in [...]]]></description> <content:encoded><![CDATA[<p>This article continues the series of articles on Firewall Builder,     a graphical firewall configuration and management tool that     supports many Open Source firewall platforms as well as Cisco IOS     access lists and Cisco ASA (PIX).  Firewall Builder was introduced     on this site earlier with articles <a
href="http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/" title="Getting Started with Firewall Builder"  target="_self"> Getting Started With Firewall Builder</a>, <a
href="http://ubuntulinuxhelp.com/using-built-in-policy-importer-in-firewall-builder/" title="Using Built-in Policy Importer in Firewall Builder"  target="_self">Using       Built-in Policy Importer in Firewall Builder</a>, <a
href="http://ubuntulinuxhelp.com/using-firewall-object-in-firewall-builder/" title="Using Firewall Object in Firewall Builder"  target="_self"> Using Firewall Object in Firewall Builder</a>.</p><p>More information on Firewall Builder, pre-built binary packages     and source code, documentation and <strong>Firewall Builder     Cookbook</strong> can be found on the project web site     at <a
href="http://www.fwbuilder.org/" title="FWbuilder"  target="_blank"> www.fwbuilder.org</a>. Watch <a
href="http://blog.fwbuilder.org/" title="FWbuilder Blog"  target="_blank">Project     Blog</a> for announcements and articles on all aspects of using     Firewall Builder.</p><p>This article demonstrates how you can work with <strong>Host</strong> objects in Firewall Builder.</p><h2>The Host Object</h2><p>The host object in Firewall Builder is designed to represent real     hosts in the network: workstations, servers, and any other network     node with an address. Just like real hosts, the host objects have     interfaces, representing different physical connections to the     network. Most Internet hosts will have just a single (visible)     interface with a single IP address. In that case the actual     interface and its name do not matter.  For most foreign hosts,     Firewall Builder will assign an arbitrary name “interface1” to the     hosts interface.  By using a tree-like hierarchy of hosts -&gt;     interfaces -&gt; addresses it is possible however to specify the     exact address and/or interface of a host in the case when it does     matter. Both interfaces and addresses are represented by objects,     which are organized in a tree. Interface objects sit in the tree     directly under the host, and the address objects are located under     their interfaces. The interface object can have either one or     multiple addresses. An example of a host with one interface with     multiple addresses is shown in the screenshot below. Host <strong>“test     server”</strong> has three virtual IP addresses that all belong to the     same interface <strong>“eth0”</strong>.</p><p>In Firewall Builder, the host object is<span
id="more-1724"></span> an abstraction. It does     not have to be restricted to an individual host. The following     host object may represent single physical computer with three ip     address, or a web farm that accepts connections on three IP     addresses, each on a different computer.</p><p><img
class="alignnone size-full wp-image-1725" title="Host in tree" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/host_in_tree.png?9d7bd4" alt="Host in tree" width="472" height="496" /></p><p>Note: The host object cannot have any access, NAT or     routing policy associated with it; only firewall     objects can have policies.</p><h2>Creating Host Object</h2><p><img
class="alignnone size-full wp-image-1726" title="Creating new host" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/creating_host1.png?9d7bd4" alt="Creating new host" width="472" height="491" /></p><p>To speed up the process and make it simpler,     creating a new host object is aided by the wizard     which collects all data needed for both the host and     its interfaces and then creates the object. The     screenshot above represents the first page of the     wizard.</p><p>Enter the host name. Generally, this name does not     have to be the same as the real host’s     name. However, if you are going to use SNMP to     populate the host’s interfaces, or if you are going     to use DNS to look up interface IP addresses, the     name does have to match.</p><p>You can create a new host from a template by     checking corresponding checkbox on the first page of     the wizard, or you can do it manually. Lets look at     the manual process. To do this, click &#8220;Next&#8221; button     to switch to the page where you can enter interfaces     and their addresses.</p><p><img
class="alignnone size-full wp-image-1727" title="Adding interface addresses" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/creating_host2.png?9d7bd4" alt="Adding interface addresses" width="472" height="491" /></p><p>If the new host object has a single interface (this,     perhaps, is the most common case) then you just need     to fill the entry field for its address and maybe MAC     address and click Next. If the object’s name is the     same as the real host name, then you can use the DNS     Lookup button to get the address from DNS.</p><p>Here you can add interfaces to the new host     object. Enter the interface name, address, and     netmask in the appropriate fields, then     click <strong>&#8220;Add&#8221;</strong> to add it to the list. (If the     interface is dynamic or unnumbered, then click the     appropriate checkbox instead of entering address     information.) The <strong>&#8220;Update&#8221;</strong> button updates     information for the interface that is selected in     the list, and the <strong>&#8220;Delete&#8221;</strong> button deletes the     currently selected interface.</p><p>This method only works for IPv4 addresses. If you     need to add an IPv6 address, save the host object     without the IPv6 address, then add the IPv6 address     to the interface.</p><p>Note: You can always add, modify and remove     interfaces of the new host object later using     controls provided by the main window and the object     tree view.</p><h3>Editing a Host Object</h3><p><img
class="alignnone size-full wp-image-1728" title="Editing a host object" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/host_dialog1.png?9d7bd4" alt="Editing a host object" width="472" height="227" /></p><p>The Host object dialog allows you to edit the     following parameters:</p><ul><li> Name &#8212; The Host object name.</li><li> MAC matching &#8212; If this option is activated, the         policy compiler uses the MAC addresses of all         interfaces of this host in the ﬁrewall         rules. Not all ﬁrewall platforms support MAC         address ﬁltering, so this option may have no         effect on the generated ﬁrewall script. This is         treated as a non-critical situation, and the         policy compiler will only generate a warning         while processing a ﬁrewall policy where such a         host is used.</li><li> Comment &#8212; This is a free-form text ﬁeld which         can be used to add comments.</li></ul><h3>Using Host Object in Rules</h3><p>When Host object is used in a rule, it acts as a     group of all of its addresses, that is, adresses     that belong to all of its interfaces. The only     exception is loopback interface; compilers skip its     address when they replace Host object with its     addresses.</p><p>Consider the following Host object. It has     interface <strong>eth0</strong> with two IP addresses and a     MAC address, interface <strong>he-ipv6</strong> with IPv6     address and a MAC address, interface <strong>lo</strong> (loopback) with its own IP address and     interface <strong>sit0</strong> (tunnel) with no address.</p><p><img
class="alignnone size-full wp-image-1729" title="Host interface" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/host_example_1.png?9d7bd4" alt="Host interface" width="472" height="662" /></p><p>Lets put this host object in a rule as follows:</p><p><img
class="alignnone size-full wp-image-1730" title="Host object in rule" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/host_example_2.png?9d7bd4" alt="Host object in rule" width="472" height="263" /></p><p>The rule set is configured as &#8220;IPv4 only&#8221;, so even     though interface <strong>he-ipv6</strong> has IPv6 address,     fwbuilder will ignore it while generating iptables     commands for this rule. Interface <strong>eth0</strong> has two     IPv4 addresses and both will be used. Here are iptables     commands generated for this rule:</p><p><strong><span
style="color: #ff6600;">$IPTABLES -A FORWARD -p tcp -m tcp  &#8211;dport 22  -m state &#8211;state NEW  -j Cid6066X5981.1<br
/> $IPTABLES -A Cid6066X5981.1  -d 10.3.14.44  -j ACCEPT<br
/> $IPTABLES -A Cid6066X5981.1  -d 10.3.14.55  -j ACCEPT<br
/> $IPTABLES -A Cid6066X5981.1  -d  -j ACCEPT</span></strong></p><p>Lets see what we get for the same rule if we configure     rule set object as &#8220;IPv4+IPv6&#8243;:</p><p><img
class="alignnone size-full wp-image-1731" title="Rule configuration" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/host_example_3.png?9d7bd4" alt="Rule configuration" width="472" height="263" /></p><p>Since rule is now configured to compile for both     address families, fwbuilder processes it twice,     using on each pass only those addresses of the host     that match address family. Here is what we get     (these are relevant fragments of the generated script):</p><p><em><span
style="color: #3366ff;"># ================ IPv4</span></em></p><p><span
style="color: #3366ff;"><em>$IPTABLES -A FORWARD -p tcp -m tcp  &#8211;dport 22  -m state &#8211;state NEW  -j Cid6066X5981.1<br
/> $IPTABLES -A Cid6066X5981.1  -d 10.3.14.44  -j ACCEPT<br
/> $IPTABLES -A Cid6066X5981.1  -d 10.3.14.55  -j ACCEPT<br
/> $IPTABLES -A Cid6066X5981.1  -d  -j ACCEPT</em></span></p><p><span
style="color: #3366ff;"><em># ================ IPv6</em></span></p><p><span
style="color: #3366ff;"><em>$IP6TABLES -A FORWARD -p tcp -m tcp  &#8211;dport 22  -m state &#8211;state NEW  -j Cid6066X5981.1<br
/> $IP6TABLES -A Cid6066X5981.1  -d fe80::a3:e2c  -j ACCEPT</em></span></p> ]]></content:encoded> <wfw:commentRss>http://ubuntulinuxhelp.com/using-the-host-object-in-firewall-builder/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using Firewall Object in Firewall Builder</title><link>http://ubuntulinuxhelp.com/using-firewall-object-in-firewall-builder/</link> <comments>http://ubuntulinuxhelp.com/using-firewall-object-in-firewall-builder/#comments</comments> <pubDate>Thu, 02 Jul 2009 15:09:52 +0000</pubDate> <dc:creator>Vadim Kurland</dc:creator> <category><![CDATA[How To]]></category> <category><![CDATA[address]]></category> <category><![CDATA[cisco]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[fwbuilder]]></category> <category><![CDATA[gateway]]></category> <category><![CDATA[icmp]]></category> <category><![CDATA[ip]]></category> <category><![CDATA[iptables]]></category> <category><![CDATA[ipv4]]></category> <category><![CDATA[ipv6]]></category> <category><![CDATA[object]]></category> <category><![CDATA[policy]]></category> <category><![CDATA[ruleset]]></category> <category><![CDATA[security]]></category> <category><![CDATA[snmp]]></category> <category><![CDATA[tcp]]></category> <category><![CDATA[udp]]></category><guid
isPermaLink="false">http://ubuntulinuxhelp.com/?p=1694</guid> <description><![CDATA[This article continues the series of articles on Fireall Builder, a graphical firewall configuration and management tool that supports many Open Source firewall platforms as well as Cisco IOS access lists and Cisco ASA (PIX). Firewall Builder was introduced on this site earlier with articles Getting Started With Firewall Builder and Using Built-in Policy Importer [...]]]></description> <content:encoded><![CDATA[<p>This article continues the series of articles on Fireall Builder,     a graphical firewall configuration and management tool that     supports many Open Source firewall platforms as well as Cisco IOS     access lists and Cisco ASA (PIX).  Firewall Builder was introduced     on this site earlier with articles <a
href="http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/" title="Getting Started with Firewall Builder"  target="_self"> Getting Started With Firewall Builder</a> and <a
href="http://ubuntulinuxhelp.com/using-built-in-policy-importer-in-firewall-builder/" title="Using Built-in Policy Importer in Firewall Builder"  target="_self">Using       Built-in Policy Importer in Firewall Builder</a>.</p><p>More information on Firewall Builder, pre-built binary packages     and source code, documentation and <strong>Firewall Builder     Cookbook</strong> can be found on the project web site     at <a
href="http://www.fwbuilder.org/" title="FWbuilder"  target="_blank"> www.fwbuilder.org</a>. Watch <a
href="http://blog.fwbuilder.org/" title="FWbuilder Blog"  target="_blank">Project     Blog</a> for announcements and articles on all aspects of using     Firewall Builder.</p><p>Firewall Builder supports variety of object types,     both simple such as address, network, host, or IP,     TCP, UDP and ICMP services, as well as more     sophisticated such as Firewall, Host, Address table,     DNS name, User service. Firewall object is central     to the program and is in the focus of this article.</p><h2>General Description</h2><p>A firewall object is designed to represent a real     firewall device in your network. This firewall object     will have interface and IP address objects that     mirror the real interfaces and IP addresses of the     actual device.  In addition, the firewall object is     where you create the access policy rule sets, NAT     rule sets, and routing rule sets that you assign to     your firewall device.</p><p>By default, a firewall has one Policy rule set, one     NAT rule set, and one routing rule set. However, you     can create more than one rule set using branching     rules (for firewalls that support them). On the     other hand, you don’t have to populate all the rule     sets. You can, for example, create a Policy ruleset     and leave the NAT and Routing rule sets empty. We     explains more about policies and rule sets below.</p><p>To speed up the creation of a firewall object,     Firewall Builder has a wizard that walks you through     creating the object. The wizard has three options     for creating a firewall object:</p><ul><li>From a template: Firewall Builder comes with         several pre-defined templates. You can use these         to create a firewall that is close to your         configuration, the modify it to fit your         needs. This method is demonstrated in the         &#8220;Getting Started with Firewall Builder&#8221; <a
href="http://www.fwbuilder.org/slideshows/tutorial_3/slide_1.html" title="Slideshow"  target="_blank">here</a> or <a
href="http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/" title="Getting Started with Firewall Builder"  target="_self">here</a>.</li><li>Manually: You can provide interface IP         address, subnet mask, gateway, and other         parameters manually. You can add this         information when you create the firewall, or you         can add it later.</li><li>Via SNMP: Firewall Builder uses SNMP queries         to learn about the network.</li></ul><h2>Creating Firewall Object Manually</h2><p>To start the firewall object creation wizard,     right-click the Firewalls folder in the User tree     and select New Firewall.</p><p>The first page of this wizard is displayed.</p><p><img
class="alignnone size-full wp-image-1695" title="New Firewall Wizard" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/new_firewall_wizard_1.png?9d7bd4" alt="New Firewall Wizard" width="472" height="554" /><span
id="more-1694"></span></p><p>Give the firewall object a name. Usually, this name     will be the same name as the device, but it doesn’t     have to be if you’re assigning interfaces     manually. (If you will use SNMP or DNS to populate     the interfaces, then the name must be the same as     the device name.) Then specify the firewall software     and OS. Leave the Use pre-configured template firewall     objects checkbox unchecked.  Click Next.</p><p><img
class="alignnone size-full wp-image-1696" title="Adding interfaces" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/new_firewall_wizard_2.png?9d7bd4" alt="Adding interfaces" width="472" height="554" /></p><p>Select Configure interfaces manually and click Next.</p><p><img
class="alignnone size-full wp-image-1697" title="Add and Edit Interfaces Manually" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/new_firewall_wizard_3.png?9d7bd4" alt="Add and Edit Interfaces Manually" width="472" height="554" /></p><p>Use this screen to add firewall interfaces. Populate     the following fields for an interface, then click Add     to add the interface. Then, populate the fields again     for the next interface. If you make a mistake, click     on the interface in the list, make your changes,     then click Update.</p><ul><li>Interface type: Indicate the type of         interface. We explain interface types in more         detail below.  Briefly, though, a Regular         interface has a static IP addresses, a Dynamic         address interface has a dynamic address provided         by something like DHCP, an Unnumbered interface         never has an IP address (PPPoE connection, for         example), and a Bridge por t is an interface         that is bridged in the firewall.</li><li>Name: The name of the interface object in         Firewall Builder must match exactly the name of         the interface of the firewall machine it         represents. This will be something like &#8220;eth0&#8243;,         &#8220;eth1&#8243;, &#8220;en0&#8243;, &#8220;br0&#8243;, and so on.</li><li>Label: On most OS’s this field is not used and         serves the purpose of a descriptive label. The         label is mandatory for Cisco PIX though, where         it must reflect the network topology. Firewall         Builder GUI uses the label, if it is not blank,         to label interfaces in the tree. One of the         suggested uses for this field is to mark         interfaces to reflect the network topology         (’outside’, ’inside’) or interface purpose (’web         frontend’ or ’backup subnet’).</li><li>Address: If the interface has a static IP         address, specify it here. (In Firewall Builder         version 3, this must be an IPv4 address. If you         need it to be an IPv6 address, create the         interface without an IP address, then add the         IPv6 address after you have created the firewall         object.)</li><li>Netmask: Use either a traditional netmask         (255.255.255.0) or slash notation (24, without         the actual slash) to specify the interface         netmask.</li><li>MAC: If you like, you can also specify the         interface physical address. The MAC address is         not necessary, but it can be used to combat         spoofing. If the feature is turned on and         available, and interface object with MAC address         is used in a policy rule, then the firewall will         only accept packets from the given IP address if         the MAC address also matches the one specified.</li></ul><p>Once all the interfaces are configured, click Finish     to create the new firewall object.</p><p><strong>Note:</strong> You can always add, modify and delete     interfaces later using controls provided in the main     window.</p><h2>Creating Firewall Object using SNMP discovery</h2><p>If your firewall runs SNMP daemon, you can save     yourself some time by using SNMP discovery to     automatically create interfaces of the new firewall     object.</p><p><img
class="alignnone size-full wp-image-1698" title="Use SNMP discovery" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/new_firewall_wizard_4.png?9d7bd4" alt="Use SNMP discovery" width="472" height="248" /></p><p>Start by checking checkbox &#8220;Use SNMP&#8221; on the second     page of the wizard and enter SNMP &#8220;read&#8221; community,     then click button &#8220;Discover interfaces using SNMP&#8221;.</p><p><img
class="alignnone size-full wp-image-1699" title="Discover interfaces using SNMP" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/new_firewall_wizard_5.png?9d7bd4" alt="Discover interfaces using SNMP" width="472" height="553" /></p><p>Firewall Builder will run series of SNMP queries to     the firewall to read the list of interfaces and     their addresses. Both IPv4 and IPv6 address can be     imported. For IPv6 the firewall must support IP-MIB     RFC4293. Once discovery process finishes, click     &#8220;Next&#8221;.</p><p><img
class="alignnone size-full wp-image-1700" title="Finish discovery process" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/new_firewall_wizard_6.png?9d7bd4" alt="Finish discovery process" width="472" height="493" /></p><p>Next page of the wizard offers an opportunity to     review discovered interfaces and make adjustments if     necessary. To change something, highlight an     interface, edit its parameters in the dialog, then     click &#8220;Update&#8221;. Finally when the process is done and     you click &#8220;Finish&#8221; in the wizard, the program     creates new firewall object in the tree and adds all     configured interfaces and their addresses.</p><h2>Editing Firewall Object</h2><p>The Firewall Object represents the firewall machine     and is the most complex object in Firewall Builder.     It has three sets of controls that you can modify,     not including the policy rule sets. All these     controls become available when you double-click the     firewall object in the tree.</p><p><img
class="alignnone size-full wp-image-1701" title="Edit Firewall Base Controls" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/edit_firewall_base_controls.png?9d7bd4" alt="Edit Firewall Base Controls" width="472" height="186" /></p><p>The base controls let you specify the basic settings     of the firewall, such as the name and firewall     platform.</p><ul><li>Name: Specify/change the name of the firewall object.</li><li>Platform: Specify/change the firewall software.</li><li>Version: Specify/change the version number of         the firewall software. In most cases, you can leave         this set to any.</li><li>Host OS: Specify/change the host operating         system of the firewall device.</li><li>Inactive firewall: Check this box to make the         firewall inactive. The firewall name will change to         a regular font (instead of bold) to indicate that         it is inactive, and the firewall will not be         available for compiling or         installation. Essentially, it’s a way to &#8220;comment         out&#8221; the firewall without deleting it.</li><li>Host OS Settings: Opens the Advanced Settings         dialog for the indicated Host OS.</li><li>Firewall Settings: Opens the Advanced Settings         dialog for the platform/firewall software.</li></ul><h2>Host OS Settings Dialog</h2><p>For explanations of the various controls, click the     Help button in the dialog.</p><p><img
class="alignnone size-full wp-image-1702" title="Edit Firewall Host OS Options" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/edit_firewall_hostos_options.png?9d7bd4" alt="Edit Firewall Host OS Options" width="472" height="526" /></p><h2>Firewall Settings Dialog</h2><p>For explanations of the various controls, click the     Help button in the dialog.</p><p><img
class="alignnone size-full wp-image-1703" title="Edit Firewall Settings" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/edit_firewall_firewall_settings.png?9d7bd4" alt="Edit Firewall Settings" width="472" height="471" /></p><h2>Interface Object</h2><p><img
class="alignnone size-full wp-image-1704" title="Edit firewall interface object" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/07/interface-1.png?9d7bd4" alt="Edit firewall interface object" width="472" height="185" /></p><p>Interface objects belong to firewall or host     objects. Interface objects cannot exist alone.  The     dialog for the interface object that belongs to the     firewall or host provides controls for the parameters     described here.</p><ul><li>Name: The name of the interface object in         Firewall Builder must match exactly the name of         the interface of the firewall machine it         represents. This will be something like &#8220;eth0&#8243;,         &#8220;eth1&#8243;, &#8220;en0&#8243;, &#8220;br0&#8243;, and so on.</li><li>Label: On most OS’s this field is not used and         serves the purpose of a descriptive         label. Firewall Builder GUI uses a label, if it         is not blank, to show interfaces in the         tree. One of the suggested uses for this field is         to mark interfaces to reflect the network         topology (’outside’, ’inside’) or the purpose         (’web frontend’ or ’backup subnet’). The label         is mandatory for Cisco PIX though, where it must         reflect the network topology.</li><li>Management interface: When firewall has         several network interfaces, one of them can be         marked as the ’management interface’. The         management interface is used for all         communication between Firewall Builder and the         firewall. For example, built-in policy installer         uses address of the management interface to         connect to the firewall via ssh when it copies         generated script or configuration         file to it.</li><li>External interface (insecure): Marks an         interface that connects to the Internet.</li><li>Unprotected interface: Marks interface to         which Firewall Builder should not assign any         access lists or firewall rules. Unprotected         interfaces are recognized by policy compilers         for Cisco IOS access lists and PF. Compiler for         IOS ACL just skips unprotected interfaces and         does not assign any ACL to them when it choses         which interface to associate given ACL         with. Compiler for PF generates &#8220;set skip         on &lt;interface_name&gt;&#8221; clause for unprotected           interfaces.</li><li>Regular Interface: Use this option if the         interface has an IP address assigned to it         manually (static IP address).</li><li>Address is assigned dynamically: Use this         option if the interface has a dynamic address         (obtained by means of DHCP or PPP or another         protocol). In this case an address is unknown at         the moment when Firewall Builder generates the         Firewall policy. Some firewalls allow for using         the interface name in the policy instead of its         IP address; the firewall engine then picks its         address either when the policy is activated or         even at run-time. Some other firewalls support         special syntax for rules that are supposed to         match packets headed to or from the firewall         machine. Examples of these two cases are OpenBSD         PF and Netfilter. PF rules can be constructed         using interface names; PF automatically uses the         current interface address when it loads rules         into the memory. Netfilter supports special         &#8220;chains&#8221; called &#8220;INPUT&#8221; and &#8220;OUPUT&#8221; that are         guaranteed to inspect only packets headed for         the firewall machine (&#8220;INPUT&#8221;) or originated on         it (&#8220;OUTPUT&#8221;). Both methods allow Firewall         Builder to build correct firewall policy rules         that affect the interface with a dynamic IP         address, however the interface must be marked as         such for the policy compiler to use proper         technique depending on the target firewall         platform. In cases where the rule has to use         actual IP address of the interface (example:         anti-spoofing rules), compiler emulates this         feature by adding shell script fragment to         determine the address at the time when firewall         script is executed and then uses the address in         rules. Such emulation is only possible on         platforms where firewall configuration is in the         form of the shell script, most notably this is         iptables script on Linux.</li><li>Unnumbered interface: Use this option if the         interface can never have an IP address, such as         the Ethernet interface used to run PPPoE         communication on some ADSL connections, or         tunnel endpoint interface. Although unnumbered         interface does not have an address, firewall         policy rules or access lists can be associated         with it.</li><li>Bridge port: This option is used for port of         bridged firewall. Compilers skip bridge ports         when they pick interfaces to attach policy and         nat rules to. For target firewall platforms that         support bridging and require special         configuration parameters to match bridged         packets, compilers use this attribute to         generate proper configuration. For example, in         case of iptables compiler uses <strong> -m           physdev &#8211;physdev-in</strong> or <strong> -m physdev &#8211;physdev-out</strong> for bridge port interfaces.</li><li>Security level: Depending on the firewall         platform, the security level is either         External/Internal or a numeric value between 0         and 100, with 0 being least secure and 100 being         most secure levels. This field in the GUI dialog         automatically shows controls appropriate to the         current firewall. Not all firewall support the         concept of a security zone.</li><li>Network zone: Network zone of this interface,         used only with Cisco PIX (ASA). Network zone         drop-down list shows all network objects and         groups of addresses and networks present in the         tree.  Choose one of them to tell the compiler         which networks and blocks of addresses can be         reached through this interface. Usually the         external interface (the one which connects your         firewall to the Internet) has the Network Zone         set to Any. It is also recommended that you         create a group of objects to represent Network         Zones for all other interfaces on the firewall.         The compiler uses this information to decide         which interface each ACL rule should be         associated with based on the addresses used in         the destination of the rule.</li></ul><p>We will take a look at other object types in the     next article.</p> ]]></content:encoded> <wfw:commentRss>http://ubuntulinuxhelp.com/using-firewall-object-in-firewall-builder/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using Built-In Revision Control in Firewall Builder</title><link>http://ubuntulinuxhelp.com/using-built-in-revision-control-in-firewall-builder/</link> <comments>http://ubuntulinuxhelp.com/using-built-in-revision-control-in-firewall-builder/#comments</comments> <pubDate>Thu, 25 Jun 2009 13:15:36 +0000</pubDate> <dc:creator>Vadim Kurland</dc:creator> <category><![CDATA[How To]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[fwbuilder]]></category> <category><![CDATA[policy]]></category> <category><![CDATA[rcs]]></category> <category><![CDATA[revisions]]></category> <category><![CDATA[rules]]></category> <category><![CDATA[security]]></category><guid
isPermaLink="false">http://ubuntulinuxhelp.com/?p=1658</guid> <description><![CDATA[This article continues the series of articles on Firewall Builder, a graphical firewall configuration and management tool that supports many Open Source firewall platforms as well as Cisco IOS access lists and Cisco ASA (PIX). Firewall Builder was introduced earlier with the article Getting Started With Firewall Builder. The series continued with articles on built-in [...]]]></description> <content:encoded><![CDATA[<p>This article continues the series of articles on Firewall Builder,     a graphical firewall configuration and management tool that     supports many Open Source firewall platforms as well as Cisco IOS     access lists and Cisco ASA (PIX).  Firewall Builder was introduced     earlier with the article <a
href="http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/" title="Getting Started with Firewall Builder"  target="_self"> Getting Started With Firewall Builder</a>. The series continued     with articles on <a
href="http://ubuntulinuxhelp.com/series/firewall-builder/" title="Firewall Builder Series"  target="_self">built-in     policy importer and other topics</a>.</p><p>More information on Firewall Builder, pre-built binary packages     and source code, documentation and <strong>Firewall Builder     Cookbook</strong> can be found on the project web site     at <a
href="http://www.fwbuilder.org/" title="Firewall Builder"  target="_blank"> www.fwbuilder.org</a>. Watch <a
href="http://blog.fwbuilder.org/" >Project     Blog</a> for announcements and articles on all aspects of using     Firewall Builder.</p><p>This article demonstrates one of the more advanced features of       Firewall Builder &#8211; built-in Revision Control System (RCS).</p><p>Firewall Builder GUI has built-in revision control     system that can be used to keep track of changes in     the objects and policy rules. If data file has been     added to the revision control system, every time it     is saved, the system asks the user to enter a     comment that describes changes done in the file in     this session and stores it along with the data. The     program also assigns new revision number to the data     file using standard software versioning system with     major and minor version numbers separated by a     dot. When you open this data file next time, the     program presents a list of revisions alongside with     dates and comments, letting you choose which revision     you want to use. You can open the latest revision and     continue working with the file from the point where     you left off last time, or open one of the older     revisions to inspect how the configuration looked     like in the past and possibly create a branch in the     revision control system. Here we take a closer look     at the built-in revision control system.</p><p>We start with a regular data file which we open in     the Firewall Builder GUI as usual. Note that the     name of the file appears in the titlebar of the main     window, here it is<strong> <em>[test2.fwb]</em></strong>:</p><p><img
class="alignnone size-full wp-image-1659" title="Firewall Builder" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_1.png?9d7bd4" alt="Firewall Builder" width="472" height="340" /></p><p>You can always see additional information about the     file using main menu <strong><em>File/Properties</em></strong>.  There     is not much the program can report about this file     that we do not know already. It shows full path where     it is located on the file system and<span
id="more-1658"></span> the date and time     of last modification, but otherwise since it has not     been added to the revision control system, there is no     additional information it can report.</p><p><img
class="alignnone size-full wp-image-1660" title="File properties" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_3.png?9d7bd4" alt="File properties" width="472" height="335" /></p><p>To start tracking revisions of this data file, use     menu <em>File/Add File to RCS</em>, the program     creates all necessary files and reports result in a     pop-up dialog. If for some reason adding file to the     revision control has failed, the program reports error     in the same pop-up dialog. <a
href="http://www.fwbuilder.org/docs/firewall_builder_faq.html#AEN652" title="Firewall Builder FAQ - Using RCS"  target="_blank">Firewall       Builder FAQ <strong>&#8220;Using RCS&#8221;</strong></a> has a list of     typical problems that may occur at this point.</p><p><img
class="alignnone size-full wp-image-1661" title="Add file to RCS" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_4.png?9d7bd4" alt="Add file to RCS" width="472" height="664" /></p><p><img
class="alignnone size-full wp-image-1662" title="File added to RCS" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_5.png?9d7bd4" alt="File added to RCS" width="472" height="171" /></p><p>Few things have changed in the GUI after the file has     been added to the revision control system. First,     besides its name the titlebar now shows its     revision. Inital revision number after the file has just     been added to the revision control is <strong><em>1.1</em></strong>.</p><p><img
class="alignnone size-full wp-image-1663" title="Policy" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_6.png?9d7bd4" alt="Policy" width="472" height="257" /></p><p>The File/Properties dialog shows that the file is now     being tracked by revision control system and its     current revision is<strong> <em>1.1</em></strong>. There is only one     revision in the history and the comment     is<strong> <em>&#8220;Initial revision&#8221;</em></strong> which is added     automatically by the program.</p><p><img
class="alignnone size-full wp-image-1664" title="File properties" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_7.png?9d7bd4" alt="File properties" width="472" height="324" /></p><p>Let&#8217;s see how revision control system keeps track of     the changes done in the data file. To demonstrate     this, I am going to make a change in one of the     objects, save the data file and check it (this creates     new revision), then I&#8217;ll close it and open it again,     first the latest revision where the change is present,     and then previous revision where the change is absent.</p><p>Here is the rule set of this firewall I have started     with, it is very simple and consists of just 5 rules:</p><p><img
class="alignnone size-full wp-image-1665" title="Rules set" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_8.png?9d7bd4" alt="Rules set" width="472" height="136" /></p><p>Now I added one more rule (to permit HTTP to the firewall). This is rule #3, it is colored yellow:</p><p><img
class="alignnone size-full wp-image-1666" title="Permit HTTP" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_9.png?9d7bd4" alt="Permit HTTP" width="472" height="148" /></p><p>Now I save ths file using menu<strong> <em>File/Save</em></strong> and     exit the program. Before I can do that, however, the     program tries to check the file in to the RCS and     presents a dialog where I can add a comment to     document the change I made. I enter the comment and     press <strong><em>Check file in</em></strong> button to complete     operation. The file is now checked in and the program     exits.</p><p><img
class="alignnone size-full wp-image-1667" title="Check file in" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_10.png?9d7bd4" alt="Check file in" width="472" height="315" /></p><p>Now I restart the program and try to open the same     file using <strong><em>File/Open</em></strong>. Since the file is now     in RCS, the program presents the dialog with the list     of its revisions. Each revision has a comment     associated with it, shown at the bottom of the     dialog. Note also that each revision also shows the     user name of the user who checked it in which is very     useful in a multi-user environment.</p><p><img
class="alignnone size-full wp-image-1668" title="RCS file revision" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_11.png?9d7bd4" alt="RCS file revision" width="472" height="388" /></p><p><img
class="alignnone size-full wp-image-1670" title="Revision notes" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_12.png?9d7bd4" alt="Revision notes" width="472" height="388" /></p><p>If I choose revision <strong><em>1.2</em> </strong>(the latest) and     open the file using button <strong><em>Open</em></strong>, I get my     rules including rule that permits HTTP to the     firewall:</p><p><img
class="alignnone size-full wp-image-1672" title="Open new revision" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_13.png?9d7bd4" alt="Open new revision" width="472" height="292" /></p><p>If I choose revision<strong> <em>1.1</em></strong> and open the file, I     get the policy that looks like this (note revision     number in the main window titlebar, it     is <strong><em>1.1</em></strong>):</p><p><img
class="alignnone size-full wp-image-1673" title="Open old revision" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_14.png?9d7bd4" alt="Open old revision" width="472" height="282" /></p><p>The rule to permit HTTP to the firewall is not there     because I opened old revision of the data     file. Essentially, I rolled back the change I made in     rev <strong><em>1.2</em></strong>. If I only wanted to look how rules     looked like in rev 1.1, then I can now just close the     file and open its latest revision to continue working     with it. I can not only just look at the rules in the     old revision, I can compile them and install on the     firewall if that is what I need to do. Note that this     can break things if some protocols were added to the     firewall rules later, but this can be useful if you     need to test things as they were few days ago.</p><p>However if I want to roll back the change and continue     without it, all I need to do is make the change in     this revision (1.1) and then save and check it     in. This will create a branch in RCS and I will be     able to continue working with it later. The previous     change, checked in as rev 1.2 will always be there     though and I will always be able to revert to it if I     want. The program does not merge branches, merging     changes in XML files is a complex task and is not     implemented at this time.</p><p>To illustrate creation of a branch, I am making a     change to the revision 1.1 of the data file as shown     on the next screenshot:</p><p><img
class="alignnone size-full wp-image-1674" title="Change, edit revision" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_141.png?9d7bd4" alt="Change, edit revision" width="472" height="282" /></p><p>I then save and check this file in with appropriate     comment. To check it in I use     menu <strong><em>File/Commit</em></strong>. I then close the file     using<strong> <em>File/Close</em></strong> and reopen it again     using<strong> <em>File/Open</em></strong>. This accomplishes the same     operation as in the example above in this document,     except I do not close the program. When I try to open     it, the program shows the branch and new     revision <strong><em>1.1.1.1</em></strong> that I just created. Note     that the time of the revision <strong><em>1.1.1.1</em></strong> is     later than the time of revision<strong> <em>1.2</em></strong>:</p><p><img
class="alignnone size-full wp-image-1675" title="RCS file preview" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/rcs_screenshot_16.png?9d7bd4" alt="RCS file preview" width="472" height="360" /></p><p>Now if I open rev <strong><em>1.1.1.1</em></strong> and continue     working with and check new changes in, the program     will create revision <strong><em>1.1.1.2</em></strong> and so on.</p><p>This document demonstrates how built-in revision     control system (RCS) in Firewall Builder GUI can be     used to document changes in the file. It can also be     used to roll back changes to previous revision both     temporary or permanently. Using RCS helps establish     accountability if several administrators can make     changes to the policy of firewalls because RCS keeps     track of the user name of user who checked changes     in. RCS in Firewall Builder works on all supported OS,     that is Linux, FreeBSD, OpenBSD, Windows and Mac OS     X. On Linux, *BSD and Mac OS X it relies on     system-wide installed <em>rcs</em> package, while on     Windows rcs tools are installed as part of the     Firewall Builder package. In general, I recommend     always using RCS even in simple cases when only one     administrator uses the tool. Ability to document     changes and roll back if necessary are great     advantages that help a lot to improve the process of     security policy management.</p> ]]></content:encoded> <wfw:commentRss>http://ubuntulinuxhelp.com/using-built-in-revision-control-in-firewall-builder/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using Built-in Policy Installer in Firewall Builder</title><link>http://ubuntulinuxhelp.com/using-built-in-policy-installer-in-firewall-builder/</link> <comments>http://ubuntulinuxhelp.com/using-built-in-policy-installer-in-firewall-builder/#comments</comments> <pubDate>Wed, 17 Jun 2009 16:32:36 +0000</pubDate> <dc:creator>Vadim Kurland</dc:creator> <category><![CDATA[How To]]></category> <category><![CDATA[configure]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[fwbuilder]]></category> <category><![CDATA[how to]]></category> <category><![CDATA[install]]></category> <category><![CDATA[iptables]]></category> <category><![CDATA[security]]></category> <category><![CDATA[server]]></category><guid
isPermaLink="false">http://ubuntulinuxhelp.com/?p=1622</guid> <description><![CDATA[This article continues the series of articles on Firewall Builder, a graphical firewall configuration and management tool that supports many Open Source firewall platforms as well as Cisco IOS access lists and Cisco ASA (PIX). Firewall Builder was introduced on this site earlier with articles Getting Started With Firewall Builder and Using Built-in Policy Importer [...]]]></description> <content:encoded><![CDATA[<p>This article continues the series of articles on Firewall Builder,     a graphical firewall configuration and management tool that     supports many Open Source firewall platforms as well as Cisco IOS     access lists and Cisco ASA (PIX).  Firewall Builder was introduced     on this site earlier with articles <a
href="http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/" title="Getting Started with Firewall Builder"  target="_self"> Getting Started With Firewall Builder</a> and <a
href="http://ubuntulinuxhelp.com/using-built-in-policy-importer-in-firewall-builder/" title="Using Built-in Policy Importer in Firewall Builder"  target="_blank">Using Built-in Policy Importer in Firewall Builder</a>.</p><p>More information on Firewall Builder, pre-built binary packages     and source code, documentation and <strong>Firewall Builder     Cookbook</strong> can be found on the project web site     at <a
href="http://www.fwbuilder.org/" title="www.fwbuilder.org"  target="_blank"> www.fwbuilder.org</a>. Watch <a
href="http://blog.fwbuilder.org/" title="Project blog"  target="_blank">Project Blog</a> for announcements and articles on all aspects of using     Firewall Builder.</p><p>After firewall configuration has been generated by     one of the policy compilers and saved in a file on     disk in the format required by the target firewall,     it needs to be transferred to the firewall machine     and activated. This function is performed by the     component we call &#8220;Policy Installer&#8221; which is part     of the Firewall Builder GUI.</p><p>Starting with version 2.0, Firewall Builder comes with built-in     installer that uses SSH to communicate with the     firewall. Installer works on all OS where Firewall Builder is     available: Linux, FreeBSD, Windows and Mac OS X.  On Linux, *BSD     and Mac OS X it uses standard ssh client that comes with the     system; on Windows it uses putty.</p><p>Installer needs to be able to copy generated firewall script to     the firewall and then run it there. In order to do so, it uses     secure shell. The program does not include ssh code, it uses     external ssh client.  On Linux, BSD and Mac OS X it uses standard     ssh client <strong>ssh</strong> and secure shell file copy     program <strong>scp</strong> that come with the system; <span
id="more-1622"></span>on Windows it     uses <strong>plink.exe</strong> and <strong>pscp.exe</strong>.  Full directory path to     ssh client program can be configured in the Preferences dialog     (accessible via Edit/Preferences menu), however if you are on     Linux, *BSD or Mac and use standard ssh client that is available     via your PATH environment variable, you do not need to change     default value there.</p><p>Installer works differently depending on the targert platform. In     case of Linux and BSD based firewalls it uses <strong>scp</strong> to copy     generated configuration files to the firewall machine and then     uses <strong>ssh</strong> to log in and run the script. In case of Cisco     routers or ASA appliance (PIX), it logs in, switched     to <strong>enable</strong> and then <strong>configuration</strong> mode and executes     configuration commands one by one in a manner similar     to <strong>expect</strong> scripts. It inspects router&#8217;s replies looking for     errors and stops if it detects one. In the end, it issues     command <strong>write mem</strong> to store new configuration in memory and     logs out.</p><p>Built-in policy installer has been designed to work with dedicated     firewall machine, that is, when computer where you run Firewall     Builder GUI and actual firewall are different     machines. Nevertheless, it can be used when they are the same     machine as well. The only difference is that in all commands below     you would use the name or address of the machine where you run     Firewall Builder instead of the name or address of the dedicated     firewall. SSH client will then connect back to the same machine     where it runs and everything will work exactly the same as if it     was different computer.</p><h2>How does installer decide what address to use to connect to the firewall</h2><p>Installer does not use the name of the firewall to     connect to, it always connects to its IP address. It     starts by scanning interfaces of the firewall object     looking for one that is marked as <em>&#8220;Management       interface&#8221;</em> using checkbox in the interface     object dialog. Installer will use address of this     interface to connect to. The <em>&#8220;management       interface&#8221;</em> checkbox looks like shown on the     next screenshot:</p><p><img
class="alignnone size-full wp-image-1624" title="Management interface" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/management_interface.png?9d7bd4" alt="Management interface" width="472" height="220" /></p><p>If your firewall has multiple addresses and you want     to use the one that is not assigned to its interface     in the fwbuilder object, then you can overwrite the     address using entry field in     the <em>&#8220;installer&#8221;</em> tab of the &#8220;advanced&#8221;     firewall object settings dialog, like this:</p><p><img
class="alignnone size-full wp-image-1625" title="Alternative firewall address" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/alternative_fw_address.png?9d7bd4" alt="Alternative firewall address" width="472" height="242" /></p><p>More about other input fields in this dialog below.</p><p>Finally you can overwrite the address on one-time     basis just for the install session using entry field     in the installer options dialog. This is the same     dialog where you enter password:</p><p><img
class="alignnone size-full wp-image-1626" title="Alternative FW address" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/alternative_fw_address_2.png?9d7bd4" alt="Alternative FW address" width="472" height="236" /></p><p>This works for all supported firewall     platforms, i.e. iptables on Linux, pf on OpenBSD and     FreeBSD, ipfw on FreeBSD and Mac OS X, ipfilter on     FreeBSD, Cisco IOS access lists and Cisco ASA     (PIX). Regardless of the platform, installer follows     the rules described here to determine what address     it should use to connect to the firewall.</p><h2>Configuring installer on Windows</h2><p>You can skip this section if you run Firewall     Builder GUI on Linux, *BSD or Mac OS X.</p><p>Here is the link to <a
href="http://www.fwbuilder.org/slideshows/using_putty/slide_1.html" title="How to configure built-in installer to use PuTTY ssh client on Windows."  target="_blank"> slide show </a> that demonstrates the process.</p><p>Download and install putty.exe, plink.exe and pscp.exe     somewhere on your machine (say, in     C:putty). Download URL is <a
href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/" title="PuTTY: A Free Telnet/SSH Client"  target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/</a></p><p>Installer does not use <strong>putty.exe</strong> but it will be     very useful for troubleshooting and for setting up     sessions and ssh keys.</p><p>In the Edit/Preferences dialog, in the &#8220;SSH&#8221; tab,     use &#8220;Browse&#8221; buttons to locate <strong>plink.exe</strong>.     Hit &#8220;OK&#8221; to save preferences. If you installed it     in <strong>C:putty</strong>, then you should end up     with <strong>C:puttyplink.exe</strong> in this entry     field. Do the same to configure path to <strong>pscp.exe</strong>.</p><p>You may log in to the firewall using regular user account or as root. See instructions below for an explanation how to configure sudo if you use regular user accounts. This part of the configuration does not depend on the OS you run Firewall Builder.</p><p>Before you try to use fwbuilder installer with plink.exe and pscp.exe, test it from the command line to make sure you can log in to your firewall. If this is the first time you try to log in to the firewall machine using putty.exe, plink.exe or pscp.exe, then it will discover new host key and ask you if it is correct and if you want to save it in cache. There are lots of resources on the Internet that explain what does this mean and how you should verify key accuracy before you accept it. If the key is already known to the program it will not ask you about it and will just proceed to the part where it asks you to enter password. Enter the password and hit &#8220;Return&#8221; to see if you can log in and see command line prompt from the firewall.</p><p>Here is the command (assuming you use account &#8220;fwadmin&#8221; to manage     firewall &#8220;guardian&#8221;):</p><p><strong><span
style="color: #ff6600;">C:Usersvadim&gt;c:PuTTYplink.exe -l fwadmin guardian</span></strong></p><p><img
class="alignnone size-full wp-image-1627" title="plink login" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/plink_login.png?9d7bd4" alt="plink login" width="472" height="201" /></p><p><strong>NOTE:</strong> Built-in installer does not use GUI ssh     client <strong>putty.exe</strong>, it uses command line     utilities that come from the same     author <strong>plink.exe</strong> and <strong>pscp.exe</strong>. You can     test with <strong>putty.exe</strong> but do not enter path to it     in the SSH tab of the Preferences dialog in fwbuilder,     it won&#8217;t work.</p><p>Configuring installer to use regular user account to manage the firewall:</p><p>Before v3.0.4 built-in installer could only use     regular account to activate policy if this account was     configured on the firewall to use sudo without     password. Starting with v3.0.4 this is not necessary     anymore because installer can recognize sudo password     prompts and enter password when needed.</p><ul><li> Create an account on the firewall (say,       &#8220;fwadmin&#8221;), create a group &#8220;fwadmin&#8221; and make       this user a member of this group. Most modern       Linux systems automatically create group with       the name the same as the name of the user       account.<p
class="command"><strong><span
style="color: #ff6600;">useradd fwadmin </span></strong></p></li><li> Create directory /etc/fw/ on the firewall, make       it belong to group fwadmin, make it group       writable<p
class="command"><strong><span
style="color: #ff6600;">mkdir /etc/fw<br
/> chgrp fwadmin /etc/fw<br
/> chmod g+w fwadmin /etc/fw</span></strong></li><li>Configure sudo to permit user fwadmin execute         firewall script and a couple of other commands         used by fwbuilder policy installer.  Run <strong>visudo</strong> on the firewall to edit file <strong>/etc/sudoers</strong> as follows:<p
class="command"><strong><span
style="color: #ff6600;">Defaults:%fwbadmin   !lecture , passwd_timeout=1 , timestamp_timeout=1<br
/> # User alias specification<br
/> %fwbadmin  ALL = PASSWD: /etc/fw/&lt;FWNAME&gt;.fw , /usr/bin/pkill , /sbin/shutdown</span></strong></p><p>here &lt;FWNAME&gt; is the name of the firewall.         Installer will log in to the firewall as user         fwadmin, copy firewall script to file         /etc/fw/&lt;FWNAME&gt;.fw and then use the         following command to execute it:</p><p
class="command"><strong><span
style="color: #ff6600;">ssh fwadmin@firewall sudo -S /etc/fw/&lt;FWNAME&gt;.fw </span></strong></p><p>Installer needs to be able to run <strong>pkill           shutdown</strong> to kill <strong>shutdown</strong> command         that may be running if you tried to install         policy in <strong>testing mode</strong> before. In         testing mode installer copies firewall         script to temporary directory <strong>/tmp</strong> then runs command <strong>shutdown -r           timeout</strong> to schedule reboot in a few         minutes and finally runs firewall script. To         cancel scheduled reboot you need to install         policy again, with test mode checkbox turned         off. In this case installer will copy         firewall script to its permanent place and         use <strong>pkill</strong> to kill running shutdown         command to cancel reboot.</li><li> set up ssh access to the firewall. Make sure you       can log in as user fwadmin using ssh from your       management workstation:<p
class="command"><strong><span
style="color: #ff6600;">ssh -l fwadmin &lt;FWNAME&gt; </span></strong></p><p>You may use either password or public key authentication; the       installer will work either way. Use <strong>putty.exe</strong> or <strong>plink.exe</strong> to test ssh access if you are on Windows       (see above for the explanation how to do this on Windows).</li><li> in the &#8220;installer&#8221; tab of the &#8220;firewall settings&#8221;       dialog of the firewall object put user name you use       to log in to the firewall (here it       is <em>&#8220;fwadmin&#8221;</em>): <img
class="alignnone size-full wp-image-1631" title="Installer tab" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/installer_tab_1.png?9d7bd4" alt="Installer tab" width="472" height="140" /><img
src="file:///home/roger/Sites/ubuntulinuxhelp.com/docs/vadim-kurland/using_built_in_installer_fwbuilder/installer_tab_1.png" alt="" /></li><li> if you need to use alternative name or IP       address to communicate with the firewall, put it       in the corresponding field in the same dialog       page</li><li> Make sure entry field &#8220;directory on the firewall       where script should be installed&#8221; is set       to <strong>/etc/fw</strong>. Firewall Builder is not going to       create this directory, so you need to create it       manually before you install firewall policy (see       above).</li><li> Leave &#8220;Policy install script&#8221; and &#8220;Command line options&#8221; fields blank.</li></ul><h2>Configuring installer if you use root account to manage the firewall:</h2><ul><li> Create directory /etc/fw/ on the firewall, make it       belong to root, make it writable</li><li> set up ssh access to the firewall. Make sure you       can log in as root using ssh from your       management workstation:<p
class="command"><strong><span
style="color: #ff6600;">ssh -l root &lt;firewall_name&gt; </span></strong></p><p>You may use either password or public key       authentication; the installer will work either       way.</li><li> in the &#8220;installer&#8221; tab of the &#8220;firewall       settings&#8221; dialog of the firewall object put       &#8220;root&#8221; as the user name you use to log in to the       firewall</li><li> Make sure entry field &#8220;directory on the firewall       where script should be installed&#8221; is set       to <strong>/etc/fw</strong></li><li> Leave &#8220;Policy install script&#8221; and &#8220;Command line options&#8221; fields are blank</li></ul><h2>Configuring installer if you regularly switch between Unix and Windows workstations using the same .fwb file and want to manage the firewall from both</h2><p>First of all, the .fwb file is portable and can be     copied back and forth between Linux/BSD and windows     machines. Even comments and object names entered in     local language should be preserved since the GUI     uses UTF-8 internally.</p><p>Built-in installer relies on path settings for ssh     and scp in Edit/Preferences/SSH.  Since preferences     are stored outside of the .fwb file, the installer     should work just fine when .fwb file is copied from     Unix to Windows and back. Just configure path to ssh     program in preferences on each system using default     settings &#8220;ssh&#8221; on Linux and path to plink.exe on windows     and give it a try.</p><p></p><h2>Always permit SSH access from the management workstation to the firewall</h2><p>One of the typical errors that even experienced     administrators make sometimes is block ssh access to     the firewall from the management workstation. You need     your workstation to be able to communicate with the     firewall in order to be able to make changes to the     policy, so you always need to add a rule to permit     this.  Firewall Builder can simplify this and generate     this rule automatically if you put an IP address of     your workstation in the entry field on the first page     of firewall settings dialog. Here is the screenshot     that illustrates this setting for an iptables     firewall; management station has an IP address     192.168.1.100</p><p><img
class="alignnone size-full wp-image-1632" title="Backup access" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/backup_access.png?9d7bd4" alt="Backup access" width="472" height="521" /></p><h2>Using putty sessions on Windows</h2><p>putty allows one to store destination host name or     address, user name and bunch of other parameters in     a session so that they all can be called up at     once. If you wish to use sessions, do the following:</p><ul><li> Configure putty as usual, create and test session         for the firewall, test it using putty outside of         the Firewall Builder. When you use session,         firewall host name and user name are stored in the         session file. Firewall Builder allows you to enter         session name in the entry field in the firewall         settings dialog where you would normally enter         alternative address of the firewall. Comment next         to the entry field reminds you about this.  Just         type session name in that field, leave user name         field blank and save the settings.</li><li> Once you start the installer, do not enter user         name in the &#8220;User name&#8221; field on the first page of         installer wizard, however you need to enter the         login and enable passwords. Configure the rest of         installer options as usual, they do not change         when you use putty sessions.</li></ul><h2>How to configure installer to use alternative ssh     port number</h2><p>If ssh daemon on your firewall is listening on an     alternative port, then you need to configure     built-installer so that it will run <strong>scp</strong> and <strong>ssh</strong> clients with command line parameters     that would make them connect to this port. This is     done in the &#8220;installer&#8221; tab of the firewall object     &#8220;advanced&#8221; settings dialog as shown on the following     screenshot (here we set the port to &#8220;2222&#8243;):</p><p><img
class="alignnone size-full wp-image-1633" title="Different SSH paot" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/different_ssh_port.png?9d7bd4" alt="Different SSH paot" width="472" height="309" /></p><p>On Unix command line option that specifies port number     is different for <strong>ssh</strong> and <strong>scp</strong>. It is     lowercase <strong>-p</strong> for <strong>ssh</strong> and     uppercase <strong>-P</strong> for <strong>scp</strong>.  If you     use <strong>putty</strong> tools <strong>plink.exe</strong> and <strong>pscp.exe</strong> on Windows, the option to specify     alternative port number is <strong>-P</strong> (capital &#8220;P&#8221;) for     both.</p><p>You can use the same input fields in this dialog to     add any other command line parameters for <strong>ssh</strong> and <strong>scp</strong>, for example this is where you can     confiugre parameters to make it use alternative     identity file (private keys). This information is     saved with a firewall object rather than globally     because you may need to use different parameters for     different firewall machines, such as different key     files or ports.</p><h2>How to configure installer to use ssh private keys     from a special file</h2><p>You can use the same entry fields in this dialog to     provide other additional command line parameters for <strong>ssh</strong> and <strong>scp</strong>, for example to use keys     from a different identity file. Here is how it looks     like:</p><p><img
class="alignnone size-full wp-image-1634" title="Different SSH keys" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/different_ssh_keys.png?9d7bd4" alt="Different SSH keys" width="472" height="63" /></p><p>Here I configure <strong>ssh</strong> and <strong>scp</strong> to use     alternative port and alternative identity     file <strong>~/.ssh/fwadmin_identity</strong>. The command line     parameter for the port is different for <strong>ssh</strong> and <strong>scp</strong>, but parameter for the identity file is     the same <strong>-i</strong> for both utilities.</p><p>On Windows, the simplest way (or may be the only way)     to use alternative keys is to use putty sessions.</p><h2>Troubleshooting ssh access to the firewall</h2><p>Built-in policy installer will not work if ssh access     to the firewall is not working. Test it using this     command on Linux if use you user &#8220;fwadmin&#8221; to manage     firewall:</p><p
class="command"><strong><span
style="color: #ff6600;">ssh -l fwadmin firewall </span></strong></p><p>If you use root account to manage the firewall, the     command becomes</p><p
class="command"><strong><span
style="color: #ff6600;">ssh -l root firewall </span></strong></p><p>On Windows use <strong>putty.exe</strong> or <strong>plink.exe</strong> to     do this:</p><p
class="command"><strong><span
style="color: #ff6600;">C:Usersvadim&gt;c:PuTTYplink.exe -l fwadmin firewall </span></strong></p><p
class="command"><strong><span
style="color: #ff6600;">C:Usersvadim&gt;c:PuTTYplink.exe -l root firewall </span></strong></p><p>If you can not log in using ssh at this point, verify     that ssh daemon is working on the firewall, that     existing firewall policy does not block ssh access and     ssh daemon configuration in /etc/ssh/sshd_config     permits login for root (if you plan to use root     account to manage the policy).</p><p></p><h2>Running built-in installer to copy generated     firewall policy to the firewall machine and activate     it there.</h2><p>Now that all preparations are complete, we can move on and     actually try to install newly generated firewall policy. Select     firewall object in the object tree in Firewall Builder GUI, click     right mouse button and use menu item &#8220;Install&#8221;. The program will     recompile the policy and open installer dialog.</p><p><img
class="alignnone size-full wp-image-1635" title="Installer IPtables" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/installer_iptables.png?9d7bd4" alt="Installer IPtables" width="472" height="499" /></p><p>(This how installer options dialog looks like for     iptables, pf, ipfilter and ipfw firewalls).</p><p>Here the program already entered user     name <strong>fwadmin</strong> in the &#8220;User Name&#8221; field, but     you can change it for one installation session if     you wish. Next you need to enter the password for     this user. <strong><em>This is the password of user         fwadmin on the firewall machine</em></strong>. Address     that will be used to comunicate with the firewall is     also entered by the program automatically, it is     taken from the firewall settings. You can change it     for one installation session as well.</p><p>Other installer parameters do the following:</p><ul><li><strong>Quiet install</strong>: as the name implies,         this checkbox suppresses all progress output of         the installer</li><li><strong>Verbose</strong>: this checkbox has the opposite         action, it makes the installer print a lot of         debugging information, including ssh client debug         output.</li><li><strong>Store a copy of fwb file on the           firewall</strong>: if this checkbox is on, the         installer will copy not only generated firewall         configuration files to the directory on the         firewall machine which is configured in the         &#8220;installer&#8221; tab of the firewall object dialog,         but also original .fwb data file as well. <strong>Use           of this option is discouraged if you manage many           firewalls from the same .fwb file because           distributing file that contains security policy           of multiple firewalls to all of them is a bad           idea</strong>.</li><li><strong>Test run</strong>: if this checkbox is on,         policy installer will copy firewall         configuration files to a temporary directory on         the firewall and will run them from there. The         intent is to test generated configuration         without making it permanent. If firewall machine         reboots, it will activate previous firewall         policy. Installer uses subdirectory <strong>&#8220;tmp&#8221;</strong> inside installation directory on the firewall         machine which is configured in the &#8220;installer&#8221;         tab of the firewall object dialog. If         installation directory configured there         is <strong>/etc/fw</strong> (as in the screenshot earlier         in this HOWTO), then installer will put files in         the directory <strong>/etc/fw/tmp</strong> when test         install option is in effect. <strong><em>You need to             create this directory on the firewall before             using this installation mode</em></strong>.</li><li> <strong>Schedule reboot in&#8230; </strong>: If this option is         on, installer schedules firewall reboot after         given time in minutes. This can be used as a         measure of last resort to protect against lost         of communication with the firewall which may         happen if there is an error in the new firewall         policy which makes it block ssh access from the         management machine. Installer uses         command <strong>shutdown -r +10min</strong> to schedule         reboot in 10 min. If installation has been         successfull and everything works right, you need         to repeat installation with options &#8220;test         install&#8221; and &#8220;Schedule reboot&#8221; turned off to         cancel reboot and install new policy         permanently.</li></ul><p>After all parameters are set and the password     entered, hit &#8220;OK&#8221; to start installation.</p><p>If this is the first time your management machine is     logging in to the firewall via ssh, it will find out     that ssh host key of the firewall is unknown to it     and will present you with a dialog:</p><p><img
class="alignnone size-full wp-image-1636" title="New SSH host key" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/new_ssh_host_key_dlg.png?9d7bd4" alt="New SSH host key" width="472" height="189" /></p><p>Here is says that it does not know host key of the     firewall &#8220;crash&#8221;. This is nothing more than a copy     of the warning message presented by the ssh     client. You should verify the host key manually and     if it matches, click &#8220;Yes&#8221;. If you click &#8220;No&#8221; in the     dialog, installation process will be interrupted.</p><blockquote><p>Installer only recognizes ssh client warning message     about unknown public host keys. If you rebuld your     firewall machine, which means its host key changes,     ssh will print different warning message which     fwbuilder installer does not recognise. In this case     you will see this message in the installer progress     window, but installation process will get stuck. You     need to use ssh client (<strong>ssh</strong> on Unix     or <strong>putty.exe</strong> on Windows) to update host key     before you can use fwbuilder policy installer with     this firewall again.</p></blockquote><p>After this, installer copies files to the firewall     and runs policy script there. You can monitor its     progress in the dialog as shown on the screenshot:</p><p><img
class="alignnone size-full wp-image-1637" title="Install dialogue overview" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/install_dialog_overview.png?9d7bd4" alt="Install dialogue overview" width="472" height="515" /></p><p>This is an example of successfull installation     session. Installer records the status in the left     hand side panel of the dialog. If you use installer     to update several firewall machines in one session,     their names and corresponding status of the     installation session for each will be shown in the     panel on the left. You can save installer log to a     file using &#8220;Sabe log to file&#8221; button, this can be     useful for documentation or troubleshooting.</p><p></p><h2>Running built-in installer to copy generated     firewall policy to Cisco router or ASA (PIX)</h2><p>From the user&#8217;s point of view the installer works the     same when you manage Cisco router or ASA firewall,     with only few minor differences. First of all, the     first screen of the installer, where you enter the     password, offers another input field for     the <strong>enable</strong> password as well.</p><p>You should be able to use IPv6 address to communicate     with the router.</p><p><img
class="alignnone size-full wp-image-1638" title="Cisco install dialogue" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/install_dialog_cisco.png?9d7bd4" alt="Cisco install dialogue" width="472" height="507" /></p><p>Most of the options and parameters in this dialog are     the same as those for Linux firewalls (see above). The     following parameters work differently for Cisco     devices:</p><ul><li><strong>Test run</strong>: if this checkbox is on, policy         installer will copy new access lists configuration         to the router or ASA appliance but will not         issue <strong>write mem</strong> command in the end.</li><li> <strong>Schedule reboot in&#8230; </strong>: If this option is         on, installer issues command <strong>reload in NNN</strong> after new configuration has been loaded. This         schedules reboot in NNN minutes. In combination         with &#8220;test run&#8221; option this can serve as a         roll-back mechanism in case of complete loss of         contact with the router or firewall because of an         error in the policy. Since &#8220;test run&#8221; does not         perform <strong>&#8220;write mem&#8221;</strong> in the end, the         original access list stays in startup         configuration of the router and will be loaded         after reboot.</li><li> <strong>Cancel reboot if policy activation was           successful</strong>: If this option is on, installer         issues command <strong>reload cancel</strong> in the end of         the policy activation process to cancel previously         scheduled reboot.</li></ul><p>Here is a screenshot of installation session to a     Cisco router. Note the output at the very top of the     log that shows how installer detected previously     unknown RSA host key and accepted it after the user     clicked &#8220;Yes&#8221; in the pop-up dialog (not shown on the     screenshot). It then logged into the router; you can     see the <strong>banner motd</strong> output from the     router. After this, installer switched     to <strong>enable</strong> mode, set terminal width and turned     off terminal pagination using <strong>terminal length 0</strong> command and finally switched to the <strong>configuration       mode</strong>. It then started enterig generated     configuration line by line.</p><p><img
class="alignnone size-full wp-image-1639" title="Cisco install progress" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/install_cisco_progress.png?9d7bd4" alt="Cisco install progress" width="472" height="735" /></p><p>The final part of the installation session looks like     this:</p><p><img
class="alignnone size-full wp-image-1640" title="Cisco install ends" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/install_cisco_progress_end.png?9d7bd4" alt="Cisco install ends" width="472" height="449" /></p><p>This was a successful installation session, with no     errors. Installer finished entering configuration     lines and issued <strong>exit</strong> command to exit     configuration mode, then <strong>wr mem</strong> command to save     configuration to memory and finally <strong>exit</strong> again     to log out.</p><p></p> ]]></content:encoded> <wfw:commentRss>http://ubuntulinuxhelp.com/using-built-in-policy-installer-in-firewall-builder/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using Built-in Policy Importer in Firewall Builder</title><link>http://ubuntulinuxhelp.com/using-built-in-policy-importer-in-firewall-builder/</link> <comments>http://ubuntulinuxhelp.com/using-built-in-policy-importer-in-firewall-builder/#comments</comments> <pubDate>Wed, 10 Jun 2009 15:23:36 +0000</pubDate> <dc:creator>Vadim Kurland</dc:creator> <category><![CDATA[How To]]></category> <category><![CDATA[configuration]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[fwbuilder]]></category> <category><![CDATA[how to]]></category> <category><![CDATA[import]]></category> <category><![CDATA[iptables]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[policy]]></category> <category><![CDATA[routing]]></category> <category><![CDATA[rules]]></category> <category><![CDATA[security]]></category> <category><![CDATA[user]]></category><guid
isPermaLink="false">http://ubuntulinuxhelp.com/?p=1560</guid> <description><![CDATA[This article continues the series of articles on Fireall Builder, a graphical firewall configuration and management tool that supports many Open Source firewall platforms as well as Cisco IOS access lists and Cisco ASA (PIX). Firewall Builder was introduced on this site earlier with article  Getting Started With Firewall Builder, More information on Firewall Builder, [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignleft size-full wp-image-1561" style="margin-left: 5px; margin-right: 5px;" title="Icon - Firewall Builder" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/icon_128x128.png?9d7bd4" alt="Icon - Firewall Builder" width="128" height="128" /> This article continues the series of articles on Fireall Builder, a graphical firewall configuration and management tool that supports many Open Source firewall platforms as well as Cisco IOS access lists and Cisco ASA (PIX). Firewall Builder was introduced on this site earlier with article  <a
href="http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/" title="Getting Started with Firewall Builder"  target="_self">Getting Started With Firewall Builder</a>,</p><p>More information on Firewall Builder, pre-built binary packages and source code, documentation and <strong>Firewall Builder Cookbook</strong> can be found on the project web site at <a
href="http://www.fwbuilder.org" title="Firewall Builder"  target="_blank">www.fwbuilder.org</a>. Watch Project Blog for announcements and articles on all aspects of using Firewall Builder.</p><p>This article demonstrates how you can import existing iptables or Cisco router configuration into Firewall Builder.</p><p>There are two ways to activate the feature: Main menu &#8220;<strong>File/Import Policy</strong>&#8221; or &#8220;<strong>Tools/Discovery Druid</strong>&#8221; and then choose option &#8220;<strong>Import configuration of a firewall or a router</strong>&#8220;. Only import of iptables and Cisco IOS access lists is possible in the current version.</p><h2>Importing existing iptables configuration</h2><p>iptables config that the program can import is in the format of iptables-save. Script &#8220;<strong>iptables-save</strong>&#8221; is part of the standard iptables install and should be present on all Linux distribution. Usually this script is installed in /sbin/ . When you run this script, it dumps current iptables configuration to stdout. It reads iptables rules directly form the kernel rather than from some file, so what it dumps is what is really working right now. To import this into fwbuilder run the script to save configuration to a file</p><p><strong><span
style="color: #ff6600;">iptables-save &gt; iptables_config.conf </span></strong></p><p><strong> </strong>Then launch fwbuilder, activate &#8220;<strong>Import Policy</strong>&#8221; function and use &#8220;Browse&#8221; button in the dialog to find file iptables_config.conf. You also need to choose &#8220;<strong>iptables</strong>&#8221; in the drop-down menu &#8220;<strong>Platform</strong>&#8220;.</p><p>If you do not choose iptables in the &#8220;<strong>Platform</strong>&#8220;, the program will try to interpret the file using different parser and will fail. The program does not make any assumptions about the file name or extension and can not predict automatically what platform is the configuration being imported is for.</p><p><img
class="alignnone size-full wp-image-1562" title="Import from file" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_1.png?9d7bd4" alt="Import from file" width="472" height="501" /></p><h2>Importing iptables configuration created in FireStarter</h2><p>The following example demonstrates<span
id="more-1560"></span> import of iptables policy generated by <strong>Firestarter</strong>, another popular iptables configuration management program.</p><p>After the platform is selected and file name entered, click &#8220;Next&#8221; to start the process.</p><p><img
class="alignnone size-full wp-image-1563" title="Import Configuration File" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_2.png?9d7bd4" alt="Import Configuration File" width="472" height="580" /></p><p>The program tries to interpret configuration file rule-by-rule and recreates its equivalent in fwbuilder. The progress window displays errors, if any, as well as some diagnostics that shows network and service objects created in the process. Note that user-defined iptables chains found in the configuration file will be re-created in fwbuilder as policy rule sets. The screenshot shows rulesets &#8220;LSI&#8221;, &#8220;LSO&#8221;, &#8220;OUTBOUND&#8221; being created. There were more but they did not fit in the output window. Address objects &#8220;h-10.3.14.10&#8243;, &#8220;h-10.3.14.255&#8243; and few others have been created as well. Service objects &#8220;tcp fsra/s&#8221;, &#8220;udp 0-0:0-0&#8243;, &#8220;icmp -1/-1&#8243; and few others have also been created.</p><p>Note that the new firewall object created in the process has generic name &#8220;New Firewall&#8221;. This is because iptables configuration file used for import does not have information about firewall machine name. It also does not have information about its interfaces, their names and addresses. The program can infer their names when it encounters &#8220;-i &lt;interface&gt;&#8221; or &#8220;-o &lt;interface&gt;&#8221; clause in the iptables configuration lines. It can not reliably detect their addresses though. You need to rename firewall object and add ip addresses to interfaces after the import manually.</p><p>Note also that only ipv4 part of the iptables configuration was imported. Currently, import of ipv6 iptables configuration is not supported.</p><p><img
class="alignnone size-full wp-image-1564" title="Import policy" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_3.png?9d7bd4" alt="Import policy" width="472" height="554" /></p><p>Screenshot above demonstrates rule sets that the program created from the configuration it imported. Rule sets &#8220;INBOUND&#8221;, &#8220;LOG_FILTER&#8221;, &#8220;LSI&#8221;, &#8220;LSO&#8221;, &#8220;OUTBOUND&#8221;, &#8220;Policy&#8221; are all of the type &#8220;Policy&#8221; and contain filtering rules. There were no NAT rules in the original configuration so the rule set &#8220;NAT&#8221; is created but is empty. Names of all policy rule sets match names of the iptables chains in the original configuration.</p><p><img
class="alignnone size-full wp-image-1566" title="Network" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_7.png?9d7bd4" alt="Network" width="472" height="175" /></p><p><img
class="alignnone size-full wp-image-1567" title="ICMP" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_8.png?9d7bd4" alt="ICMP" width="472" height="168" /></p><p><img
class="alignnone size-full wp-image-1568" title="TCP" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_9.png?9d7bd4" alt="TCP" width="472" height="169" /></p><p>screenshots above demonstrate address and service objects created by the program. It writes a comment in each object to remind that it was created automatically on import. Names of these objects are chosen automatically, you can rename objects to give them more meaningful names. Some of the objects created during import have the same properties as existing service and address objects from the Standard objects library. Currently the program does not cross-match them and just creates new objects, however in the future it may use standard objects instead.</p><p>Some rules in the original iptables config used &#8220;&#8211;tcp-flags&#8221; parameter to match only certain combinations of tcp flags. Here is an example:</p><p><strong><span
style="color: #ff6600;">-A INPUT -s 10.3.14.10 -p tcp -m tcp ! &#8211;tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT</span></strong></p><p>In order to be able to reproduce this rule, fwbuilder created special TCP service object with given combination of tcp mask and flags:</p><p><img
class="alignnone size-full wp-image-1571" title="TCP Service" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_10.png?9d7bd4" alt="TCP Service" width="472" height="191" /></p><p>The following screenshot demonstrates rules created in the main Policy rule set. These are the top iptables rules, some of them branch off to the other Policy rule sets. Some of the rules in the original policy did not match state (did not have clause &#8220;-m state &#8211;state NEW&#8221; or similar), these rules were created with the flag &#8220;stateless&#8221; turned on. In fwbuilder, this makes policy compiler generate iptables commands without &#8220;-m state &#8211;state NEW&#8221; clause which matches the original. These rules are marked with an icon that represents non-default rule options in the column &#8220;Options&#8221;.</p><p><img
class="alignnone size-full wp-image-1572" title="Policies importer" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_14.png?9d7bd4" alt="Policies importer" width="472" height="304" /></p><p>Lets inspect one group of rules little closer. The original iptables file contained the following commands:</p><p><strong><span
style="color: #ff6600;">-A INPUT -i eth0 -j INBOUND</span></strong></p><p><strong>-A INBOUND -p tcp -m state &#8211;state RELATED,ESTABLISHED -j ACCEPT<br
/> -A INBOUND -p udp -m state &#8211;state RELATED,ESTABLISHED -j ACCEPT<br
/> -A INBOUND -s 10.3.14.0/255.255.255.0 -j ACCEPT<br
/> -A INBOUND -s 10.3.14.0/255.255.255.0 -p tcp -m tcp &#8211;dport 22 -j ACCEPT<br
/> -A INBOUND -s 10.3.14.0/255.255.255.0 -p udp -m udp &#8211;dport 22 -j ACCEPT<br
/> -A INBOUND -j LSI</strong></p><p>The first rule is in chain INPUT and was recreated as rule #11 in the Policy rule set (rule colored green). Since it was in INPUT, the destination object in the rule #11 is the firewall itself. The &#8220;-i eth0&#8243; clause translated into interface object &#8220;eth0&#8243; in the &#8220;Interface&#8221; rule element and direction &#8220;Inbound&#8221;. The action of the rule #11 is &#8220;Branch&#8221;, pointing to the rule set &#8220;INBOUND&#8221;. This is direct recreation of the original rule in itpables config.</p><p><img
class="alignnone size-full wp-image-1573" title="New Firewall - Inbound" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_15.png?9d7bd4" alt="New Firewall - Inbound" width="472" height="142" /></p><p>This screenshot demonstrates rules created in the rule set &#8220;INBOUND&#8221;. Rule #0 matches CustomService object &#8220;custo-0-tcp&#8221; that was created to match combination of protocol &#8220;tcp&#8221; and state &#8220;RELATED,ESTABLISHED&#8221;. This object is shown in the following screenshot:</p><p><img
class="alignnone size-full wp-image-1575" title="Custom Service" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_11.png?9d7bd4" alt="Custom Service" width="472" height="173" /></p><p>Fwbuilder automatically adds a rule on top of generated iptables script to match packets in states &#8220;ESTABLISHED, RELATED&#8221;. With that rule, it is not necessary to have a rule like #0 in INBOUND, but since original script had it, fwbuilder reproduced it.</p><p>rule #1 in INBOUND matches protocol udp and state &#8220;ESTABLISHED,RELATED&#8221;. Other rules in INBOUND reproduce original rules from the chain INBOUND and match packets coming from the local net heading for the firewall machine. It is easy to see that the original policy was redundant: rules #2-4 match the same source and destination addresses but different services, but rule #2 matches any service which means rules #3 and 4 will never match any packets. Fwbuilder will detect this problem automatically if you try to compile this policy (this is called &#8220;Rule shadowing&#8221;).</p><p>All packets not matched by any rule in INBOUND will match last rule in this rule set which branches to the rule set LSI. Rule set LSI logs various packets and drops them:</p><p><img
class="alignnone size-full wp-image-1576" title="New Firewall LSI" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_16.png?9d7bd4" alt="New Firewall LSI" width="472" height="195" /></p><p>The first thing about rules in this rule set that                   catches the eye is why do we have all these rules                   with action &#8220;Continue&#8221;.</p><p>When a rule is marked as &#8220;logging&#8221; in fwbuilder, it                   gets an icon in the column &#8220;Options&#8221; that represents                   log, this icon appears either by itself or next to                   the icon that represents non-default rule                   options. However, iptables does not allow for an                   action &#8220;Accept&#8221; or &#8220;Deny&#8221; to be used in combination                   with logging, in iptables logging is separate target                   just like &#8220;ACCEPT&#8221; or &#8220;DROP&#8221;. Because of that,                   fwbuilder splits a rule that has action &#8220;Accept&#8221; or                   &#8220;Deny&#8221; or any other with logging turned on. One such                   rule becomes two or more iptables rules in the                   generated script. Unfortunately when iptables script                   is imported back, the program can not merge such                   rules and logging rules appear in the rule set as                   separate rules with logging icon in the &#8220;Options&#8221;                   column and action &#8220;Continue&#8221;. This is a valid                   configuration in fwbuilder, it just means that the                   rule generates log record but does not make any                   decision whether the packet should be accepted or                   denied and the firewall should continue its                   inspection.</p><p>Here is the fragment of the original iptables rules in                   the chain LSI:</p><p><strong><span
style="color: #ff6600;">-A LSI -p tcp -m tcp &#8211;tcp-flags FIN,SYN,RST,ACK SYN<br
/> -m limit &#8211;limit 1/sec -j LOG &#8211;log-prefix &#8220;Inbound &#8221; &#8211;log-level 6<br
/> -A LSI -p tcp -m tcp &#8211;tcp-flags FIN,SYN,RST,ACK SYN -j DROP </span></strong></p><p>These rules become rules #1 and 2 in rule set LSI in fwbuilder. The first rule, the one that does logging, becomes a separate rule because this is how it is done in iptables. If this policy was created in fwbuilder, rules #1 and 2 would be just one rule in the GUI. Double-clicking in the column &#8220;Options&#8221; in rule #1 opens dialog where you can inspect and edit its options. Tab &#8220;Limit&#8221; of this dialog controls parameters iptables &#8220;limit&#8221; module which was used in the original rule. Screenshot below demonstrates how policy importer recognized these parameters and reproduced them in the rule options:</p><p><img
class="alignnone size-full wp-image-1577" title="New Firewall LSI" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_17.png?9d7bd4" alt="New Firewall LSI" width="472" height="372" /></p><h3>Limitations</h3><p>iptables policy importer in fwbuilder has its limitations. Main limitation is that it can only parse certain set of iptables modules and targets. There are too many modules and associated targets out there and supporting all of them is next to impossible. However, it supports the core functionality and most popular modules. Even though importer tries to be as close to the original configuration as possible, you should always review rules and objects it creates and edit resultant rules. Most of the time rules can be simplified, such as with logging rules as was explained above. Often you can merge multiple rules by putting several objects in source or destination or service. Using object and service groups is another good way to simplify rules.</p><h2>Importing Cisco IOS access lists configuration</h2><p>Importing IOS access lists configuration is more straightforward because branching is not possible there. To import configuration, first you need to save it using &#8220;show run&#8221; command. IOS has literary hundreds of different commands and configuration clauses, but fwbuilder can only parse those related to the access lists configuration. Other commands will be ignored. There is no need to edit configuration prior to importing it into fwbuilder (except for the &#8220;banner&#8221; command, see below). Saved IOS configuration has information about router name and its interfaces, this information will be used to recreate objects in fwbuilder. Parser will not only create interface objects with proper names, it will also attach address objects to them to describe their ip addresses.</p><p><img
class="alignnone size-full wp-image-1578" title="Import from file" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_20.png?9d7bd4" alt="Import from file" width="472" height="212" /></p><p>Just like with iptables, we start with main menu &#8220;<strong>File/Import Policy</strong>&#8221; and enter file name in the dialog. The &#8220;<strong>Platform</strong>&#8221; drop-down list should be set to &#8220;<strong>Cisco IOS</strong>&#8220;. Click &#8220;Next&#8221; to start import process.</p><p><img
class="alignnone size-full wp-image-1579" title="Import configuration file" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_21.png?9d7bd4" alt="Import configuration file" width="472" height="580" /></p><p>The program recognized router name &#8220;c3620&#8243; and its interfaces, created interface objects with their ip addresses and then created some address and service objects. My test router config contains the following lines (this is just a fragment, there are more interfaces and more ACLs):</p><p><strong><span
style="color: #ff6600;">interface FastEthernet0/0<br
/> ip address 192.168.100.100 255.255.255.0 secondary<br
/> ip address 10.3.14.201 255.255.255.0<br
/> ip access-group fe0_0_acl_in in<br
/> ip access-group fe0_0_acl_out out<br
/> no ip mroute-cache<br
/> duplex auto<br
/> speed auto<br
/> !<br
/> interface Ethernet1/0<br
/> description Test [test] {test} (and one more test) /weird:characters#$%^&amp;*/<br
/> ip address 192.168.171.2 255.255.255.0<br
/> ip access-group e1_0_acl_in in<br
/> ip access-group e1_0_acl_out out<br
/> no ip mroute-cache<br
/> ip ospf cost 65000<br
/> half-duplex<br
/> crypto map real</span></strong></p><p><span
style="color: #ff6600;"><strong>!###################################################<br
/> ip access-list extended e1_0_acl_in<br
/> deny ip any any fragments<br
/> permit tcp host 10.3.14.40 host 192.168.171.2 eq 22 log<br
/> permit tcp host 10.3.14.40 host 10.3.14.201 eq 22 log<br
/> permit ip any 10.3.14.0 0.0.0.255 log<br
/> deny ip any any log<br
/> !###################################################<br
/> ip access-list extended e1_0_acl_out<br
/> permit ip 10.3.14.0 0.0.0.255 any log<br
/> deny ip any any log</strong></span></p><p>Parser recognizes comments and skips them, but text from interface descriptions goes into comments in the Interface objects.</p><p><img
class="alignnone size-full wp-image-1580" title="Interface objects" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_22.png?9d7bd4" alt="Interface objects" width="472" height="533" /></p><p>Firewall Builder recognizes both named and regular extended access lists. Each separate access list is recreated in fwbuilder in the same main Policy rule set. The program recognizes &#8220;ip access-group&#8221; commands and puts corresponding interface object in the &#8220;Interface&#8221; rule element of the rules it creates.</p><p><img
class="alignnone size-full wp-image-1581" title="Policy" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_30.png?9d7bd4" alt="Policy" width="472" height="282" /></p><p>The original configuration used the same access list &#8220;133&#8243; with two interfaces:</p><p><strong><span
style="color: #ff6600;">interface Ethernet1/1<br
/> ip address 10.10.10.10 255.255.255.0<br
/> no ip mroute-cache<br
/> !<br
/> ! Note &#8211; the same access list applied both in and out<br
/> ip access-group 133 in<br
/> ip access-group 133 out<br
/> no shutdown<br
/> half-duplex<br
/> !<br
/> interface Ethernet1/2<br
/> ip address 10.10.20.20 255.255.255.0<br
/> no ip mroute-cache<br
/> !<br
/> ! Note &#8211; the same access list applied both in and out<br
/> ! the same list is applied to eth 1/1 and eth 1/2<br
/> ip access-group 133 in<br
/> ip access-group 133 out<br
/> no shutdown<br
/> half-duplex<br
/> !</span></strong></p><p>The program recognizes this and creates object group &#8220;intf-acl_133&#8243; with these two interfaces as members:</p><p><img
class="alignnone size-full wp-image-1582" title="Creates group objects" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/06/importer_31.png?9d7bd4" alt="Creates group objects" width="472" height="173" /></p><p>It then uses this group in the &#8220;Interface&#8221; element of rules #0, 1 and 2 to reproduce rules from the access list &#8220;133&#8243;.</p><p>Interface configuration commands visible in the config snippets above, such as &#8220;half-duplex&#8221;, &#8220;duplex auto&#8221;, &#8220;speed auto&#8221;, various protocol configuration commands and other commands supported by IOS inside &#8220;interface&#8221; block are ignored.</p><h3>Limitations</h3><p>One IOS configuration construct that fwbuilder can not import is &#8220;banner&#8221; command. This command is special in that it allows the user to set arbitrary terminator character and then it allows any text up to this character. This creates a problem for fwbuilder parser because the terminator character can be arbitrary. You need to edit and remove banner from the saved configuration file before importing it.</p> ]]></content:encoded> <wfw:commentRss>http://ubuntulinuxhelp.com/using-built-in-policy-importer-in-firewall-builder/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Getting Started with Firewall Builder</title><link>http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/</link> <comments>http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/#comments</comments> <pubDate>Mon, 09 Mar 2009 16:36:20 +0000</pubDate> <dc:creator>Vadim Kurland</dc:creator> <category><![CDATA[Hands On]]></category> <category><![CDATA[How To]]></category> <category><![CDATA[configure]]></category> <category><![CDATA[filters]]></category> <category><![CDATA[firewall]]></category> <category><![CDATA[fwbuilder]]></category> <category><![CDATA[how to]]></category> <category><![CDATA[install]]></category> <category><![CDATA[iptables]]></category> <category><![CDATA[ipv4]]></category> <category><![CDATA[ipv6]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[network]]></category> <category><![CDATA[opensource]]></category> <category><![CDATA[rules]]></category> <category><![CDATA[security]]></category><guid
isPermaLink="false">http://ubuntulinuxhelp.com/?p=1331</guid> <description><![CDATA[This guide presents an introduction to Firewall Builder. Firewall Builder (also known as fwbuilder), is a GUI firewall configuration and management tool that supports iptables (netfilter), ipfilter, pf, ipfw, Cisco PIX (FWSM, ASA) and Cisco routers extended access lists. Both professional network administrators and hobbyists managing firewalls with policies more complex that is allowed by [...]]]></description> <content:encoded><![CDATA[<p>This guide presents an introduction to Firewall Builder. <strong>Firewall Builder</strong> (also known as <strong>fwbuilder</strong>), is a GUI firewall configuration and management tool that supports <strong>iptables (netfilter), ipfilter, pf, ipfw, Cisco PIX (FWSM, ASA) and Cisco routers extended access lists</strong>. Both professional network administrators and hobbyists managing firewalls with policies more complex that is allowed by simple web based UI can simplify management tasks with the application. The program runs on Linux, FreeBSD, OpenBSD, Windows and Mac OS X and can manage both local and remote firewalls.</p><p>Firewall Builder is packaged with most Linux distributions and is available under &#8220;<strong><em>System/Administration</em></strong>&#8221; menu.</p><div
id="attachment_1333" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1333" title="Access admin" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_011.png?9d7bd4" alt="Accessing Firewall Builder" width="465" height="124" /><p
class="wp-caption-text">Accessing Firewall Builder</p></div><p>If it is not there, then it probably needs to be installed on your system. You need to install the package that has supporting the API library libfwbuilder and the package for  fwbuilder that contains the Firewall Builder GUI and policy compilers. Use apt-get or aptitude to find and <span
id="more-1331"></span>install them:</p><p><span
style="color: #ff6600;"><code># aptitude install libfwbuilder fwbuilder</code></span></p><p>On FreeBSD and OpenBSD Firewall Builder is part of ports, you can find it in <strong>/usr/ports/security/fwbuilder</strong>.</p><p>Packages shipping with Ubuntu are always one or two minor revisions behind. If you want to try the latest version, you can use the pre-built binary .deb packages offered on the project&#8217;s web site or build from source using our online <a
href="http://www.fwbuilder.org/guides/firewall_builder_installation.html" title="Firewall Builder installation instructions"  target="_blank">installation instructions</a>. Pre-built binary packages and source code tar.gz archives can be <a
href="http://www.fwbuilder.org/docs/firewall_builder_packages.html" title="Download Firewall Builder"  target="_blank">downloaded from this page</a>.</p><p>If the system menu item is not there or you have built the program from source, you can always launch it from the command line by just typing &#8220;fwbuilder&#8221; on the shell prompt:</p><p><span
style="color: #ff6600;"><code>$ fwbuilder</code></span></p><p>The program starts and opens the main window and greeting dialog. The dialog provides links to the project web site where you can find more tutorials, FAQ, Firewall Builder CookBoook and other documentation, as well as a bug tracking system and links to user forums and the mailing list. Clicking on the link in the dialog opens corresponding web page in your web browser. This works the same on all supported OS: Linux, Windows and Mac OS X. You can always open this dialog later using an item in the main menu &#8220;Help&#8221;.</p><div
id="attachment_1334" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1334" title="Starting FWbuilder" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_010.png?9d7bd4" alt="Starting FWbuilder" width="465" height="407" /><p
class="wp-caption-text">Firewall Builder startup greeting</p></div><p>Lets create our first firewall object. To do this, we&#8217;ll use the object creation menu that appears when you click on the icon in the small toolbar right above the object tree. Choose menu item &#8220;New Firewall&#8221; from the menu that appears.</p><div
id="attachment_1336" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1336" title="New firewall" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_020.png?9d7bd4" alt="Setup new firewall" width="465" height="326" /><p
class="wp-caption-text">Setup new firewall</p></div><p>The program presents a wizard-like dialog that will guide you through the process for creation of the new firewall object. In the first page of the wizard you can enter the name for the new firewall object (here it is &#8220;guardian&#8221;), its platform (&#8220;iptables&#8221;) and host OS (&#8220;Linux&#8221;).</p><p>There are two ways a new firewall can be created: you can use one of the preconfigured template firewall objects or create it from scratch. This tutorial demonstrates the first method (using template object). To do this, check checkbox &#8220;Use preconfigured template firewall objects&#8221;. The template can be taken from the library of template objects that comes with the Firewall Builder package or from a file provided by the user. The latter is useful when the administrator wants to distribute a library of predefined templates to other users in the enterprise. We are using one of the standard templates in this guide and therefore leave the standard template library path and name in the &#8220;Template file:&#8221; input field. Click &#8220;Next&#8221; to move on to the next page of the wizard.</p><p>Note that the template firewall object comes completely configured, including addresses and netmasks of its interfaces and some basic policy and NAT rules. This configuration is intended as a starting point only. You should reconfigure the addresses of interfaces to match those used on your network; and most likely will have to adjust rules to match your security policy.</p><div
id="attachment_1338" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1338" title="Firewall template" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_030.png?9d7bd4" alt="Configure firewall template" width="465" height="284" /><p
class="wp-caption-text">Configure firewall template</p></div><p>This page of the wizard shows template objects and their configuration. Standard template objects represent firewalls with two or three interfaces, a host with one interface, web server or Cisco router. Choose firewall with three interfaces for this guide. Note that template comes with completely configured firewall objects, including a set of interfaces and their IP addresses &#8211; And some basic firewall policy. You will see how addresses can be changed later on in this guide. Click &#8220;Finish&#8221; to create a new firewall object using the chosen template.</p><div
id="attachment_1339" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1339" title="Firewall objects" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_040.png?9d7bd4" alt="Firewall objects" width="465" height="642" /><p
class="wp-caption-text">Firewall objects</p></div><p>Here is our new firewall object. Its name is <strong>guardian</strong>, it appears in the object tree in the left hand side of the main window in the folder <strong>Firewalls</strong>. When an object is selected in the tree, a brief summary of its properties appears in the panel under the tree. Double-clicking on the object in the tree opens it in the editor panel at the bottom of the right hand side panel of the main window. The editor for the firewall object allows the user to change its name, platform and host OS and also provides buttons that open dialogs for &#8220;advanced&#8221; settings for the firewall platform and host OS. We will inspect these a little later in this tutorial.</p><p>You can always resize the main window to make all columns of the policy view more visible.</p><div
id="attachment_1341" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1341" title="Guardian/Policy" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_050.png?9d7bd4" alt="Guardian/Policy view" width="465" height="394" /><p
class="wp-caption-text">Guardian/Policy view</p></div><p>Now would be a good time to save the data to a disk file. This is done in a usual way using main menu<strong> File/Save As</strong>.</p><p>Lets take a little tour of the network and service objects that come standard with the program. You can use these preconfigured objects to build policy and NAT rules for your firewall.</p><p>Objects in the tree are orginized in libraries, you can switch between libraries using the interfaces&#8217; drop-down menu above the tree. Firewall Builder comes with a collection of address, network, service and time interval objects in the library called &#8220;Standard&#8221;. Lets take a look at them. Notice that the background color of the panel that shows objects tree depends on the chosen object library. This makes it easier to keep track of the library currently opened in the program.</p><div
id="attachment_1342" class="wp-caption alignnone" style="width: 284px"><img
class="size-full wp-image-1342" title="Libraries" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_060.png?9d7bd4" alt="The libraries" width="274" height="203" /><p
class="wp-caption-text">The libraries</p></div><p>Folder <strong>Objects/Hosts</strong> contains few host objects used in standard firewall templates. Folder <strong>Objects/Network</strong> contains network objects that represent various standard address ranges and blocks, such as multicast, net 127/8, networks defined in RFC1918 and so on.</p><div
id="attachment_1344" class="wp-caption alignnone" style="width: 267px"><img
class="size-full wp-image-1344" title="Newtork objects" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_070.png?9d7bd4" alt="Newtork objects" width="257" height="348" /><p
class="wp-caption-text">Network objects</p></div><p>Firewall Builder also comes with extensive collection of TCP, UDP and ICMP service objects that describe commonly used protocols. This image shows some TCP objects (all of them do not fit in the screenshot).</p><div
id="attachment_1345" class="wp-caption alignnone" style="width: 270px"><img
class="size-full wp-image-1345" title="TCP objects" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_080.png?9d7bd4" alt="TCP (protocol) objects" width="260" height="347" /><p
class="wp-caption-text">TCP (protocol) objects</p></div><p>Here is an example of a simple TCP service. It defines source and     destination port ranges (in this case source port range is not     defined and there is only one destination port 80). TCP service     object can also define any combination of TCP flags the firewall     should inspect and also which ones of them should be set in order     for a packet to match this object. In the case of the service     &#8220;http&#8221; we do not need to define any flags.</p><div
id="attachment_1347" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1347" title="TCP service" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_090.png?9d7bd4" alt="TCP service" width="465" height="214" /><p
class="wp-caption-text">TCP service</p></div><p>Now lets take a look at the objects created as part of the new firewall object <strong>guardian</strong>. In order to do this, switch to the library <strong>User</strong> where this object was created. To open an object in the editor panel to inspect or change it, double click on it in the tree. Also, if you click on an object in the policy rule to select it, it will automatically open in the tree on the left.</p><div
id="attachment_1348" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1348" title="Object Guardian" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_100.png?9d7bd4" alt="Object Guardian in user library" width="465" height="393" /><p
class="wp-caption-text">Object Guardian in user library</p></div><p>First, the firewall object itself.</p><p>Every object in fwbuilder has basic attributes such as its name and comment. Other attributes depend on the object type.</p><p>Attributes of the firewall object include platform (can be iptables, pf, ipfilter, etc.), version (platform-depended) and host OS. Buttons <strong>Host OS Settings</strong> and <strong>Firewall Settings</strong> open dialogs with many additional attributes that depend on the firewall platform and host OS. More on these later.</p><div
id="attachment_1350" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1350" title="Object attributes" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_110.png?9d7bd4" alt="Object attributes" width="465" height="219" /><p
class="wp-caption-text">Object attributes</p></div><p>Here are the choices for the firewall platform, version (for iptables) and host OS.</p><div
id="attachment_1352" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1352" title="Firewall choices" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_103.png?9d7bd4" alt="Platform choices for the firewall" width="465" height="389" /><p
class="wp-caption-text">Platform choices for the firewall</p></div><p>Interfaces of the firewall are represented by objects located below the Firewall object in the tree. We refer to them as &#8220;children&#8221; of the firewall object. This image demonstrates properties of the interface eth0. To open it in the editor double click on it in the tree. If editor panel is already open and shows some object, it is sufficient to select new object in the tree to reveal it in the editor panel (no need to double click).</p><p>IP and MAC addresses of interfaces are represented by child objects in the tree located below corresponding interface.</p><div
id="attachment_1353" class="wp-caption alignnone" style="width: 271px"><img
class="size-full wp-image-1353" title="Firewall interfaces" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_120.png?9d7bd4" alt="Firewall interfaces" width="261" height="243" /><p
class="wp-caption-text">Firewall interfaces</p></div><p>Interface object has several attributes that define its function, such as &#8220;Management interface&#8221;, &#8220;external&#8221; etc.</p><ul><li>Name: the name of the interface object in Firewall Builder must match exactly the name of the interface of the firewall machine it represents. This will be something like &#8220;eth0&#8243;, &#8220;eth1&#8243;, &#8220;en0&#8243;, &#8220;br0&#8243; and so on.</li><li>Label: On most OS this ﬁeld is not used and serves the purpose of a descriptive label. Firewall Builder GUI uses a label, if it is not blank, to show interfaces in the tree. One of the suggested uses for this ﬁeld is to mark interfaces to reﬂect the network topology (’outside’, ’inside’) or the purpose (’web frontend’ or ’backup subnet’). The label is mandatory for Cisco PIX though, where it must reﬂect the network topology.</li><li>&#8220;Management interface&#8221;: Sometimes the host has several network interfaces in which case one of them can be marked as the ’manaagement interface’. The management interface is used for all communication between Firewall Builder and the host.</li><li>&#8220;External interface (insecure)&#8221;: marks an interface that connects to the Internet.</li><li>&#8220;Unprotected interface&#8221;: marks interface to which fwbuilder should not assign any access lists (used only with Cisco IOS platform)</li><li>&#8220;Regular Interface&#8221;: Use this option if the interface has an IP address assigned to it manually.</li><li>&#8220;Address is assigned dynamically&#8221;: Use this option if the interface has a dynamic address (obtained by means of DHCP or PPP or another protocol); in this case an address is unknown at the moment when Firewall Builder generates the ﬁrewall policy.</li><li>&#8220;Unnumbered interface&#8221;: Use this option if the interface can never have an IP address, such as the ethernet interface used to run PPPoE communication on some ADSL connections, tunnel endpoint interface, or an interface on a bridging ﬁrewall. See below Section 5.3.1 for more detailed discussion of these different types of interfaces.</li><li>&#8220;Bridge port&#8221;: this option is used for port of bridged firewall.</li><li>&#8220;Security level&#8221;: security level of this interface, used only with Cisco PIX (ASA)</li><li>&#8220;Network zone&#8221;: network zone of this interface, used only with Cisco PIX (ASA). Network zone drop-down list shows all network obejcts and groups of addresses and networks present in the tree. Choose one of them to tell the compiler which networks and blocks of addresses can be reached through this interface. Compiler uses this information to decide which interface each ACL rule should be associated with based on the addresses used in the destination of the rule.</li></ul><div
id="attachment_1354" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1354" title="View interface" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_130.png?9d7bd4" alt="View interface" width="465" height="219" /><p
class="wp-caption-text">View interface</p></div><p>Here is IP address of interface eth0, external interface of the firewall. The address and netmask are attributes of the child object of the type &#8220;IPv4 address&#8221;. Here the address is &#8220;192.0.2.1&#8243; and netmask &#8220;255.255.255.0&#8243;. Button &#8220;DNS Lookup&#8221; can be used to determine IP address using DNS. The program runs DNS query for the &#8220;A&#8221; record for the name of the parent firewall object.</p><div
id="attachment_1355" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1355" title="IP address eth0" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_140.png?9d7bd4" alt="IP address of interface eth0" width="465" height="220" /><p
class="wp-caption-text">IP address of interface eth0</p></div><p>Lets look at the IP address of the internal interface of the firewall. The address used in the template is &#8220;192.168.1.1&#8243; with netmask &#8220;255.255.255.0&#8243;. This is rather typical address used for small and home networks. Some commercial firewall appliances come preconfigured with this address.</p><div
id="attachment_1357" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1357" title="Internal interfaces" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_150.png?9d7bd4" alt="IP addresses of internal interfaces" width="465" height="583" /><p
class="wp-caption-text">IP addresses of internal interfaces</p></div><p>If address <strong>192.168.1.0/24</strong> matches address of your local network, you can skip this part of the guide and move to the page 4. Otherwise, you need to reconfigure the address of the internal interface of the firewall object that you just created in fwbuilder and also change address object used in the policy rules. Start with changing address attribute (and possibly netmask, if necessary) of the object <strong>guardian:eth1:ip</strong> as shown in the screenshot:</p><div
id="attachment_1359" class="wp-caption alignnone" style="width: 310px"><img
class="size-full wp-image-1359" title="Change IP address" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_160.png?9d7bd4" alt="Change IP address" width="300" height="267" /><p
class="wp-caption-text">Change IP address</p></div><p>Now we need to change IP address used in the rules. To do this, we create new Network object with correct address and replace object <strong>net-192.168.1.0</strong> in all rules with this new network object.</p><p>Use new object menu to create Network object.</p><div
id="attachment_1360" class="wp-caption alignnone" style="width: 278px"><img
class="size-full wp-image-1360" title="New network" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_170.png?9d7bd4" alt="Create new network object" width="268" height="212" /><p
class="wp-caption-text">Create new network object</p></div><p>New Network object is created with default name &#8216;New Network&#8217; and IP address 0.0.0.0.</p><div
id="attachment_1361" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1361" title="Default network" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_180.png?9d7bd4" alt="Default network created" width="465" height="243" /><p
class="wp-caption-text">Default network created</p></div><p>Edit object name and address, then hit &#8220;Apply&#8221;.</p><div
id="attachment_1362" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1362" title="Editing object" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_190.png?9d7bd4" alt="Editing network object" width="465" height="260" /><p
class="wp-caption-text">Editing network object</p></div><p>Use menu Object / Find to activate search and replace dialog. The     Find and Replace dialog opens at the bottom of the right hand side     panel in the main window, below the policy rules view.</p><div
id="attachment_1363" class="wp-caption alignnone" style="width: 337px"><img
class="size-full wp-image-1363" title="Object search" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_200.png?9d7bd4" alt="Searching for objects" width="327" height="176" /><p
class="wp-caption-text">Searching for objects</p></div><p>Locate object object <strong>net-192.168.1.0</strong> in any policy rule where it is used or in its location in the tree in library <strong>Standard</strong> and drag and drop it to the left object well in the search and replace dialog as shown on the screenshot:</p><div
id="attachment_1364" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1364" title="Drag and drop" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_210.png?9d7bd4" alt="Drag and drop object" width="465" height="151" /><p
class="wp-caption-text">Drag and drop object</p></div><p>Change the scope setting to &#8220;Policy of all firewalls&#8221;. If you have many firewalls in the tree, use scope &#8220;policy of the opened firewall&#8221; instead. Locate new Network object you just created in the tree and drag and drop it to the right object well in the search and replace dialog as shown on the screenshot:</p><div
id="attachment_1368" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1368" title="Change policy scope" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_220.png?9d7bd4" alt="Changing scope of all policies" width="465" height="89" /><p
class="wp-caption-text">Changing scope of all policies</p></div><p>Now hit &#8220;Replace all&#8221; button. Pop-up dialog should appear and report how many replacements the program had to make in all rules of the firewall. Note that the replacement is done not only in the policy rules, but in NAT rules as well.</p><div
id="attachment_1369" class="wp-caption alignnone" style="width: 264px"><img
class="size-full wp-image-1369" title="Replace all" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_230.png?9d7bd4" alt="Replace all button results" width="254" height="203" /><p
class="wp-caption-text">Replace all button results</p></div><p>Now that you have created a new object and replaced old network object with new one in all rules, do not forget to save data to a file using menu <strong>File/Save</strong></p><p>Lets inspect properties of the firewall object. Double click on the firewall &#8220;guardian&#8221; in the tree to open it in the editor panel, then click &#8220;Firewall Settings&#8221; button in the editor. This opens new dialog that looks like this. Notice button &#8220;Help&#8221; in this dialog, clicking this button opens help as shown on the image below.</p><div
id="attachment_1371" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1371" title="IP tables" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_240.png?9d7bd4" alt="IP tables advanced settings" width="465" height="513" /><p
class="wp-caption-text">IP tables advanced settings</p></div><p>Online help explains all attributes and paramaters located in each tab of the firewall settings dialog. I enourage you to explore it as many parameters are important and affect generated iptables script in different ways.</p><p>Next few screenshots show other tabs of the firewall settings dialog. You can find detailed explanations of all parameters in the online help.</p><div
id="attachment_1372" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1372" title="Explanations" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_250.png?9d7bd4" alt="Detailed explanation screen" width="465" height="420" /><p
class="wp-caption-text">Detailed explanation screen</p></div><p>This page defines various parameters for the built-in policy installer. Installer uses ssh client (pscp.exe and plink.exe on Windows) to transfer generated script to the firewall machine and activate it there.</p><div
id="attachment_1373" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1373" title="Policy installer" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_260.png?9d7bd4" alt="Policy installer, script generator" width="465" height="513" /><p
class="wp-caption-text">Policy installer, script generator</p></div><p>User can define shell commands that will be included in the generated script at the beginning and in the end of it. These commands can do anything you want, such as configure some subsystems, set up routing etc.</p><div
id="attachment_1374" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1374" title="Shell commands" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_270.png?9d7bd4" alt="Include shell command in script generator" width="465" height="514" /><p
class="wp-caption-text">Include shell command in script generator</p></div><p>Parameters for logging.</p><div
id="attachment_1375" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1375" title="Logging parameters" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_280.png?9d7bd4" alt="Logging parameter settings" width="465" height="240" /><p
class="wp-caption-text">Logging parameter settings</p></div><p>More options for the script generation. Notice that fwbuilder can produce iptables script in two formats: 1) as a shell script that calls iptables utility to add each rule one by one, or 2) it can use iptables-restore script to activate the whole policy at once. Other parameters are explained in the online help.</p><div
id="attachment_1376" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1376" title="Script options" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_290.png?9d7bd4" alt="Further script generation options" width="465" height="222" /><p
class="wp-caption-text">Further script generation options</p></div><p>Starting with v3.0 Firewall Builder can generate both IPv4 and IPv6 policy. This tab controls the order in which they are added to the script if user defined rules for both address families in the Policy objects of the firewall.</p><div
id="attachment_1377" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1377" title="IPv4-IPv6" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_300.png?9d7bd4" alt="IPv4 and IPv6 support" width="465" height="126" /><p
class="wp-caption-text">IPv4 and IPv6 support</p></div><p>Lets take a look at the policy of the template firewall. These rules are intended to be an example, a starting point to help you create your own policy quicker. Most likely you will want to modify them to suite your requirements. Explanation of the rules given here is rather brief because the goal of this guide was only to demonstrate how to use Firewall Builder.</p><ul><li>Rule 0: this is an anti-spoofing rule. It block incoming packets with source address that matches addresses of the firewall or internal or DMZ networks. The rule is associated with outside interface and has direction set to &#8220;Inbound&#8221;.</li><li>Rule 1: this rule permits any packets on loopback interface. This is necessary because many services on the firewall machine communicate back to the same machine via loopback.</li><li>Rule 2: permit ssh access from internal network to the firewall machine. Notice service object &#8220;ssh&#8221; in the column &#8220;Service&#8221;. This object can be found in the Standard objects library, folder Services/TCP.</li></ul><div
id="attachment_1379" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1379" title="Policy rules" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_310.png?9d7bd4" alt="Policy rules template" width="465" height="243" /><p
class="wp-caption-text">Policy rules template</p></div><p>Policy rules belong to the object &#8220;Policy&#8221;, which is a child object of the firewall and can be found in the tree right below it. As any other object in Firewall Builder, Policy object has some attributes that you can edit if you double click on it in the tree.</p><ul><li>Policy can be either IPv4, or IPv4 or combined IPv4 and IPv6. In the latter case you can use a mix of IPv4 and IPv6 addess objects in the same policy (in different rules) and Firewall Builder will automatically figure out which one is which and will sort them out.</li><li>Policy can translate to only mangle table, or a combination of filter and mangle tables. Again, in the latter case policy compiler decides which table to use based on the rule action and service object. Some actions, such as &#8220;Tag&#8221; (translates into iptables target MARK) go into mangle table.</li><li>&#8220;Top ruleset&#8221; means that compiler will place generated iptables rules into built-in chains INPUT/OUTPUT/FORWARD. If policy is not marked as &#8220;top ruleset&#8221;, generated rules will go into user-defined chain with the name the same as the name of the policy object.</li></ul><div
id="attachment_1380" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1380" title="Policy rules" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_320.png?9d7bd4" alt="Policy rules set" width="465" height="236" /><p
class="wp-caption-text">Policy rules set</p></div><p>Here are preconfigured NAT rules.</p><ul><li>Rule 0: tells the firewall that no address translation should be done for packets coming from network 192.168.2.0 going to 192.168.1.0 (because Translated Source, Translated Destination and Translated Service are left empty)</li><li>Rule 1: packets coming to the firewall from internal and DMZ networks should be translated so that source address will change and become that of the outside interface of the firewall.</li><li>Rule 2: packets coming from the Internet to the interface &#8220;outside&#8221; will be translated and forwarded to the internal server on DMZ represented by the host object &#8220;server on dmz&#8221;.</li></ul><div
id="attachment_1381" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1381" title="NAT rules" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_330.png?9d7bd4" alt="Preconfigured NAT rules" width="465" height="93" /><p
class="wp-caption-text">Preconfigured NAT rules</p></div><p>Now we should be ready to compile policy of the firewall guardian and generate iptables script. To do this, select firewall in the tree and click right mouse button. Choose item &#8220;Compile&#8221; in the pop-up menu. The dialog that appears lists all firewall objects defined in the objects tree and lets you select which ones should be compiled. The firewall guardian has just been created and has never been compiled and dialog shows that. Make sure checkbox next to the firewall object guardian is checked and click button &#8220;Next&#8221;.</p><div
id="attachment_1382" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1382" title="Firewall compilation" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_340.png?9d7bd4" alt="Select firewalls for compilation" width="465" height="462" /><p
class="wp-caption-text">Select firewalls for compilation</p></div><p>Firewall Builder calls policy compiler (which is by the way an external program which can be used on the command line). The next page of the dialog shows compiler progress and result.</p><div
id="attachment_1383" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1383" title="Compiler progress" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_350.png?9d7bd4" alt="Compiler progress" width="465" height="350" /><p
class="wp-caption-text">Compiler progress</p></div><p>Compiler generates iptables script in the file with the name the same as the name of the firewall object, with extension &#8220;.fw&#8221;. The file is placed in the same directory where the data file .fwb is located.</p><p><span
style="color: #ff6600;"><code>$ ls -la test2.fwb guardian.fw<br
/> -rwxr-xr-x 1 vadim vadim 11253 2009-02-16 16:41 guardian.fw<br
/> -rw-r--r-- 1 vadim vadim 24696 2009-02-16 16:41 test2.fwb</code></span></p><p>Here is how generated script looks like. This is just a fragment from the middle to show some generated iptables commands.</p><p><span
style="color: #ff6600;"><code># ================ IPv4</code></span></p><p><span
style="color: #ff6600;"># ================ Table &#8216;filter&#8217;, automatic rules<br
/> $IPTABLES -P OUTPUT  DROP<br
/> $IPTABLES -P INPUT   DROP<br
/> $IPTABLES -P FORWARD DROP</span></p><p><span
style="color: #ff6600;">cat /proc/net/ip_tables_names | while read table; do<br
/> $IPTABLES -t $table -L -n | while read c chain rest; do<br
/> if test &#8220;X$c&#8221; = &#8220;XChain&#8221; ; then<br
/> $IPTABLES -t $table -F $chain<br
/> fi<br
/> done<br
/> $IPTABLES -t $table -X<br
/> done</span></p><p><span
style="color: #ff6600;">$IPTABLES -A INPUT   -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT<br
/> $IPTABLES -A OUTPUT  -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT<br
/> $IPTABLES -A FORWARD -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT</span></p><p><span
style="color: #ff6600;"># ================ Table &#8216;nat&#8217;,  rule set NAT<br
/> # NAT compiler errors and warnings:<br
/> #<br
/> #<br
/> # Rule 0 (NAT)<br
/> #<br
/> echo &#8220;Rule 0 (NAT)&#8221;<br
/> #<br
/> # no need to translate<br
/> # between DMZ and<br
/> # internal net<br
/> $IPTABLES -t nat -A POSTROUTING   -s 192.168.2.0/24 -d 172.16.22.0/24 -j ACCEPT<br
/> $IPTABLES -t nat -A PREROUTING   -s 192.168.2.0/24 -d 172.16.22.0/24 -j ACCEPT<br
/> #</span></p><p>Now you can transfer it to the firewall and execute it there to install iptables rules. However it is much more convenient to use built-in policy installer to do this. To use installer, click right mouse button on the firewall object in the tree and use menu item Install. Firewall Builder will compile the policy if necessary and then open dialog where you can configure parameters of the installer. Here you need to enter password to authenticate to the firewall. Once you click OK, installer will connect to the firewall using ssh client. First, it will copy generated script to the directory /etc on the firewall (or different one, if configured in the Installer tab of firewall settings dialog), then it will run this script and check for errors. Its progress will be visible in the panel of the installer wizard, just like the progress of policy compiler.</p><div
id="attachment_1385" class="wp-caption alignnone" style="width: 475px"><img
class="size-full wp-image-1385" title="Install options" src="http://ubuntulinuxhelp.com/wp-content/uploads/2009/03/pict_370.png?9d7bd4" alt="Install options for firewall guardian" width="465" height="491" /><p
class="wp-caption-text">Install options for firewall &#39;guardian&#39;</p></div><p>This guide walked you step by step through the process of creating of a firewall object, making some minor changes in its parameters and policy rules, compiling the policy and activating it on the firewall machine. This guide did not touch advanced topics such as built-in revision control system, working with multiple data files, working with multiple firewall objects, IPv6. You can find documentation and guides on these topics and more on our project web site at <a
href="http://www.fwbuilder.org" title="Firewall Builder"  target="_blank">http://www.fwbuilder.org</a>.</p> ]]></content:encoded> <wfw:commentRss>http://ubuntulinuxhelp.com/getting-started-with-firewall-builder/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: ubuntulinuxhelp.com @ 2012-02-10 17:03:17 by W3 Total Cache -->
