<?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>~/blog</title>
	<atom:link href="http://blog.pressure.net.nz/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pressure.net.nz</link>
	<description>Cisco, Juniper, Unix, and open source software</description>
	<lastBuildDate>Mon, 14 Nov 2011 18:29:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Configuring NAT66 on ScreenOS</title>
		<link>http://blog.pressure.net.nz/2011/11/configuring-nat66-on-screenos/</link>
		<comments>http://blog.pressure.net.nz/2011/11/configuring-nat66-on-screenos/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 16:38:07 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Juniper]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[juniper]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[screenos]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=77</guid>
		<description><![CDATA[I recently had to deploy redeploy an old NetScreen 5GT to segregate a production LAN and create a small lab network. The production LAN has a routable IPv6 /64 prefix, delivered via a Hurricane Electric IPv6 tunnel. The lab network also required IPv6 connectivity. We also recently obtained a /48 prefix from Hurricane Electric, so [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to deploy redeploy an old NetScreen 5GT to segregate a production LAN and create a small lab network. The production LAN has a routable IPv6 /64 prefix, delivered via a Hurricane Electric IPv6 tunnel. The lab network also required IPv6 connectivity. We also recently obtained a /48 prefix from Hurricane Electric, so I could have just assigned a /64 from that to the lab network and routed it via the 5GT. However, this 5GT gets moved around to various different networks, including trade show networks. As such, the untrust interface of the 5GT needed to be auto-configuring, so that it would obtain an IPv6 prefix from router advertisements on whichever LAN it was connected to. This also meant that assigning a /64 from our Hurricane Electric /48 prefix was out of the question.</p>
<p>The first step is to enable IPv6 support on your device, if it isn&#8217;t already:</p>
<pre>set envar ipv6=yes
save
reset save-config yes</pre>
<p>After restarting your device, you should find that IPv6 configuration options are available, and the web UI will also have additional pages and config options.<span id="more-77"></span>Next, we want to configure the untrust interface as IPv6 &#8220;host&#8221; mode, and permit it to accept router advertisements from your existing upstream IPv6 router.</p>
<pre>set interface untrust ipv6 mode host
set interface untrust ipv6 enable
set interface untrust ipv6 ra accept</pre>
<p>The untrust interface should configure itself with an address in the prefix advertised on your existing LAN, and create a default IPv6 route (::/0) via your upstream router.</p>
<pre>ns5gt-&gt; get int untrust      
Interface untrust:
  description untrust
  number 1, if_info 88, if_index 0, mode route
  link up, phy-link up/full-duplex
  status change:1, last change:11/09/2011 15:55:40
  ipv6 is enable/operable, host mode.
<span style="color: #ff0000;">  ipv6 operating mtu 1472, learned mtu 1472</span>
  ipv6 Interface-ID: 0210dbfffe680eb1
  ipv6 fe80::210:dbff:fe68:eb1/64, link local, PREFIX
<span style="color: #ff0000;">  ipv6 2001:470:xxxx:xxxx:210:dbff:fe68:eb1/64, global aggregatable, PREFER, AUTO-CONF</span>
  ipv6 ff02::1:ff68:eb1(2), solicited-node scope
  vsys Root, zone Untrust, vr trust-vr
  dhcp client enabled
  PPPoE disabled
  admin mtu 0, operating mtu 1472, default mtu 1500

ns5gt-&gt; get route
IPv6 Dest-Routes for &lt;trust-vr&gt; (3 entries)
--------------------------------------------------------------------------------------
         ID                                   IP-Prefix       Interface
                                                Gateway   P Pref    Mtr     Vsys
--------------------------------------------------------------------------------------
*         3                                        ::/0         untrust
                               fe80::226:88ff:fe45:8242   D  252      2     Root
*         4                     2001:470:xxxx:xxxx::/64         untrust
                                                     ::   C    0      0     Root
*         5    2001:470:xxxx:xxxx:210:dbff:fe68:eb1/128         untrust
                                                     ::   H    0      0     Root</pre>
<p>We can see above that the untrust interface has assigned itself an address in our Hurricane 2001:470:x:x/64 prefix. Note also that it has lowered the MTU to 1472, as advertised by our perimeter SRX. The PPPoE encapsulation of our VDSL connection incurs 8 bytes overhead, and since it is an IPv6 tunnel, we have to subtract another 20 bytes to ensure that we don&#8217;t send fragmented packets via Hurricane (who seem to drop fragmented traffic).</p>
<p>The next step is to configure the trust interface of the 5GT. I tend to use policy NAT, rather than the often-configured default of interface-NAT. Note that if you have existing outbound policies that were depending on the interface being in NAT mode, you will need to adjust those policies to perform source address NAT.</p>
<pre>set interface trust route</pre>
<p>Enable IPv6 on the trust interface in &#8220;router&#8221; mode. First we should generate a <a href="http://tools.ietf.org/search/rfc4193" target="_blank">RFC 4193</a> Unique Local Address (ULA). SixXS offers an online tool to generate one of these pseudo-random, quasi-unique prefixes from a MAC address at <a href="http://www.sixxs.net/tools/grh/ula/" target="_blank">http://www.sixxs.net/tools/grh/ula/</a></p>
<p>An address from a ULA prefix has a global scope, however the fc00::/7 prefix is filtered by ISPs, so there is no chance of these addresses colliding on the Internet. The pseudo-random prefix generation is simply to minimise the chance of a prefix collision on a LAN. The SixXS tool will generate a /48 prefix for you; choose a /64 prefix from that, and assign it to the trust interface:</p>
<pre>set interface trust ipv6 mode router
set interface trust ipv6 ip fd61:b452:a23d::1/64
set interface trust ipv6 enable</pre>
<p>Enable IPv6 router advertisements from the trust interface:</p>
<pre>set interface trust ipv6 ra link-address
set interface trust ipv6 ra transmit</pre>
<p>If your MTU is less than 1500 on the untrust side, you should also advertise it on the trust side:</p>
<pre>set interface trust mtu 1472
set interface trust ipv6 ra link-mtu</pre>
<p>At this stage, you should be able to connect a host to the trust side of the 5GT and acquire an IPv6 address from the fd61:b452:a23d::/64 prefix.</p>
<pre>[root@smurfette ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr D0:27:88:65:21:B5  
          inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fd61:b452:a23d:0:d227:88ff:fe65:21b5/64 Scope:Global
          inet6 addr: fe80::d227:88ff:fe65:21b5/64 Scope:Link</pre>
<p>Now we just need to create a NAT policy for our IPv6 traffic. If you had any existing &#8220;IP any/any&#8221; policies, setting the envar &#8220;ipv6=yes&#8221; should have converted those policies to &#8220;Any-IPv4&#8243; policies. Create a policy for your IPv6 traffic:</p>
<pre>set policy from "Trust" to "Untrust"  "Any-IPv6" "Any-IPv6" "ANY" nat src permit</pre>
<p>At this point, you should be able to ping from your trust-side host to a host on the untrust-side, and beyond:</p>
<pre>[root@smurfette ~]# ping6 2001:470:xxxx:xxxx::1
PING 2001:470:xxxx:xxxx::1(2001:470:xxxx:xxxx::1) 56 data bytes
64 bytes from 2001:470:xxxx:xxxx::1: icmp_seq=1 ttl=63 time=3.48 ms
64 bytes from 2001:470:xxxx:xxxx::1: icmp_seq=2 ttl=63 time=2.52 ms

[root@smurfette ~]# ping6 -n ipv6.google.com
PING ipv6.google.com(2a00:1450:8004::93) 56 data bytes
64 bytes from 2a00:1450:8004::93: icmp_seq=1 ttl=53 time=43.9 ms
64 bytes from 2a00:1450:8004::93: icmp_seq=2 ttl=53 time=44.2 ms</pre>
<p>So there it is&#8230; the 5GT is performing NAT66 on the fd61:b452:a23d::/64 prefix to the globally routable 2001:470:xxxx:xxxx::/64 prefix, using the source address of the egress (untrust) interface. Using this technique, we can connect this 5GT to any IPv6-enabled LAN, and connect hosts behind the safety of our own firewall, whilst still having outbound IPv6 connectivity.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2011/11/configuring-nat66-on-screenos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Mystery of the Disappearing Polycom Idle Logo</title>
		<link>http://blog.pressure.net.nz/2011/07/the-mystery-of-the-disappearing-polycom-idle-logo/</link>
		<comments>http://blog.pressure.net.nz/2011/07/the-mystery-of-the-disappearing-polycom-idle-logo/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 11:33:15 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=68</guid>
		<description><![CDATA[I occasionally have to support customers running very old Polycom SoundPoint IP firmware releases. One of these customers has their company logo installed on their phones as an idle display bitmap (eg. centrally provisioned phone wallpaper). After a recent firmware upgrade at this customer, the logo disappeared, and it took several hours and a fair [...]]]></description>
			<content:encoded><![CDATA[<p>I occasionally have to support customers running very old Polycom SoundPoint IP firmware releases. One of these customers has their company logo installed on their phones as an idle display bitmap (eg. centrally provisioned phone wallpaper). After a recent firmware upgrade at this customer, the logo disappeared, and it took several hours and a fair bit of cursing before we finally found that Polycom had subtly changed the config file syntax.</p>
<p>Assuming that your had your Polycom-related files in a directory of your TFTP server called &#8220;polycom&#8221;, and under that you had a directory called &#8220;bmp&#8221; containing your idle display logos, you would need this in your config, to instruct the phone to download the specified logo:</p>
<pre>&lt;IP_600 bitmap.IP_600.1.name="polycom/bmp/ip600"/&gt;</pre>
<p>And then for firmware revisions 3.0.2 or earlier, the following:</p>
<pre>&lt;IDLE_DISPLAY_WIDE ind.anim.IP_600.30.frame.1.bitmap="polycom/bmp/ip600" ind.anim.IP_600.30.frame.1.duration="0"/&gt;</pre>
<p>But&#8230; if you run firmware revision 3.0.3 or later (excluding the modern 3.3.x series, which uses a totally different system for background logos):</p>
<pre>&lt;IDLE_DISPLAY ind.anim.IP_600.29.frame.1.bitmap="ip600" ind.anim.IP_600.29.frame.1.duration="0"/&gt;</pre>
<p>Note that the path has been removed from the attribute in the IDLE_DISPLAY tag. Also note that in both cases, the filename extension is not specified &#8211; it is assumed to be .bmp (this catches out a lot of people too, it seems).</p>
<p>Fortunately, Polycom seems to have come to their senses a little bit, and removed this multi-frame, animated idle display feature in 3.3.x series firmware, and made it a lot simpler to use. With the 3.3.x firmware you can simply do something like this:</p>
<pre>&lt;bitmap.idleDisplay bitmap.idleDisplay.name="http://192.0.2.1/polycom/ip600.bmp"/&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2011/07/the-mystery-of-the-disappearing-polycom-idle-logo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When coding with Lua, remember to think like a lunatic&#8230;</title>
		<link>http://blog.pressure.net.nz/2011/04/when-coding-with-lua-remember-to-think-like-a-lunatic/</link>
		<comments>http://blog.pressure.net.nz/2011/04/when-coding-with-lua-remember-to-think-like-a-lunatic/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 11:49:22 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[lua]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=61</guid>
		<description><![CDATA[I recently experienced some strange behaviour from a Lua script I wrote to dynamically generate an XML string for a FreeSWITCH directory user, which used the string.format() function to populate a format string with values returned from an ODBC database connection. Being used to Python (and many other scripting languages), I assumed that an empty [...]]]></description>
			<content:encoded><![CDATA[<p>I recently experienced some strange behaviour from a Lua script I wrote to dynamically generate an XML string for a FreeSWITCH directory user, which used the string.format() function to populate a format string with values returned from an ODBC database connection. Being used to Python (and many other scripting languages), I assumed that an empty string would be evaluated to false, if used in a conditional expression. Not so with Lua&#8230;.</p>
<p>From the Lua 5.1 reference manual:</p>
<blockquote><p>The condition expression of a control structure can return any value. Both <strong>false</strong> and <strong>nil</strong> are considered false. All values different from <strong>nil</strong> and <strong>false</strong> are considered true (in particular, the number 0 and the empty string are also true).</p></blockquote>
<p>You learn something new every day&#8230;</p>
<p>PS: No, this is not an April Fools&#8217; joke&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2011/04/when-coding-with-lua-remember-to-think-like-a-lunatic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog updates</title>
		<link>http://blog.pressure.net.nz/2010/12/blog-updates/</link>
		<comments>http://blog.pressure.net.nz/2010/12/blog-updates/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 11:57:06 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=57</guid>
		<description><![CDATA[So it&#8217;s been a while since I&#8217;ve posted anything here. That&#8217;s ok, I&#8217;m not a hardcore blogger, and my life does not revolve around writing stuff for other people to read and comment on. I have however just installed a reCAPTCHA plugin for new user registration here, after growing tired of bogus user registrations from [...]]]></description>
			<content:encoded><![CDATA[<p>So it&#8217;s been a while since I&#8217;ve posted anything here. That&#8217;s ok, I&#8217;m not a hardcore blogger, and my life does not revolve around writing stuff for other people to read and comment on. I have however just installed a reCAPTCHA plugin for new user registration here, after growing tired of bogus user registrations from bots. I&#8217;ve cleaned up a lot of the half-completed registrations (the ones that never responded to the confirmation generated), so I apologise if I have accidentally deleted your account. Please do re-register if that is the case.</p>
<p>I also fixed a problem with the .htaccess file that was preventing mod_rewrite from working as it should, and making some pages unreachable. I promise to keep a closer watch on things in future, and (shock horror) maybe actually write posts a bit more frequently.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2010/12/blog-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exporting a X.509 certificate public key from Junos</title>
		<link>http://blog.pressure.net.nz/2010/07/exporting-a-x-509-certificate-public-key-from-junos/</link>
		<comments>http://blog.pressure.net.nz/2010/07/exporting-a-x-509-certificate-public-key-from-junos/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:14:08 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Juniper]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=39</guid>
		<description><![CDATA[I&#8217;ve just spent the last couple of hours trying to find a way to export the public key from a locally generated, self-signed X.509 certificate on a Juniper SRX-100 firewall. Apparently there is no Junos CLI command to do this, so after poking around the filesystem from a shell on the box, I found the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just spent the last couple of hours trying to find a way to export the public key from a locally generated, self-signed X.509 certificate on a Juniper SRX-100 firewall. Apparently there is no Junos CLI command to do this, so after poking around the filesystem from a shell on the box, I found the location where Junos stores local certificates and key-pairs.</p>
<p>In the directory <code>/cf/var/db/certs/common</code> you should see at least the following two subdirectories:</p>
<blockquote><p><code>drwx------  2 root  wheel  512 Jul 20 16:14 key-pair<br />
drwx------  2 root  wheel  512 Jul 20 16:16 local</code></p></blockquote>
<p>In the <code>key-pair</code> directory you should see files for each of your key-pairs, eg. <code>self-cert.priv</code>. In the <code>local</code> directory you will find the actual certificates, eg. <code>self-cert.cert</code>. Both the key-pairs and certificates are stored in binary DER format, which can be read by OpenSSL and converted to the more universal base64-encoded PEM format.</p>
<p>Private keys should really be left alone where they are on the Juniper, but you can safely copy the certificate to other locations, since it does not contain any private key material. Simply scp the certificate file to somewhere that has the OpenSSL tools installed, then use &#8220;<code>openssl x509</code>&#8221; to read the certificate:</p>
<blockquote><p><code>daniel@thinkpad:~$ openssl x509 -in self-cert.cert -inform DER<br />
-----BEGIN CERTIFICATE-----<br />
MIIDSDCCAjCgAwIBAgIRAKybOo9tijNXkhgT9fe0ZFMwDQYJKoZIhvcNAQEFBQAw<br />
TzELMAkGA1UEBhMCREUxJTAjBgNVBAoTHFNldmVudGggU2lnbmFsIEx0ZC4gJiBD<br />
.....<br />
co9vOYXqYv81xnIxg5I0brLqCzruKULy4zc6YHzJAGICMOw2wS9BwRkQUR1B2EZH<br />
2QWUSn4Enj2JJkT3p044U8/q4BKdJ9V52mxQfA==<br />
-----END CERTIFICATE-----</code></p></blockquote>
<p>There you have it folks&#8230; a base64-encoded PEM-format public certificate.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2010/07/exporting-a-x-509-certificate-public-key-from-junos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco QoS Exam</title>
		<link>http://blog.pressure.net.nz/2009/07/cisco-qos-exam/</link>
		<comments>http://blog.pressure.net.nz/2009/07/cisco-qos-exam/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 18:11:46 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[exam]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=30</guid>
		<description><![CDATA[My CCNP was due to expire in August, so I needed to pass any 642-* exam to renew it. I decided to sit the Cisco QoS exam (642-642), since it was one of two remaining exams I need to become CCIP. After a few weeks of study on and off, I&#8217;m pleased to say I [...]]]></description>
			<content:encoded><![CDATA[<p>My CCNP was due to expire in August, so I needed to pass any 642-* exam to renew it. I decided to sit the Cisco QoS exam (642-642), since it was one of two remaining exams I need to become CCIP. After a few weeks of study on and off, I&#8217;m pleased to say I passed the exam without much effort, thus renewing my CCNP for another three years. If I sit the BGP+MPLS exam next (642-691) I&#8217;ll also finally have CCIP, which should be a nice stepping stone along the way to CCIE.</p>
<p>Unfortunately my current job doesn&#8217;t really put my Cisco expertise to much use, which makes it a bit harder to keep the knowledge &#8220;fresh&#8221; in my head. That knowledge is also continually getting edged out by other things, such as OpenSolaris and all the daily, run of the mill sysadmin stuff I do.</p>
<p>I think my skills are becoming a little bit too rounded, and it&#8217;s time to really specialise in something.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2009/07/cisco-qos-exam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco Wireless LAN Controllers and DHCP Option 43</title>
		<link>http://blog.pressure.net.nz/2009/01/cisco-wireless-lan-controllers-and-dhcp-option-43/</link>
		<comments>http://blog.pressure.net.nz/2009/01/cisco-wireless-lan-controllers-and-dhcp-option-43/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 17:47:51 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=19</guid>
		<description><![CDATA[I recently had to install a Cisco Wireless LAN Controller (2112, if you&#8217;re interested), and had the usual fun and games with getting it to properly understand DHCP Option 43. For the uninitiated, option 43 is a vendor specific option, which, in the case of Cisco WLCs, is/are the manager IP address(es) of controllers that [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to install a Cisco Wireless LAN Controller (2112, if you&#8217;re interested), and had the usual fun and games with getting it to properly understand DHCP Option 43. For the uninitiated, option 43 is a vendor specific option, which, in the case of Cisco WLCs, is/are the manager IP address(es) of controllers that LWAPP access points should attempt to join when they boot up.</p>
<p>Different model APs require this option to be in different formats. For example, Aironet 1000 units require the option response to be type 0&#215;66, and a comma-separated ASCII list of controller IP addresses, whereas Aironet 1130, 1200, 1230 and 1240 units require the response to be type 0xF1, followed by the length (number of addresses x four), then the hexadecimal representation of the controller IP address(es).</p>
<p>Cisco <a href="http://www.cisco.com/en/US/tech/tk722/tk809/technologies_configuration_example09186a00808714fe.shtml">documentation exists</a> for this, however their documentation for ISC&#8217;s dhcpd is incorrect. Unlike most corporate customers I run into, who run Microsoft DHCP server (for better or worse), this particular customer was running ISC&#8217;s dhcpd.</p>
<p>The first step is setting the option 43 type. I&#8217;m going to concentrate on the 1130, 1200, 1230 and 1240 units here, since this is the area where Cisco&#8217;s documentation is incorrect. I&#8217;m going to follow Cisco&#8217;s documentation here.</p>
<blockquote><p><code>option space LWAPP;<br />
option LWAPP.controller code 43 = string;</code></p></blockquote>
<p>Then we have a vendor class, for the 1200 series units:</p>
<blockquote><p><code>class "Cisco AP c1200" {<br />
match if option vendor−class−identifier = "Cisco AP c1200";<br />
option vendor−class−identifier "Cisco AP c1200";<br />
vendor−option−space LWAPP;<br />
option LWAPP.controller f1:04:c0:a8:f7:05;<br />
}</code></p></blockquote>
<p>Note the &#8220;f1:04&#8243; at the start of the string. This means type 0xF1, followed by four bytes of vendor specific data. The &#8220;c0:a8:f7:05&#8243; is the hexadecimal representation of the IP address 192.168.247.5. This results in dhcpd transmitting &#8220;2b 08 2b 06 f1 04 c0 a8 f7 05&#8243; for option 43.</p>
<p><a href="http://blog.pressure.net.nz/wp-content/uploads/2009/01/option-43-cap1.png"><img class="aligncenter size-full wp-image-20" title="option 43 capture 1" src="http://blog.pressure.net.nz/wp-content/uploads/2009/01/option-43-cap1.png" alt="" width="612" height="188" /></a></p>
<p>Ok, let&#8217;s take a look at this string. The &#8220;2b&#8221; indicates this is a vendor encapsulated options field (type 43), and &#8220;08&#8243; means it&#8217;s eight bytes long. The next &#8220;2b&#8221; is where things start to go wrong. This is because the Cisco documentation told us to define LWAPP.controller as type 43 also, which is incorrect. The &#8220;06&#8243; indicates that six bytes follow for this sub-code, and then we have our &#8220;f1 04 c0 a8 f7 05&#8243; string verbatim. This causes the WLC to report an error parsing the option 43, saying that it cannot parse &#8220;2b 06 f1 04 c0 a8 f7 05&#8243;.</p>
<p>What we should have configured in dhcpd.conf is actually:</p>
<blockquote><p><code>option space LWAPP;<br />
option LWAPP.controller code 241 = string;</code></p>
<p><code>class "Cisco AP c1200" {<br />
match if option vendor−class−identifier = "Cisco AP c1200";<br />
option vendor−class−identifier "Cisco AP c1200";<br />
vendor−option−space LWAPP;<br />
option LWAPP.controller c0:a8:f7:05;<br />
}</code></p></blockquote>
<p>Note that we also dropped the &#8220;f1:04&#8243; from the hex string, since we are now correctly specifying LWAPP.controller as code 241 (0xF1), and dhcpd automatically populates the &#8220;04&#8243; for us, after counting the length of our hex string (four bytes = one IP address). This results in dhcpd sending &#8220;2b 06 f1 04 c0 a8 f7 05&#8243;.</p>
<p><a href="http://blog.pressure.net.nz/wp-content/uploads/2009/01/option-43-cap2.png"><img class="aligncenter size-full wp-image-23" title="option 43 capture 2" src="http://blog.pressure.net.nz/wp-content/uploads/2009/01/option-43-cap2.png" alt="" width="612" height="188" /></a></p>
<p>Again we have our &#8220;2b&#8221;, indicating vendor encapsulated options, but this time the field is only six bytes long. Then we have &#8220;f1 04&#8243;, indicating our LWAPP.controller code, with four bytes of data &#8211; our controller IP address. This time around, the AP will correctly see the option 43 &#8220;payload&#8221; of just &#8220;f1 04 c0 a8 f7 05&#8243;, and correctly parse the sub-option 0xF1.</p>
<p>Of course, what this field really is (and this is more clearly detailed in Cisco&#8217;s instructions for configuring Microsoft DHCP server), is an array of IP addresses. You can eliminate the need to specify the addresses in hexadecimal by defining the LWAPP.controller as:</p>
<blockquote><p><code>option LWAPP.controller code 241 = array of ip-address;</code></p></blockquote>
<p>and then simply listing your controller IP addresses:</p>
<blockquote><p><code>option LWAPP.controller 192.168.247.5, 192.168.247.6;</code></p></blockquote>
<p>This would result in dhcp server sending &#8220;2b 0a f1 08 c0 a8 f7 05 c0 a8 f7 06&#8243;. Note the &#8220;f1 04&#8243; changed to &#8220;f1 08&#8243;, since the array length is now eight bytes (two IP addresses).</p>
<p>Why Cisco didn&#8217;t simply publish this, is beyond me. They&#8217;ve made it very confusing for users who don&#8217;t understand DHCP vendor specific information. I suspect the person who wrote the dhcpd section of the Cisco documentation didn&#8217;t fully understand how ISC dhcpd handles vendor specific options.</p>
<p>In any case, our configuration can be made somewhat clearer, and consistent with dhcpd&#8217;s documentation, as follows:</p>
<blockquote><p><code>option space LWAPP;<br />
option LWAPP.controller code 241 = array of ip-address;</code></p>
<p><code>class "LWAPP" {<br />
match option vendor-class-identifier;<br />
}</code></p>
<p><code>subclass "LWAPP" "Cisco AP c1200" {<br />
vendor-option-space LWAPP;<br />
option LWAPP.controller 192.168.247.5;<br />
}</code></p></blockquote>
<p>For each additional type of AP you have to support, just add another subclass, using the appropriate vendor class identifier string.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2009/01/cisco-wireless-lan-controllers-and-dhcp-option-43/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Amazing Unmanaged Trunk Mode Switch</title>
		<link>http://blog.pressure.net.nz/2008/11/the-amazing-unmanaged-trunk-mode-switch/</link>
		<comments>http://blog.pressure.net.nz/2008/11/the-amazing-unmanaged-trunk-mode-switch/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 11:43:26 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Juniper]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=18</guid>
		<description><![CDATA[Have you ever needed to set up a bunch of equipment on a boardroom table or some other temporary location, and needed both native and 802.1q tagged VLANs, but only had one available switchport? A quick n&#8217; dirty solution is to use an unmanaged switch, such as one of the numerous 8-port desktop switches from [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever needed to set up a bunch of equipment on a boardroom table or some other temporary location, and needed both native and 802.1q tagged VLANs, but only had one available switchport?</p>
<p>A quick n&#8217; dirty solution is to use an unmanaged switch, such as one of the numerous 8-port desktop switches from manufacturers such as D-Link, Netgear, Linksys etc. Configure its upstream switchport as a trunk port, thus allowing your required VLANs to pass tagged frames to your unmanaged desktop switch.</p>
<p>Wait a second, you say&#8230;. unmanaged switches can&#8217;t do trunk ports. How can an unmanaged switch understand VLAN frames?</p>
<p>It doesn&#8217;t need to. What is an 802.1q tagged frame, other than a standard 802.3 ethernet frame with four additional bytes inserted? These four additional bytes are the 802.1q VLAN ID field and 802.1p CoS field. As long as the unmanaged switch does not truncate frames to the 802.3 standard 1518 bytes, it will happily forward the 1522-byte 802.1q tagged frames just like any other. The last time I encountered a switch that would <strong>not</strong> forward these slightly &#8220;oversized&#8221; frames, was about four years ago&#8230; and it was a very cheap and nasty brand (name withheld to protect the <span style="text-decoration: line-through;">innocent</span> guilty).</p>
<p>This trick also comes in handy when you have a user with a two-port VoIP phone (such as most Cisco, Snom, Polycom etc phones), using a voice-VLAN, and the user requires more switchports than are currently available at his/her desk. Simply connect the 8-port unmanaged switch before the IP phone (ie. to the upstream port), and connect the IP phone to the unmanaged switch. The phone still gets its tagged voice-VLAN frames, the PC gets its untagged data-VLAN frames (tag-stripped if necessary by the IP phone), and the user has 6 other ports available to connect whatever&#8230; including, if necessary, other VLANs (so long as they&#8217;re tagged, and the end device can work with tagged frames, since the unmanaged switch won&#8217;t strip the 802.1q tag).</p>
<p>Beware though, this should only ever be used as a temporary measure, since it does open a few security holes. If the &#8220;allowed VLANs&#8221; is not carefully configured on the upstream port, the opportunity exists to VLAN-hop, or flood traffic into other VLANs. And of course, since the unmanaged switch is, well, unmanaged, there is no individual &#8220;allowed VLANs&#8221; security on those 8 ports. All ports are effectively the same as that one upstream trunk port.</p>
<p>Have you used this method before? What brand/model unmanaged switch did you use? What were your experiences with it, and did you encounter any problems?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2008/11/the-amazing-unmanaged-trunk-mode-switch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Der Wahnsinn der Ausländerbehörde</title>
		<link>http://blog.pressure.net.nz/2008/09/der-wahnsinn-der-auslanderbehorde/</link>
		<comments>http://blog.pressure.net.nz/2008/09/der-wahnsinn-der-auslanderbehorde/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 22:18:41 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Travel]]></category>
		<category><![CDATA[germany]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=17</guid>
		<description><![CDATA[I&#8217;ve had a job offer since approximately the middle of August, with a German network consultancy firm. At first, the contract specified a start date of September 1st, but that was postponed because I didn&#8217;t yet have a work visa (or Arbeitserlaubnis, in German), until October 1st. With that date rapidly approaching, I still don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a job offer since approximately the middle of August, with a German network consultancy firm. At first, the contract specified a start date of September 1st, but that was postponed because I didn&#8217;t yet have a work visa (or Arbeitserlaubnis, in German), until October 1st. With that date rapidly approaching, I still don&#8217;t have a work visa. In fighting the neverending red tape, I&#8217;ve wasted numerous hours of my life queueing, sitting in waiting rooms, or otherwise just growing old at the Ausländerbehörde.</p>
<p>It was so much simpler in Russia, even though I had to travel to Estonia (twice) to get a temporary tourist visa, and eventually a business visa. At least in Russia, there was always a good chance you could expedite the process by offering a nice bottle of vodka (or a big cake, in the case of women officials). No such chance in Germany, and I dread to think of the consequences if one tried this little stunt.</p>
<p>In a little over two weeks, if I still don&#8217;t have a work visa, I&#8217;ll be planning my exit from Germany &#8211; not by choice, but because my current residency visa expires on October 31, and can&#8217;t be extended. Super&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2008/09/der-wahnsinn-der-auslanderbehorde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrieving NetScreen/SSG config via scp</title>
		<link>http://blog.pressure.net.nz/2008/07/retrieving-netscreenssg-config-via-scp/</link>
		<comments>http://blog.pressure.net.nz/2008/07/retrieving-netscreenssg-config-via-scp/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 14:27:19 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Juniper]]></category>

		<guid isPermaLink="false">http://blog.pressure.net.nz/?p=16</guid>
		<description><![CDATA[There are a couple of prerequisites before you can copy the config from a NetScreen or SSG via scp. First, obviously ssh and scp need to be enabled: set ssh version v2 set ssh enable set scp enable And of course, you need to enable ssh management on the interface you&#8217;re going to connect to [...]]]></description>
			<content:encoded><![CDATA[<p>There are a couple of prerequisites before you can copy the config from a NetScreen or SSG via scp. First, obviously ssh and scp need to be enabled:</p>
<blockquote><p><code>set ssh version v2<br />
set ssh enable<br />
set scp enable</code></p></blockquote>
<p>And of course, you need to enable ssh management on the interface you&#8217;re going to connect to the device on:</p>
<blockquote><p><code>set interface ethernet0 manage ssh</code></p></blockquote>
<p>Once that has been done, from your PC, try the following:</p>
<blockquote><p><code>scp netscreen@device-hostname:ns_sys_config ssg.cfg</code></p></blockquote>
<p>And you should then have a file called ssg.cfg in that directory. Once again, simple when you know how.</p>
<p>It is also possible to load RSA/DSA keys against ScreenOS usernames, so that password-less login for ssh/scp can be utilised, allowing this method to form the basis of automated config backups.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pressure.net.nz/2008/07/retrieving-netscreenssg-config-via-scp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

