<?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>exp-Networks</title>
	<atom:link href="http://www.exp-networks.be/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.exp-networks.be</link>
	<description>Networks and security consulting</description>
	<lastBuildDate>Sat, 19 Jun 2010 06:54:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>6in4 Tunnel</title>
		<link>http://www.exp-networks.be/blog/6in4-tunnel/</link>
		<comments>http://www.exp-networks.be/blog/6in4-tunnel/#comments</comments>
		<pubDate>Sun, 16 May 2010 08:17:00 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=466</guid>
		<description><![CDATA[Thanks to company like Hurricane Electric or SixXS it is very easy to connect to IPv6 Internet backbone even if your ISP does not provide native access to IPv6. Those companies provide free access to their tunnel brokers. A tunnel broker is a dual homed router connected to IPv4 Internet backbone on one side and [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to company like <a href="http://www.he.net/">Hurricane Electric</a> or <a href="http://www.sixxs.net/">SixXS</a> it is very easy to connect to IPv6 Internet backbone even if your ISP does not provide native access to IPv6. Those companies provide free access to their tunnel brokers. A tunnel broker is a dual homed router connected to IPv4 Internet backbone on one side and to IPv6 backbone on the other side. The concept is quite simple, you have access to the IPv4 world and you want to access the IPv6 world. You just need to build a <a href="http://en.wikipedia.org/wiki/6in4">6in4 tunnel</a> from your DSL router or from your PC or actually from whatever IPv4/IPv6 capable you want to the tunnel broker on the IPv4 side and you&#8217;ll encapsulate your IPv6 traffic into that tunnel. The broker will decapsulate your IPv6 packets and send them to the IPv6 Internet backbone. The tunnel broker will also advertise your IPv6 range to the backbone in order to allow the traffic to flow back to your 6in4 tunnel.</p>
<p>6in4 is a tunneling protocol acting in the same way as GRE but it is only used to transport IPv6 packets over IPv4 network. 6in4 is the IPv4 protocol 41. 6in4 tunneling is also referred to as proto-41 static because it requires static configuration&#8230; But as we will see, with good API, it does not necessarily need manual reconfiguration even with dynamic IP on a DSL line.</p>
<p>First you need to register to one tunnel broker provider. For the exemple I&#8217;ve chosen <a href="http://tunnelbroker.net/">Hurricane Electric&#8217;s tunnel broker</a> but other providers work similarly.</p>
<p>The you have to configure your 6in4 tunnel. On BSD system (here Mac OS X) you can use the following script :</p>
<pre>#!/bin/bash
LOCAL_IF=en1
LOCAL_IP=`ifconfig $LOCAL_IF | grep "inet " | awk -F" " '{ print $2 }'`
LOCAL_IPV6=2001:db8::2
REMOTE_IP=216.66.80.26
REMOTE_IPV6=2001:db8::1
TUNNEL_IF=gif0

ifconfig $TUNNEL_IF tunnel $LOCAL_IP $REMOTE_IP
ifconfig $TUNNEL_IF inet6 $LOCAL_IPV6 $REMOTE_IPV6 prefixlen 128
route -n add -inet6 default $REMOTE_IPV6</pre>
<p>Then if you have a dynamic public IP you may want to use the following script as a cron job to check whether your IP has changed and eventually update the tunnel broker.</p>
<pre>#!/bin/bash
OLD_IPv4=/tmp/ipv4
CURRENT_IPv4=`curl -s http://demo.exp-networks.be/tools/ip.php`
UPDATE="TRUE"
USERID="xxx"
PASSWORD="xxx"
TUN="123"

if [ -f $OLD_IPv4 ];
then
  if [ "$CURRENT_IPv4" = "`cat $OLD_IPv4`" ];
  then
    UPDATE="FALSE"
  fi
fi

if [ "$UPDATE" = "TRUE" ];
then
  echo $CURRENT_IPv4 > $OLD_IPv4
  curl --insecure -s \
  "https://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO&#038;pass=$PASSWORD&#038;user_id=$USER&#038;tunnel_id=$TUN"
fi</pre>
<p>Where USERID has to be replaced by the user id found on the main page of HE&#8217;s tunnel broker; PASSWORD is an md5 hash of your password; and TUN is the global tunnel id found on your tunnel details&#8217; page.</p>
<p>When done, you are ready to enter in the IPv6 world. And maybe starts the <a href="http://ipv6.he.net/certification/index.php">HE IPv6 certification</a> and get your badge&#8230;<br />
<a href="http://ipv6.he.net/certification/scoresheet.php?pass_name=krik" target="_blank"><img src="http://ipv6.he.net/certification/create_badge.php?pass_name=krik&#038;badge=3" width=229 height=137 border=0 alt="IPv6 Certification Badge for krik"></img></a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/6in4-tunnel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SNMP on Debian</title>
		<link>http://www.exp-networks.be/blog/snmp-on-debian/</link>
		<comments>http://www.exp-networks.be/blog/snmp-on-debian/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 16:02:52 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=476</guid>
		<description><![CDATA[If you want to monitor your servers from a central management station, you&#8217;ll probably need to configure an SNMP daemon on your servers. Here is a quick note to show you how easy it is to get started with SNMP on Linux machine (examples are for Debian but should be easy to adapt for other [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to monitor your servers from a central management station, you&#8217;ll probably need to configure an SNMP daemon on your servers. Here is a quick note to show you how easy it is to get started with SNMP on Linux machine (examples are for Debian but should be easy to adapt for other distribution).</p>
<p>1) install snmpd package</p>
<pre># aptitude install snmpd</pre>
<p>2) edit /etc/default/snmpd to remove restriction or replace the default listening address (127.0.0.1 by default). the line to modify is</p>
<pre>SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'</pre>
<p>or you can simply remove it with sed</p>
<pre># sed -i "s/.pid 127.0.0.1'/.pid'/" /etc/default/snmpd</pre>
<p>3) add snmpd: 192.168.1.1 in /etc/hosts.allow to allow 192.168.1.1 to poll the server</p>
<pre># echo snmpd: 192.168.1.1 &gt;&gt; /etc/hosts.allow</pre>
<p>4) edit /etc/snmp/snmpd.conf to define your community string(s), view(s) and allowed hosts (yes, again)</p>
<pre>####
# First, map the community name (COMMUNITY) into a security name:
#        sec.name   source          community
com2sec  readonly   192.168.1.1/32  somecommunity

####
# Second, map the security names into group names:
#               sec.model  sec.name
group MyROGroup v2c        readonly

####
# Third, create a view for us to let the groups have rights to:
#          incl/excl   subtree   mask
view all   included    .1        80

####
# Finally, grant the groups access to the view with different
# read/write permissions:
#                context sec.model sec.level match  read   write  notif
access MyROGroup ""      any       noauth    exact  all    none   none</pre>
<p>Once configured, start (or restart) the snmpd daemon.</p>
<pre># /etc/init.d/snmpd restart</pre>
<p>And then test from the management station (here 192.168.1.1). We will try to get the hostname of the monitored device :</p>
<pre># snmpget -v 2c -c somecommunity 192.168.1.254 SNMPv2-MIB::sysName.0
SNMPv2-MIB::sysName.0 = STRING: gandalf</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/snmp-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dual stack IPv4/IPv6 on FreeBSD</title>
		<link>http://www.exp-networks.be/blog/dual-stack-freebsd/</link>
		<comments>http://www.exp-networks.be/blog/dual-stack-freebsd/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 08:37:30 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Systems]]></category>
		<category><![CDATA[IPv6]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=450</guid>
		<description><![CDATA[Here is a quick note to show how easy it is to enable a dual IP stack on FreeBSD (and actually on most modern system)&#8230; Here is what you need : 1. Native connectivity to IPv4 &#038; IPv6 backbones Connectivity to IPv4 should be OK. If you don&#8217;t have connectivity to IPv6 you may want [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick note to show how easy it is to enable a dual IP stack on FreeBSD (and actually on most modern system)&#8230;</p>
<p>Here is what you need :</p>
<p>1. Native connectivity to IPv4 &#038; IPv6 backbones</p>
<blockquote><p>Connectivity to IPv4 should be OK. If you don&#8217;t have connectivity to IPv6 you may want to use 6in4 tunnel to connect to IPv6 backbone through a tunnel over IPv4 backbone. Several tunnel brokers are available for free, I personally know <a href="http://tunnelbroker.net/">Hurricane Electric</a> and <a href="http://www.sixxs.net/">SixXS</a>. </p></blockquote>
<p>2. An IPv4 gateway such as 192.168.1.1<br />
3. An IPv4 address in that range such as 192.168.1.10<br />
4. An IPv6 gateway such as 2001:db8:abcd::1<br />
5. An IPv6 address in that range such as 2001:db8:abcd::e<br />
6. Put all together in /etc/rc.conf</p>
<p>Extract from /etc/rc.conf</p>
<pre>#IPv4 config
ifconfig_re0="inet 192.168.1.10 netmask 255.255.255.0"
static_routes="default"
route_default="default 192.168.1.1"

#IPv6 config
ipv6_enable="YES"
ipv6_ifconfig_re0="2001:db8:abcd::e/56"
ipv6_static_routes="default"
ipv6_route_default="default 2001:db8:abcd::1"
</pre>
<p>Then restart the server or the network related script from /etc/rc.d</p>
<pre>ipv6#/etc/rc.d/netif start
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
	ether 9e:65:96:1e:ca:5e
	inet 192.168.1.10 netmask 0xffffff00 broadcast 192.168.1.255
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active

ipv6#/etc/rc.d/routing start
add net default: gateway 192.168.1.1
Additional routing options:.

ipv6# /etc/rc.d/network_ipv6 start
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
net.inet6.ip6.forwarding: 0 -> 0
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
	inet6 2001:db8:abcd::e prefixlen 56 <strong>tentative</strong>
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net default: gateway 2001:db8:abcd::1
IPv4 mapped IPv6 address support=NO</pre>
<p>You may notice the IPv6 address is marked as tentative, that&#8217;s because DAD (Duplicate Address Detection) is still validating the IPv6 address. If you run <code>ifconfig</code> a bit later and if you IPv6 is not a duplicate address, the tentative flag should disappear.</p>
<p>Test connectivity with some awesome tools&#8230; </p>
<pre>ipv6# ping -c3 www.google.com
PING www.l.google.com (209.85.229.147): 56 data bytes
64 bytes from 209.85.229.147: icmp_seq=0 ttl=55 time=10.624 ms
64 bytes from 209.85.229.147: icmp_seq=1 ttl=55 time=10.675 ms
64 bytes from 209.85.229.147: icmp_seq=2 ttl=55 time=10.815 ms

--- www.l.google.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 10.624/10.705/10.815/0.081 ms

ipv6# ping6 -c3 ipv6.google.com
PING6(56=40+8+8 bytes) 2001:db8:abcd::e --> 2a00:1450:8006::93
16 bytes from 2a00:1450:8006::93, icmp_seq=0 hlim=56 time=15.562 ms
16 bytes from 2a00:1450:8006::93, icmp_seq=1 hlim=56 time=15.529 ms
16 bytes from 2a00:1450:8006::93, icmp_seq=2 hlim=56 time=15.541 ms

--- ipv6.l.google.com ping6 statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 15.529/15.544/15.562/0.014 ms</pre>
<p>Congratulations, you now have IPv4 and IPv6 connectivity from your FreeBSD box!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/dual-stack-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Multipoint VPN &#8211; Dual hub</title>
		<link>http://www.exp-networks.be/blog/dynamic-multipoint-vpn-dual-hub/</link>
		<comments>http://www.exp-networks.be/blog/dynamic-multipoint-vpn-dual-hub/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 12:59:24 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=427</guid>
		<description><![CDATA[In a previous article, I exposed how to setup a basic DMVPN network with one hub router in a central location and several spoke routers negotiating a dynamically built IPSec protected GRE tunnel. I also explained the central site should be secured by deploying two hub routers&#8230; Here is one solution among others using DMVPN [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous article, I exposed <a href="http://www.exp-networks.be/blog/dmvpn/">how to setup a basic DMVPN network with one hub router</a> in a central location and several spoke routers negotiating a dynamically built IPSec protected GRE tunnel. I also explained the central site should be secured by deploying two hub routers&#8230; Here is one solution among others using DMVPN and OSPF. (Should you need another solution you can always <a href="http://www.exp-networks.be/services/consulting/">contact our professional services</a>)<br />
<a href="http://www.exp-networks.be/wp-content/uploads/2010/03/DMVPN-dual1.png"><img class="alignnone size-full wp-image-429" title="DMVPN-dual" src="http://www.exp-networks.be/wp-content/uploads/2010/03/DMVPN-dual1.png" alt="" width="509" height="336" /></a></p>
<p>In this scenario, the spoke routers will have two GRE tunnels, one ending on each hub routers.</p>
<p>First we configure the hub routers with mGRE interfaces and OSPF. </p>
<p>The tunnel interfaces use point-to-point OSPF network type by default, we will need to reconfigure them with  NBMA OSPF network type as we will have several spoke routers ending their tunnel on them. We will also set the OSPF costs in order to have R0 acting as the preferred hub router and R1 as the backup hub router. </p>
<p>Hub router R0&#8242;s config</p>
<blockquote><pre>interface Tunnel0
 ip address 10.0.0.1 255.255.255.0
 no ip redirects
 ip nhrp network-id 1
 ip ospf network non-broadcast
 ip ospf cost 10
 tunnel source FastEthernet2/1
 tunnel mode gre multipoint
 tunnel key 1
!
interface FastEthernet2/0
 ip address 10.10.10.1 255.255.255.0
!
interface FastEthernet2/1
 ip address 10.4.0.1 255.255.255.0
!
router ospf 1
 log-adjacency-changes
 network 10.0.0.0 0.0.0.255 area 10
 network 10.10.10.0 0.0.0.255 area 10
!
ip route 0.0.0.0 0.0.0.0 10.4.0.2
</pre>
</blockquote>
<p>Hub router R0&#8242;s config</p>
<blockquote><pre>interface Tunnel1
 ip address 10.1.1.1 255.255.255.0
 no ip redirects
 ip nhrp network-id 1
 ip ospf network non-broadcast
 ip ospf cost 100
 tunnel source FastEthernet2/1
 tunnel mode gre multipoint
 tunnel key 1
!
interface FastEthernet2/0
 ip address 10.10.10.2 255.255.255.0
!
interface FastEthernet2/1
 ip address 10.4.1.1 255.255.255.0
!
router ospf 1
 log-adjacency-changes
 network 10.0.0.0 0.0.0.255 area 10
 network 10.10.10.0 0.0.0.255 area 10
!
ip route 0.0.0.0 0.0.0.0 10.4.1.2
</pre>
</blockquote>
<p>Then we can start to add spoke routers. The spoke routers will use point-to-point GRE (as we don&#8217;t want spoke-to-spoke direct communication) with  NBMA OSPF network type in order to be compatible with the hub routers&#8217; settings. We also need to define the neighbors as we&#8217;re on an NBMA network. I&#8217;ve chosen to do that on the spoke routers as ì don&#8217;t want to have to touch the hub routers config when new spoke routers are added.</p>
<p>Spoke router R2&#8242;s config</p>
<blockquote><pre>interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Tunnel0
 ip address 10.0.0.2 255.255.255.0
 ip nhrp map 10.0.0.1 10.4.0.1
 ip nhrp network-id 1
 ip nhrp nhs 10.0.0.1
 ip ospf network non-broadcast
 ip ospf cost 10
 ip ospf priority 0
 tunnel source FastEthernet1/0
 tunnel destination 10.4.0.1
 tunnel key 1
!
interface Tunnel1
 ip address 10.1.1.2 255.255.255.0
 ip nhrp map 10.1.1.1 10.4.1.1
 ip nhrp network-id 1
 ip nhrp nhs 10.1.1.1
 ip ospf network non-broadcast
 ip ospf cost 100
 ip ospf priority 0
 tunnel source FastEthernet1/0
 tunnel destination 10.4.1.1
 tunnel key 1
!
interface FastEthernet1/0
 ip address 10.4.2.1 255.255.255.0
!
router ospf 1
 log-adjacency-changes
 network 2.2.2.2 0.0.0.0 area 10
 network 10.0.0.0 0.0.0.255 area 10
 network 10.1.1.0 0.0.0.255 area 10
 neighbor 10.0.0.1
 neighbor 10.1.1.1
!
ip route 0.0.0.0 0.0.0.0 10.4.2.2</pre>
</blockquote>
<p>Same config is applied on spoke router R3, only the IP change.</p>
<p>To check the GRE tunnels are operational, we only have to ping the tunnels’ internal IP from one router to the others three.</p>
<p>From spoke router R2 :</p>
<blockquote><pre>R2#ping 10.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/8/8 ms
R2#ping 10.1.1.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/17/24 ms
R2#ping 10.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/11/24 ms
R2#ping 10.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/32 ms</pre>
</blockquote>
<p>If we check the NHRP entries on the hubs R0 or R1, we can see the two entries have been learned dynamically and the public IP used by the remote routers.</p>
<blockquote><pre>R1#sh ip nhrp
10.1.1.2/32 via 10.1.1.2, Tunnel1 created 02:08:37, expire 01:38:57
  Type: <strong>dynamic</strong>, Flags: authoritative unique registered used
  NBMA address: <strong>10.4.2.1 </strong>
10.1.1.3/32 via 10.1.1.3, Tunnel1 created 02:08:36, expire 01:38:57
  Type: <strong>dynamic</strong>, Flags: authoritative unique registered used
  NBMA address: <strong>10.4.3.1</strong> </pre>
</blockquote>
<blockquote><pre>R0#sh ip nhrp
10.0.0.2/32 via 10.0.0.2, Tunnel0 created 02:15:15, expire 01:53:44
  Type: <strong>dynamic</strong>, Flags: authoritative unique registered
  NBMA address: <strong>10.4.2.1</strong>
10.0.0.3/32 via 10.0.0.3, Tunnel0 created 02:11:04, expire 01:53:44
  Type: <strong>dynamic</strong>, Flags: authoritative unique registered
  NBMA address: <strong>10.4.3.1</strong> </pre>
</blockquote>
<p>Now, check OSPF is doing what we want. First we check the ospf neighbors on spoke router R2</p>
<blockquote><pre>R2#sh ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.10.10.2        1   FULL/DR         00:01:54    10.1.1.1        Tunnel1
10.10.10.1        1   FULL/DR         00:01:55    10.0.0.1        Tunnel0</pre>
</blockquote>
<p>Then we can check corporate subnet 10.10.10.0/24 and other spokes (here R3&#8242;s Loopback 3.3.3.3) are reachable via the primary hub router R0.</p>
<blockquote><pre>R2#sh ip route ospf
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 10.0.0.3, 00:42:46, <strong>Tunnel0</strong>
     10.0.0.0/24 is subnetted, 4 subnets
O       10.10.10.0 [110/11] via 10.0.0.1, 00:42:46, <strong>Tunnel0</strong></pre>
</blockquote>
<p>On the hub routers we can check the spoke routers are always reached via R0.</p>
<blockquote><pre>R0#sh ip route ospf
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/11] via 10.0.0.2, 00:49:41, <strong>Tunnel0</strong>
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 10.0.0.3, 00:49:41, <strong>Tunnel0</strong>
     10.0.0.0/24 is subnetted, 4 subnets
O       10.1.1.0 [110/101] via 10.10.10.2, 00:49:41, FastEthernet2/0</pre>
</blockquote>
<blockquote><pre>R1#sh ip route ospf
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/12] via 10.10.10.1, 00:50:52, <strong>FastEthernet2/0</strong>
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/12] via 10.10.10.1, 00:50:52, <strong>FastEthernet2/0</strong>
     10.0.0.0/24 is subnetted, 4 subnets
O       10.0.0.0 [110/11] via 10.10.10.1, 00:50:52, FastEthernet2/0</pre>
</blockquote>
<p>Now that we have IP connectivity, we can <a href="http://www.exp-networks.be/blog/dmvpn/">enable IPSec</a> exactly as we did last time.</p>
<blockquote><pre>crypto isakmp policy 10
authentication pre-share
crypto isakmp key cisco123 address 0.0.0.0 0.0.0.0
!
crypto ipsec transform-set mySet esp-aes esp-sha-hmac
!
crypto ipsec profile myDMVPN
set security-association lifetime seconds 120
set transform-set mySet
set pfs group2

interface Tunnel0
tunnel protection ipsec profile myDMVPN

interface Tunnel1
tunnel protection ipsec profile myDMVPN
</pre>
</blockquote>
<p>That&#8217;s all folks! Now we have a DMVPN setup with redundant hub routers&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/dynamic-multipoint-vpn-dual-hub/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ACE software upgrade</title>
		<link>http://www.exp-networks.be/blog/ace-software-upgrade/</link>
		<comments>http://www.exp-networks.be/blog/ace-software-upgrade/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 06:53:31 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=393</guid>
		<description><![CDATA[Cisco Application Control Engine Module (ACE) loadbalancers are designed to work in standalone mode or in cluster mode. When running in standalone mode, software upgrade has obviously a great impact on the traffic going through the loadbalancer. All the sessions will be dropped and no new session will be accepted until the ACE restarts with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.exp-networks.be/wp-content/uploads/2010/02/ace_module.jpg"><img class="size-medium wp-image-411 alignleft" style="margin-left: 10px; margin-right: 10px;" title="ACE module" src="http://www.exp-networks.be/wp-content/uploads/2010/02/ace_module-e1266828158495-300x98.jpg" alt="Cisco Application Control Engine Module" width="210" height="69" /></a>Cisco Application Control Engine Module (ACE) loadbalancers are designed to work in standalone mode or in cluster mode. When running in standalone mode, software upgrade has obviously a great impact on the traffic going through the loadbalancer. All the sessions will be dropped and no new session will be accepted until the ACE restarts with the new image (up to 8 minutes).</p>
<p>Now, in cluster mode, you can do the software upgrade with no or very limited impact if you follow the correct sequence of operations. Here are the steps I used last time and it went perfectly and transparent for the users.</p>
<blockquote><p>Note this procedure has been tested on ACE modules for Catalyst 6500 only but it should remain valid for the ACE 4710 appliances.</p></blockquote>
<h2>Step 1</h2>
<p>First you need to ensure all the contexts are properly synchronized and the standby contexts are in STANDBY_HOT state.</p>
<blockquote>
<pre>ACE_1/Admin# sh ft group brief
FT Group ID: 1  My State:FSM_FT_STATE_ACTIVE    Peer State:FSM_FT_STATE_STANDBY_HOT
                Context Name: Admin     Context Id: 0
FT Group ID: 2  My State:FSM_FT_STATE_ACTIVE    Peer State:FSM_FT_STATE_<strong>STANDBY_COLD</strong>
                Context Name: C1        Context Id: 4
FT Group ID: 3  My State:FSM_FT_STATE_ACTIVE    Peer State:FSM_FT_STATE_STANDBY_HOT
                Context Name: C2        Context Id: 3</pre>
</blockquote>
<p>Here as you can see context C1 is stuck in STANDBY_COLD state. Usually put that context out of service on the <strong>standby ACE </strong>and then put it back in service solve the issue. If it is not the case you won&#8217;t have a fully transparent software upgrade for that context; current session will be dropped but new session will be accepted after the failover. If it is acceptable for you, go on with the upgrade otherwise try to find out why it is not in STANDBY_HOT state.</p>
<p>Note it might take several minutes to leave the STANDBY_BULK state (it took 2 minutes during my tests).</p>
<blockquote>
<pre>ACE_2/Admin(config)# ft group 2
ACE_2/Admin(config-ft-group)# no inservice
ACE_2/Admin(config-ft-group)# do sh ft group 2 detail

FT Group                     : 2
No. of Contexts              : 1
Context Name                 : C1
Context Id                   : 4
Configured Status            : out-of-service
Maintenance mode             : MAINT_MODE_OFF
My State                     : FSM_FT_STATE_INIT
My Config Priority           : 90
My Net Priority              : 90
My Preempt                   : Enabled
Peer State                   : FSM_FT_STATE_UNKNOWN
Peer Config Priority         : Unknown
Peer Net Priority            : Unknown
Peer Preempt                 : Unknown
Peer Id                      : 1
Last State Change time       : Wed Feb  3 14:35:36 2010
Running cfg sync enabled     : Enabled
Running cfg sync status      :
Startup cfg sync enabled     : Enabled
Startup cfg sync status      :
Bulk sync done for ARP: 0
Bulk sync done for LB: 0
Bulk sync done for ICM: 0
ACE_2/Admin(config-ft-group)# inservice

NOTE: Configuration mode has been disabled on all sessions

ACE_2/Admin(config-ft-group)# do sh ft group 2 detail

FT Group                     : 2
No. of Contexts              : 1
Context Name                 : C1
Context Id                   : 4
Configured Status            : in-service
Maintenance mode             : MAINT_MODE_OFF
My State                     : FSM_FT_STATE_STANDBY_BULK
My Config Priority           : 90
My Net Priority              : 90
My Preempt                   : Enabled
Peer State                   : FSM_FT_STATE_ACTIVE
Peer Config Priority         : 120
Peer Net Priority            : 120
Peer Preempt                 : Enabled
Peer Id                      : 1
Last State Change time       : Wed Feb  3 <strong>14:36:02</strong> 2010
Running cfg sync enabled     : Enabled
Running cfg sync status      : Running configuration sync has completed
Startup cfg sync enabled     : Enabled
Startup cfg sync status      : Startup configuration sync has completed
Bulk sync done for ARP: 1
Bulk sync done for LB: 0
Bulk sync done for ICM: 0
ACE_2/Admin(config-ft-group)# do sh ft group 1 detail

FT Group                     : 2
No. of Contexts              : 1
Context Name                 : C1
Context Id                   : 4
Configured Status            : in-service
Maintenance mode             : MAINT_MODE_OFF
My State                     : FSM_FT_STATE_STANDBY_HOT
My Config Priority           : 90
My Net Priority              : 90
My Preempt                   : Enabled
Peer State                   : FSM_FT_STATE_ACTIVE
Peer Config Priority         : 120
Peer Net Priority            : 120
Peer Preempt                 : Enabled
Peer Id                      : 1
Last State Change time       : Wed Feb  3 <strong>14:37:51</strong> 2010
Running cfg sync enabled     : Enabled
Running cfg sync status      : Running configuration sync has completed
Startup cfg sync enabled     : Enabled
Startup cfg sync status      : Startup configuration sync has completed
Bulk sync done for ARP: 1
Bulk sync done for LB: 2
Bulk sync done for ICM: 2</pre>
</blockquote>
<h2>Step 2</h2>
<p>On the ACE, preemption is enabled by default for all the  contexts. It needs to be disabled to perform a manual failover.</p>
<blockquote>
<pre>ACE_1/Admin(config)# ft group 1
ACE_1/Admin(config-ft-group)# no preempt
ACE_1/Admin(config-ft-group)# ft group 2
ACE_1/Admin(config-ft-group)# no preempt
ACE_1/Admin(config-ft-group)# ft group 3
ACE_1/Admin(config-ft-group)# no preempt
ACE_1/Admin(config-ft-group)# end</pre>
</blockquote>
<h2>Step 3</h2>
<p>Download the new software image to the active and standby ACEs. Here I&#8217;ve chosen to use tftp because I hadn&#8217;t an ftp server configured in the lab&#8230; ftp can be used and is definitely faster.</p>
<blockquote>
<pre>ACE_1/Admin# copy tftp: image:
Enter source filename[]? c6ace-t1k9-mz.A2_2_3.bin
Enter the destination filename[]? [c6ace-t1k9-mz.A2_2_3.bin]
Address of remote host[]? 10.1.1.1
Trying to connect to tftp server......
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
(…)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TFTP get operation was successful
 31361516 bytes copied
ACE_1/Admin#
ACE_1/Admin# dir image:
 30788103  Apr 15 13:14:48 2009 c6ace-t1k9-mz.A2_1_4a.bin
 <strong>31361516</strong>  Feb  3 14:43:45 2010 <strong>c6ace-t1k9-mz.A2_2_3.bin</strong>
          Usage for image: filesystem
          461848576 bytes total used
          577126400 bytes free
         1038974976 total bytes</pre>
</blockquote>
<p>Check the file size is correct…</p>
<h2>Step 4</h2>
<p>Change the boot string on the active ACE, it will be synced to the standby ACE. By the way, configuration mode is disabled on the standby ACE therefore it is the only option&#8230;</p>
<blockquote>
<pre>ACE_1/Admin# sh run | i boot
Generating configuration....
<strong>boot system image:c6ace-t1k9-mz.A2_1_4a.bin</strong>
ACE_1/Admin# conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ACE_1/Admin(config)# <strong>no</strong> <strong>boot system image:c6ace-t1k9-mz.A2_1_4a.bin</strong>
ACE_1/Admin(config)# <strong>boot system image:c6ace-t1k9-mz.A2_2_3.bin</strong>
ACE_1/Admin(config)# exit
ACE_1/Admin# wr mem all
Generating configuration....
running config of context Admin saved
Generating configuration....
running config of context C2 saved
Generating configuration....
running config of context C1 saved
Please wait ... sync to compact flash in progress.

This may take a few minutes to complete

<strong>Sync Done</strong></pre>
</blockquote>
<h2><strong>Step 5 (optional)</strong></h2>
<p>Create checkpoint in all contexts on active and standby devices</p>
<blockquote>
<pre>ACE_2/Admin# checkpoint create 20100203
Generating configuration....
Created configuration checkpoint '20100203'
ACE_2/Admin# changeto C2

NOTE: Configuration mode has been disabled on all sessions

ACE_2/C2# checkpoint create 20100203
Generating configuration....
Created configuration checkpoint '20100203'
ACE_2/C2# changeto C1

NOTE: Configuration mode has been disabled on all sessions

ACE_2/C1# checkpoint create 20100203
Generating configuration....
Created configuration checkpoint '20100203'
ACE_2/C1# changeto Admin</pre>
</blockquote>
<h2>Step 6</h2>
<p>Reload the standby device</p>
<blockquote>
<pre>ACE_2/Admin# reload
This command will reboot the system
Save configurations for all the contexts. Save? [yes/no]: [yes] no<em> <span style="color: #0000ff;">(already done in step 4)</span></em>
Perform system reload. [yes/no]: [yes]

NOTE: Configuration mode is enabled on all sessions

Connection to ACE_2 closed by remote host.
Connection to ACE_2 closed.</pre>
</blockquote>
<h2>Step 7</h2>
<p>Check the standby device is running the new software version.</p>
<blockquote>
<pre>ACE_2/Admin# sh ver
Cisco Application Control Software (ACSW)
TAC support: http://C2 .cisco.com/tac
Copyright (c) 2002-2009, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software are covered under the GNU Public
License. A copy of the license is available at
http://C2 .gnu.org/licenses/gpl.html.

Software
  loader:    Version 12.2[120]
  system:    Version <strong>A2(2.3)</strong> [build 3.0(0)A2(2.3)]
  system image file: [LCP] disk0:c6ace-t1k9-mz.A2_2_3.bin
  installed license: ACE-VIRT-020

Hardware
  Cisco ACE (slot: 6)
  cpu info:
    number of cpu(s): 2
    cpu type: SiByte
    cpu: 0, model: SiByte SB1 V0.2, speed: 700 MHz
    cpu: 1, model: SiByte SB1 V0.2, speed: 700 MHz
  memory info:
    total: 827128 kB, free: 256000 kB
    shared: 0 kB, buffers: 1824 kB, cached 0 kB
  cf info:
    filesystem: /dev/cf
    total: 1014624 kB, used: 451040 kB, available: 563584 kB

last boot reason:  reload command by Admin
configuration register:  0x1
ACE_2 kernel uptime is 0 days 0 hour 8 minute(s) 45 second(s)</pre>
</blockquote>
<h2>Step 8</h2>
<p>Wait until <strong>all the contexts</strong> on the standby devices stabilize in STANDBY_WARM or STANDBY_HOT state.</p>
<blockquote>
<pre>ACE_2/Admin# sh ft group brief

FT Group ID: 1  My State:FSM_FT_STATE_STANDBY_WARM      Peer State:FSM_FT_STATE_ACTIVE
                Context Name: Admin     Context Id: 0
FT Group ID: 2  My State:FSM_FT_STATE_STANDBY_WARM      Peer State:FSM_FT_STATE_ACTIVE
                Context Name: C1        Context Id: 4
FT Group ID: 3  My State:FSM_FT_STATE_STANDBY_WARM      Peer State:FSM_FT_STATE_ACTIVE
                Context Name: C2        Context Id: 3</pre>
</blockquote>
<p>For your information, <a href="http://docwiki.cisco.com/wiki/Cisco_Application_Control_Engine_%28ACE%29_Module_Troubleshooting_Guide,_Release_A2%28x%29_--_Troubleshooting_Redundancy#About_WARM_COMPATIBLE_and_STANDBY_WARM" target="_blank">here is what Cisco says about STANDBY_WARM state</a> :</p>
<blockquote><p><span style="font-family: Arial; font-size: x-small;">In the STANDBY_WARM  state, as with the STANDBY_HOT state, configuration mode is disabled on the  standby ACE and configuration and state synchronization continues. A failover  from the active to the standby based on priorities and preempt can still occur  while the standby is in the STANDBY_WARM state. However, <strong>while stateful  failover is possible for a WARM standby, it is not guaranteed</strong>. In  general, modules should be allowed to remain in this state only for a short  period of time.</span></p></blockquote>
<h2>Step 9</h2>
<p>Perform a failover from the active ACE to the standby ACE for all the contexts.</p>
<blockquote>
<pre>ACE_1/Admin# ft switchover all
This command will cause card to switchover (yes/no)?  [no] yes

NOTE: Configuration mode has been disabled on all sessions</pre>
</blockquote>
<h2>Step 10</h2>
<p>Check the newly upgraded ACE is well become active.</p>
<blockquote>
<pre>ACE_1/Admin# sh ft group brief

FT Group ID: 1  My State:FSM_FT_STATE_STANDBY_BULK      Peer State:FSM_FT_STATE_ACTIVE
                Context Name: Admin     Context Id: 0
FT Group ID: 2  My State:FSM_FT_STATE_STANDBY_BULK      Peer State:FSM_FT_STATE_ACTIVE
                Context Name: C1        Context Id: 4
FT Group ID: 3  My State:FSM_FT_STATE_STANDBY_BULK      Peer State:FSM_FT_STATE_ACTIVE
                Context Name: C2        Context Id: 3</pre>
</blockquote>
<h2>Step 11</h2>
<p>Reload the 2<sup>nd</sup> ACE (previously active).</p>
<blockquote>
<pre>ACE_1/Admin# reload
This command will reboot the system
Save configurations for all the contexts. Save? [yes/no]: [yes] no
Perform system reload. [yes/no]: [yes]

NOTE: Configuration mode is enabled on all sessions

Connection to ACE_1 closed by remote host.
Connection to ACE_1 closed.</pre>
</blockquote>
<h2>Step 12</h2>
<p>When the 2<sup>nd</sup> ACE state stabilize to FSM_FT_STATE_STANDBY_HOT state, perform again a failover for all the contexts.</p>
<blockquote>
<pre>ACE_2/Admin# sh ft group brief

FT Group ID: 1  My State:FSM_FT_STATE_ACTIVE    Peer State:FSM_FT_STATE_STANDBY_HOT
                Context Name: Admin     Context Id: 0
FT Group ID: 2  My State:FSM_FT_STATE_ACTIVE    Peer State:FSM_FT_STATE_STANDBY_HOT
                Context Name: C1        Context Id: 4
FT Group ID: 3  My State:FSM_FT_STATE_ACTIVE    Peer State:FSM_FT_STATE_STANDBY_HOT
                Context Name: C2        Context Id: 3</pre>
</blockquote>
<h2>Step 13 (If you&#8217;re not superstitious)</h2>
<p>Reconfigure preemption if it is in your standard… (personally I don&#8217;t like preemption because if a device has failed I prefer to check exactly why before activating it again)</p>
<blockquote>
<pre>ACE_1/Admin(config)# ft group 1
ACE_1/Admin(config-ft-group)# preempt
ACE_1/Admin(config-ft-group)# ft group 2
ACE_1/Admin(config-ft-group)# preempt
ACE_1/Admin(config-ft-group)# ft group 3
ACE_1/Admin(config-ft-group)# preempt
ACE_1/Admin(config-ft-group)# end
ACE_1/Admin# wr mem</pre>
</blockquote>
<p>And that&#8217;s it, you have upgraded your ACE cluster with no or limited impact. If you find this post helpful you may leave a comment to encourage me to publish more articles&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/ace-software-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VPS for rent</title>
		<link>http://www.exp-networks.be/blog/vps-for-rent/</link>
		<comments>http://www.exp-networks.be/blog/vps-for-rent/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 05:48:13 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Company news]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[Company]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=300</guid>
		<description><![CDATA[You need a server connected to Internet? You don&#8217;t want a shared server but you don&#8217;t want to pay for a dedicated server? exp-NETWORKS can rent you a Virtual Private Server (VPS). A VPS runs its own Linux OS with its own packages, users administration, configuration on a shared hardware. The VPS running on the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-303 alignnone" title="VPS" src="http://www.exp-networks.be/wp-content/uploads/2009/12/vps.gif" alt="VPS" width="176" height="160" /></p>
<p>You need a server connected to Internet? You don&#8217;t want a shared server but you don&#8217;t want to pay for a dedicated server? exp-NETWORKS can rent you a Virtual Private Server (VPS). A VPS runs its own Linux OS with its own packages, users administration, configuration on a shared hardware. The VPS running on the same hardware are isolated from each other. <span id="more-300"></span></p>
<p>The VPS proposed by exp-NETWORKS comes with a minimal Debian 5 install and ssh access. Should you want another Linux distribution, please <a href="http://www.exp-networks.be/exp-networks/contact-us/">contact us</a>.</p>
<table border="0" cellspacing="0">
<tbody>
<tr>
<td valign="top" width="50"><strong>VPS I</strong></td>
<td width="60">memory<br />
disk</td>
<td width="60">512 Mo<br />
10 Go</td>
<td valign="middle"><strong><span style="color: #000080;font-size:300%;"><img class="alignnone size-full wp-image-324" title="19.99€" src="http://www.exp-networks.be/wp-content/uploads/2009/12/1999.png" alt="19.99€" width="73" height="30" /> <img class="alignnone size-full wp-image-328" title="vat excl. /month" src="http://www.exp-networks.be/wp-content/uploads/2009/12/vatexcl.png" alt="vat excl. /month" width="65" height="28" /><br />
</span></strong></td>
</tr>
<tr>
<td valign="top"><strong>VPS II</strong></td>
<td>memory<br />
disk</td>
<td>1024 Mo<br />
20 Go</td>
<td valign="middle"><strong><span style="color: #000080;font-size:300%;"><img class="alignnone size-full wp-image-325" title="29.99€" src="http://www.exp-networks.be/wp-content/uploads/2009/12/2999.png" alt="29.99€" width="73" height="30" /> <img class="alignnone size-full wp-image-328" title="vat excl. /month" src="http://www.exp-networks.be/wp-content/uploads/2009/12/vatexcl.png" alt="vat excl. /month" width="65" height="28" /><br />
</span></strong></td>
</tr>
<tr>
<td valign="top"><strong>VPS III<br />
</strong></td>
<td>memory<br />
disk</td>
<td>2048 Mo<br />
30 Go</td>
<td valign="middle"><strong><span style="color: #000080;font-size:300%;"><img class="alignnone size-full wp-image-326" title="49.99€" src="http://www.exp-networks.be/wp-content/uploads/2009/12/4999.png" alt="49.99€" width="73" height="30" /> <img class="alignnone size-full wp-image-328" title="vat excl. /month" src="http://www.exp-networks.be/wp-content/uploads/2009/12/vatexcl.png" alt="vat excl. /month" width="65" height="28" /><br />
</span></strong></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/vps-for-rent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClamXav differential update</title>
		<link>http://www.exp-networks.be/blog/clamxav-differential-update/</link>
		<comments>http://www.exp-networks.be/blog/clamxav-differential-update/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 05:49:06 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=275</guid>
		<description><![CDATA[ClamXav is a free virus checker for Mac OS X. It uses the tried, tested and very popular ClamAV open source antivirus engine as a back end. The default install of ClamXav does not enable the automatic virus definition update. When a user enables those automatic updates, a &#8216;good old cron job&#8217; is created for [...]]]></description>
			<content:encoded><![CDATA[<p><a title="ClamXav" href="http://www.clamxav.com/"><img class="alignnone size-full wp-image-297" title="ClamXav" src="http://www.exp-networks.be/wp-content/uploads/2009/11/ClamXav.png" alt="ClamXav" width="77" height="77" />ClamXav</a> is a free virus checker for Mac OS X.  It uses the tried, tested and very popular <a title="clam" href="http://www.clamav.net/" target="_new">ClamAV</a> open source antivirus engine as a back end.</p>
<p>The default install of ClamXav does not enable the automatic virus definition update. When a user enables those automatic updates, a &#8216;good old cron job&#8217; is created for that user. Three minor concerns with that method are:</p>
<ol>
<li>Each users on the system can enable the automatic updates leading to multiple redundant checks for new virus definitions</li>
<li>The users do not have write access to ClamXav directories and are not able to create a temporary directory required for differential updates. Fortunately ClamXav fall back to a standard update where the entire virus definition file is downloaded.</li>
<li>All the users who enable the automatic updates will get e-mails containing an error message like this one :
<pre>clamxav ERROR: chdir_tmp: Can't create directory ./clamav-97e66bd7fbb</pre>
</li>
</ol>
<p>Only the _clamav user has write access to his directories. I&#8217;ve found several workarounds for this by googling but most of them were either not secure like setting the _clamav user&#8217;s directories world wide writable, either not elegant like putting the cron job in the root&#8217;s crontab&#8230;</p>
<p>The only elegant workaround I&#8217;ve found so far is still requiring some manual configuration but at least it uses Apple&#8217;s vision of daemon and recurrent tasks; it uses <a title="Launchd" href="http://developer.apple.com/macosx/launchd.html">launchd</a>. I won&#8217;t explain launchd here but <a title="Launchd" href="http://developer.apple.com/macosx/launchd.html">Apple website</a> or <a title="Launchd AFP548" href="http://www.afp548.com/article.php?story=20050620071558293">AFP548</a> website are very good start to understand its philosophy.</p>
<p>We will configure a launchd daemon to start the virus definition update every day at 21:30 as _clamav user. Launchd is configured via property list files (.plist) placed in appropriate directories. In this case we want the daemon to be started as long as the system is started (i.e. regardless if a user is logged or not). We will place our plist file in /Library/LaunchDaemons/.</p>
<pre>
 1. &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 2. &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
 3. &lt;plist version="1.0"&gt;
 4.   &lt;dict&gt;
 5.     &lt;key&gt;Label&lt;/key&gt;
 6.     &lt;string&gt;com.clamxav.freshclam&lt;/string&gt;
 7.     &lt;key&gt;UserName&lt;/key&gt;
 8.     &lt;string&gt;_clamav&lt;/string&gt;
 9.     &lt;key&gt;LowPriorityIO&lt;/key&gt;
10.     &lt;true/&gt;
11.     &lt;key&gt;Nice&lt;/key&gt;
12.     &lt;integer&gt;1&lt;/integer&gt;
13.     &lt;key&gt;Program&lt;/key&gt;
14.     &lt;string&gt;/usr/local/clamXav/bin/freshclam&lt;/string&gt;
15.     &lt;key&gt;ProgramArguments&lt;/key&gt;
16.     &lt;array&gt;
17.       &lt;string&gt;/usr/local/clamXav/bin/freshclam&lt;/string&gt;
18.       &lt;string&gt;--quiet&lt;/string&gt;
19.       &lt;string&gt;--log=/usr/local/clamXav/share/clamav/freshclam.log&lt;/string&gt;
20.     &lt;/array&gt;
21.     &lt;key&gt;StartCalendarInterval&lt;/key&gt;
22.     &lt;dict&gt;
23.       &lt;key&gt;Hour&lt;/key&gt;
24.       &lt;integer&gt;21&lt;/integer&gt;
25.       &lt;key&gt;Minute&lt;/key&gt;
26.       &lt;integer&gt;30&lt;/integer&gt;
27.     &lt;/dict&gt;
28.   &lt;/dict&gt;
29. &lt;/plist&gt;
</pre>
<p>Lines 5-6 : define the daemon&#8217;s name<br />
Lines 7-8 : define the user the daemon will run as<br />
Lines 9-12 : reduce the update process priority as it is not required to run fast<br />
Lines 13-20 : define the daemon&#8217;s executable and its parameters<br />
Lines 21- 27 : schedule when the daemon must run</p>
<p>That plist file must be placed in /Library/LaunchDaemons/. It will be automatically loaded after each reboot but you can manually load it with launchctl if you don&#8217;t want to restart your computer.</p>
<blockquote><pre>$ sudo launchctl load /Library/LaunchDaemons/com.clamxav.freshclam.plist
$ sudo launchctl list | grep com.clamxav.freshclam
-	0	com.clamxav.freshclam</pre>
</blockquote>
<p>Now you can check in the log file (<code>/usr/local/clamXav/share/clamav/freshclam.log</code>) the error message has disappeared and differential update is now working fine&#8230;</p>
<pre>ClamAV update process started at Sat Nov 28 21:30:09 2009
main.cvd is up to date (version: 51, sigs: 545035, f-level: 42, builder: sven)
Downloading daily-10091.cdiff [100%]
daily.cld updated (version: 10091, sigs: 115838, f-level: 44, builder: ccordes)
Database updated (660873 signatures) from database.clamav.net (IP: 193.1.193.64)
Clamd successfully notified about the update.
</pre>
<p>
Thanks for leaving a comment if you found this useful</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/clamxav-differential-update/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Label eTIC</title>
		<link>http://www.exp-networks.be/blog/label-etic/</link>
		<comments>http://www.exp-networks.be/blog/label-etic/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 15:26:46 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Company news]]></category>
		<category><![CDATA[Company]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=151</guid>
		<description><![CDATA[exp-NETWORKS is proud to announce it has just signed the eTIC charter. That charter constrains exp-NETWORKS to address with his customer, upon the establishment of the offer, the key points that could be a source of future litigation if not clarified, such as control of costs and time, the intellectual property rights or continuity / [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.charte-etic.be/index.php?page=les-signataires&#038;recherche=exp-networks"><img title="Label eTIC" src="/wp-content/uploads/2009/08/etic.jpg" alt="" width="95" height="95" /></a>exp-NETWORKS is proud to announce it has just signed the eTIC charter. That charter constrains exp-NETWORKS to address with his customer, upon the establishment of the offer, the key points that could be a source of future litigation if not clarified, such as control of costs and time, the intellectual property rights or continuity / portability of the solution, and urged it to ensure the adequacy of service in relation to customer needs and ensure good coordination with any subcontractors. By pushing for this dialogue, this code of ethics led to the establishment of contracts more balanced, better passing the test of time and especially with the two parties having a clear view on the scope.</p>
<p>You can have a look to the complete <a title="eTIC Charter" href="http://www.charte-etic.be/publications/charte-etic.pdf">charter text in french</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/label-etic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Multipoint VPN</title>
		<link>http://www.exp-networks.be/blog/dmvpn/</link>
		<comments>http://www.exp-networks.be/blog/dmvpn/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 16:33:27 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=242</guid>
		<description><![CDATA[Ever wonder how to provision several hundreds of VPNs from remote offices with dynamic IP to a central site with minimal configuration? Cisco offer an elegant  solution called Dynamic Multipoint VPN. With DMVPN the central site does not need to know the remote site IP in advance, it will learn it via NHRP protocol when the [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wonder how to provision several hundreds of VPNs from remote offices with dynamic IP to a central site with minimal configuration? <a href="http://www.cisco.com">Cisco </a>offer an elegant  solution called Dynamic Multipoint VPN. With DMVPN the central site does not need to know the remote site IP in advance, it will learn it via NHRP protocol when the remote router will come up.</p>
<p><a href="http://www.exp-networks.be/wp-content/uploads/2009/09/DMVPN-single.png"><img class="alignnone size-full wp-image-420" title="DMVPN-single" src="http://www.exp-networks.be/wp-content/uploads/2009/09/DMVPN-single.png" alt="DMVPN network diagram" width="513" height="318" /></a></p>
<p>First we will create IP connectivity via GRE tunnels and NHRP then we will secure the GRE tunnels with IPSec.</p>
<p>The hub router will use a multipoint GRE interface for ease of management. That way we do not need to provision a new tunnel interface per remote office. In fact, the central router will not need to be reconfigured at all for any additional remote site.</p>
<p>Hub router R1:</p>
<blockquote><p><code>interface Tunnel0<br />
ip address 10.10.10.1 255.255.255.0<br />
ip nhrp network-id 1<br />
tunnel source FastEthernet0/0<br />
tunnel mode gre multipoint<br />
tunnel key 1</code></p>
<p><code>interface Fa0/0<br />
ip address 1.1.1.2 255.255.255.0</code></p>
<p><code>ip route 0.0.0.0 0.0.0.0 1.1.1.1</code></p></blockquote>
<p>Spoke routers (R2 and R3 in this example) will use point-to-point GRE tunnel pointing to central site&#8217;s hub router R1. NHRP will be configured to use R1 as next-hop server. With this setup, spoke-to-spoke traffic will flow through the hub making the hub a central point where you can enforce security&#8230;</p>
<p>Spoke router R2:</p>
<blockquote><p><code>interface Tunnel0<br />
ip address 10.10.10.2 255.255.255.0<br />
ip nhrp map 10.10.10.1 1.1.1.2<br />
ip nhrp network-id 1<br />
ip nhrp nhs 10.10.10.1<br />
tunnel source FastEthernet0/0<br />
tunnel destination 1.1.1.2<br />
tunnel key 1<br />
</code><br />
<code>interface Fa0/0<br />
ip address 2.2.2.2 255.255.255.0<br />
</code><br />
<code>ip route 0.0.0.0 0.0.0.0 2.2.2.1</code></p></blockquote>
<p>Spoke router R3</p>
<blockquote><p><code>interface Tunnel0<br />
ip address 10.10.10.3 255.255.255.0<br />
ip nhrp map 10.10.10.1 1.1.1.2<br />
ip nhrp network-id 1<br />
ip nhrp nhs 10.10.10.1<br />
tunnel source FastEthernet0/0<br />
tunnel destination 1.1.1.2<br />
tunnel key 1<br />
</code><br />
<code>interface Fa0/0<br />
ip address 3.3.3.2 255.255.255.0<br />
</code><br />
<code>ip route 0.0.0.0 0.0.0.0 3.3.3.1</code></p></blockquote>
<p>At this stage, if the router can communicate with each others via their Fa0/0 interface then the GRE tunnels are usable. In this example, &#8220;Internet&#8221; router is directly connected to all the routers and the routers R1, R2 and R3 simply have a default route pointing to the &#8220;Internet&#8221; router.</p>
<p>To check the GRE tunnels are operational, we only have to ping the tunnels&#8217; internal IP from one router to the others two.</p>
<blockquote><p><code>R2#ping 10.10.10.1</code></p>
<p><code>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:<br />
!!!!!<br />
Success rate is 100 percent (5/5), round-trip min/avg/max = 272/313/420 ms<br />
R2#ping 10.10.10.3</code></p>
<p><code>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 10.10.10.3, timeout is 2 seconds:<br />
!!!!!<br />
Success rate is 100 percent (5/5), round-trip min/avg/max = 312/564/876 ms</code></p></blockquote>
<p>If we check the NHRP entries on the hub R1, we can see the two entries have been learned dynamically and the public IP used by the remote routers.</p>
<blockquote><p><code>R1#sh ip nhrp<br />
10.10.10.2/32 via 10.10.10.2, Tunnel0 created 00:11:31, expire 01:48:28<br />
Type: <strong>dynamic</strong>, Flags: authoritative unique registered used<br />
NBMA address: <strong>2.2.2.2</strong><br />
10.10.10.3/32 via 10.10.10.3, Tunnel0 created 00:08:19, expire 01:51:52<br />
Type: <strong>dynamic</strong>, Flags: authoritative unique registered used<br />
NBMA address: <strong>3.3.3.2</strong></code></p></blockquote>
<p>Same info without the timers&#8230;</p>
<blockquote><p><code>R1#sh ip nhrp brief<br />
Target            Via         NBMA        Mode   Intfc   Claimed<br />
10.10.10.2/32     10.10.10.2  2.2.2.2     dynamic  Tu0    &lt;  &gt;<br />
10.10.10.3/32     10.10.10.3  3.3.3.2     dynamic  Tu0    &lt;  &gt;</code></p></blockquote>
<p>Statistics about the NHRP protocol itself</p>
<blockquote><p><code>R1#sh ip nhrp traffic<br />
Tunnel0<br />
Sent: Total 3<br />
0 Resolution Request  0 Resolution Reply  0 Registration Request<br />
3 Registration Reply  0 Purge Request  0 Purge Reply<br />
0 Error Indication<br />
Rcvd: Total 3<br />
0 Resolution Request  0 Resolution Reply  3 Registration Request<br />
0 Registration Reply  0 Purge Request  0 Purge Reply<br />
0 Error Indication<br />
</code><br />
<code>R1#sh ip nhrp summary<br />
IP NHRP cache 2 entries, 496 bytes<br />
0 static  2 dynamic  0 incomplete</code></p></blockquote>
<p>On the spoke routers we can check the same&#8230; Here we can see the NHRP entry is statically defined</p>
<blockquote><p><code>R3#sh ip nhrp<br />
10.10.10.1/32 via 10.10.10.1, Tunnel0 created 00:13:31, never expire<br />
Type: <strong>static</strong>, Flags: authoritative<br />
NBMA address: <strong>1.1.1.2</strong></code></p>
<p><code>R3#sh ip nhrp summary<br />
IP NHRP cache 1 entry, 248 bytes<br />
1 static  0 dynamic  0 incomplete</code></p></blockquote>
<p>And we can check the NHRP&#8217;s next-hop server used.</p>
<blockquote><p><code>R3#sh ip nhrp nhs<br />
Legend:<br />
E=Expecting replies<br />
R=Responding<br />
</code><br />
<code>Tunnel0:<br />
10.10.10.1       RE<br />
</code></p></blockquote>
<p>Should you want to allow spoke-to-spoke tunnels to be built dynamically, you only need to replace the  <code>tunnel destination 1.1.1.2</code> command on the spokes by <code>tunnel mode gre multipoint</code> making the spokes&#8217; tunnel interface an mGRE interface. For the remaining of this article, we won&#8217;t use mGRE interfaces on the spokes.</p>
<p>Now that we have IP connectivity, we still have to secure those dynamically created GRE tunnels with IPSec. Here for simplicity we will use pre-shared key as authentication method which is not recommended for production deployment&#8230;</p>
<p>On the hub and spoke routers, just configure ISAKMP/IPSec parameters and enable IPSec on the tunnel insterfaces.</p>
<blockquote><p><code>crypto isakmp policy 10<br />
authentication pre-share<br />
crypto isakmp key cisco123 address 0.0.0.0 0.0.0.0<br />
!<br />
crypto ipsec transform-set mySet esp-aes esp-sha-hmac<br />
!<br />
crypto ipsec profile myDMVPN<br />
set security-association lifetime seconds 120<br />
set transform-set mySet<br />
set pfs group2</code></p>
<p><code>interface Tunnel0<br />
tunnel protection ipsec profile myDMVPN<br />
</code></p></blockquote>
<p>Check IPSec SA are well negotiated</p>
<blockquote><p><code>R1#sh crypto ipsec sa<br />
</code><br />
<code>interface: Tunnel0<br />
Crypto map tag: Tunnel0-head-0, local addr 1.1.1.2<br />
</code><br />
<code> protected vrf: (none)<br />
local  ident (addr/mask/prot/port): (1.1.1.2/255.255.255.255/47/0)<br />
remote ident (addr/mask/prot/port): (2.2.2.2/255.255.255.255/47/0)<br />
current_peer 2.2.2.2 port 500<br />
PERMIT, flags={origin_is_acl,}<br />
#pkts encaps: 121, #pkts encrypt: 121, #pkts digest: 121<br />
#pkts decaps: 121, #pkts decrypt: 121, #pkts verify: 121<br />
#pkts compressed: 0, #pkts decompressed: 0<br />
#pkts not compressed: 0, #pkts compr. failed: 0<br />
#pkts not decompressed: 0, #pkts decompress failed: 0<br />
#send errors 0, #recv errors 0<br />
</code><br />
<code> local crypto endpt.: 1.1.1.2, remote crypto endpt.: 2.2.2.2<br />
path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0/0<br />
current outbound spi: 0xA2BC2FED(2730242029)<br />
</code><br />
<code> inbound esp sas:<br />
spi: 0x2884EDEA(679800298)<br />
transform: esp-aes esp-sha-hmac ,<br />
in use settings ={Tunnel, }<br />
conn id: 2005, flow_id: SW:5, crypto map: Tunnel0-head-0<br />
sa timing: remaining key lifetime (k/sec): (4463708/83)<br />
IV size: 16 bytes<br />
replay detection support: Y<br />
Status: ACTIVE<br />
</code><br />
<code> inbound ah sas:<br />
</code><br />
<code> inbound pcp sas:<br />
</code><br />
<code> outbound esp sas:<br />
spi: 0xA2BC2FED(2730242029)<br />
transform: esp-aes esp-sha-hmac ,<br />
in use settings ={Tunnel, }<br />
conn id: 2004, flow_id: SW:4, crypto map: Tunnel0-head-0<br />
sa timing: remaining key lifetime (k/sec): (4463708/82)<br />
IV size: 16 bytes<br />
replay detection support: Y<br />
Status: ACTIVE<br />
</code><br />
<code> outbound ah sas:<br />
</code><br />
<code> outbound pcp sas:</code></p></blockquote>
<p>That&#8217;s it! The DMVPN setup is ready for wide deployment&#8230; Of course central hub router should be duplicated for redundancy, it will exposed in a future post.</p>
<p>Thanks for leaving a comment if you found this useful</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/dmvpn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPv6 Firewall with Linux</title>
		<link>http://www.exp-networks.be/blog/ipv6-firewall/</link>
		<comments>http://www.exp-networks.be/blog/ipv6-firewall/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 15:21:51 +0000</pubDate>
		<dc:creator>Christophe Lemaire</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.exp-networks.be/?p=203</guid>
		<description><![CDATA[More and more server hoster have configured IPv6 on their network. And most of their Linux based servers come with a basic IPv6 configuration. Even if IPv6 is not used, it is there and widely open as the netfilter/iptables default policy is ACCEPT. If you don&#8217;t use IPv6 at all, disable it. On Debian, the [...]]]></description>
			<content:encoded><![CDATA[<p>More and more server hoster have configured IPv6 on their network. And most of their Linux based servers come with a basic IPv6 configuration. Even if IPv6 is not used, it is there and <strong>widely open</strong> as the <a href="http://www.netfilter.org/projects/iptables/index.html">netfilter/iptables</a> default policy is ACCEPT.</p>
<p><strong>If you don&#8217;t use IPv6 at all, disable it.</strong> On Debian, the interfaces configuration is located in /etc/network/interfaces. Remove all the inet6 configuration looking like this :</p>
<pre>iface eth0 inet6 static
  address 2001:db8:4:fe34::3ea1
  netmask 64
</pre>
<p><strong>If you plan to use IPv6, first you have to know ICMPv6 should be filtered carefully.</strong> In IPv6, ICMPv6 is widely used. It replaces IPv4&#8242;s ARP with neighbour-solicitation and neighbour-advertisement ICMPv6 messages. It is used for router discovery via router-solicitation and router-advertisement ICMPv6 messages. It replaces IPv4&#8242;s IGMP with group-membership-query, group-membership-report and group-membership-reduction ICMPv6 messages.</p>
<p>Here is a small script to activate IPv6 filtering with <a href="http://www.netfilter.org/projects/iptables/index.html">netfilter/ip<strong>6</strong>tables</a>. The script has been test on Debian but it should work on other Linux flavor.</p>
<pre>#!/bin/sh -e
#
# Simple example IPv6 Firewall configuration.
#
# Caveats:
# - This configuration applies to all network interfaces
# if you want to restrict this to only a given interface use
# '-i INTERFACE' in the ip6tables calls.
# - Remote access for TCP/UDP services is granted to any host,
# you probably will want to restrict this using '--source'.
#
# description: Activates/Deactivates the firewall at boot time
#
# You should test this script before applying with safe-restart option
#

IP6TABLES=/sbin/ip6tables
#IP6TABLES="/sbin/ip6tables -i eth0"

[ -x "$IP6TABLES" ] || exit 1

# Inbound TCP ports
TCP_INPUT_PORTS="21 22 53 443"

# Inbound UDP ports
UDP_INPUT_PORTS="53"

# Allowed ICMP messages
ALLOWED_ICMP="\
packet-too-big \
destination-unreachable \
time-exceeded parameter-problem \
echo-request \
echo-reply \
router-advertisement \
neighbour-solicitation \
neighbour-advertisement"

fw_start () {
# Allow related and established connection.
$IP6TABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# Allow ICMP as defined in ALLOWED_ICMP
if [ -n "$ALLOWED_ICMP" ] ; then
 for ICMP_TYPE in $ALLOWED_ICMP; do
  $IP6TABLES -A INPUT -p icmpv6 --icmpv6-type ${ICMP_TYPE} -j ACCEPT
 done
fi

# Open allowed TCP ports if any
if [ -n "$TCP_INPUT_PORTS" ] ; then
 for PORT in $TCP_INPUT_PORTS; do
  $IP6TABLES -A INPUT -m state --state NEW -p tcp --dport ${PORT} \
  -j ACCEPT
 done
fi

# Open allowed UDP ports if any
if [ -n "$UDP_INPUT_PORTS" ] ; then
 for PORT in $UDP_INPUT_PORTS; do
  $IP6TABLES -A INPUT -m state --state NEW -p udp --dport ${PORT} \
  -j ACCEPT
 done
fi

# Allow traffic to the loopback (needed by some applications)
$IP6TABLES -A INPUT -i lo -j ACCEPT

# Log and drop all other packets.
$IP6TABLES -A INPUT -j LOG
$IP6TABLES -P INPUT DROP

# Los and drop all packet to be forwarded, we're not a router...
$IP6TABLES -A FORWARD -j LOG
$IP6TABLES -P FORWARD DROP

# We're not going to filter outgoing packets
# but you can if you're paranoid like I am...
$IP6TABLES -P OUTPUT ACCEPT
}

# fw_stop disables completely the firewall and reset all chains to
# the default policy ACCEPT
fw_stop () {
  $IP6TABLES -P INPUT ACCEPT
  $IP6TABLES -P FORWARD ACCEPT
  $IP6TABLES -P OUTPUT ACCEPT
  $IP6TABLES -t mangle -P PREROUTING ACCEPT
  $IP6TABLES -t mangle -P POSTROUTING ACCEPT
  $IP6TABLES -t mangle -P INPUT ACCEPT
  $IP6TABLES -t mangle -P OUTPUT ACCEPT
  $IP6TABLES -t mangle -P FORWARD ACCEPT
  $IP6TABLES -t mangle -F
  $IP6TABLES -t mangle -X
  $IP6TABLES -F
  $IP6TABLES -X
}

# fw_clear remove the rule set from the firewall and keep the
# current default policy
fw_clear () {
  $IP6TABLES -t mangle -F
  $IP6TABLES -t mangle -X
  $IP6TABLES -F
  $IP6TABLES -X
}

case "$1" in
  start|restart)
    echo -n "Starting IPv6 firewall.."
    fw_clear
    fw_start
    echo "done."
    ;;
  stop)
    echo -n "Stopping IPv6 firewall.."
    fw_stop
    echo "done."
    ;;
  clear)
    echo -n "Clearing IPv6 firewall rules.."
    fw_clear
    echo "done."
    ;;
  test|safe-restart)
    echo -n "Safely restarting IPv6 firewall..."
    fw_clear
    fw_start
    test=""; read -t 10 -p "Is it still OK? " test ; \
    [ -z "$test" ] &#038;&#038; fw_stop
    echo "done."
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|safe-restart|clear}"
    exit 1
    ;;
esac

exit 0</pre>
<p>Now let&#8217;s make the ip6firewall to start at boot time :<br />
<code>update-rc.d ip6firewall start 41 S . stop 34 0 6 .</code></p>
<p>Now the server is only accepting packets on ports <strong>we</strong> have decided.</p>
<p>
<a href="http://ipv6.he.net/certification/scoresheet.php?pass_name=krik" target="_blank"><img src="http://ipv6.he.net/certification/create_badge.php?pass_name=krik&#038;badge=3" width=229 height=137 border=0 alt="IPv6 Certification Badge for krik"></img></a><br />
By the way, I&#8217;ve been <a href="http://ipv6.he.net/certification/scoresheet.php?pass_name=krik">certified ipv6 Guru by Hurricane Electric</a>&#8230; <img src='http://www.exp-networks.be/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />
</p>
<p>That&#8217;s all folks!</p>
<p>
Thanks for leaving a comment if you found this useful</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exp-networks.be/blog/ipv6-firewall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
