<?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 &#187; Juniper</title>
	<atom:link href="http://blog.pressure.net.nz/category/juniper/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pressure.net.nz</link>
	<description>Cisco, Juniper, UNIX, and open source software in general</description>
	<lastBuildDate>Tue, 20 Jul 2010 21:02:26 +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>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>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 it&#8217;s 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>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>
