{"id":2458,"date":"2012-09-29T16:59:56","date_gmt":"2012-09-29T16:59:56","guid":{"rendered":"http:\/\/really.zonky.org\/?p=2458"},"modified":"2012-10-10T20:44:01","modified_gmt":"2012-10-10T20:44:01","slug":"adventures-in-cisco-ios-land-ipv6","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=2458","title":{"rendered":"Adventures in Cisco IOS Land: IPv6"},"content":{"rendered":"<p>Just like previously, please <a href=\"http:\/\/really.zonky.org\/?p=1542\">read the disclaimer<\/a>before proceeding; I ain&#8217;t no CCIE! Several points before diving off into the configuration :-<\/p>\n<ol>\n<li>Somewhat surprisingly, the most difficult part of getting IPv6 up and running was not the configuration nor the process of switching ISP to one that supported native IPv6. The most difficult part was acquiring a version of IOS that was not riddled with bugs related to (I think) running IPv6 over PPP. If you are undertaking this task, I would suggest making sure you have a\u00a0<em>very<\/em> recent version of IOS &#8211; the one I am now running was released in July 2012.<\/li>\n<li>If you need a UK ISP that supports IPv6 for customers, I would suggest <a href=\"http:\/\/www.aa.net.uk\/\">AAISP<\/a>.<\/li>\n<li>Throughout this document, I am using the IPv6 documentation network\u00a0<em>2001:db8\/32<\/em>, or more specifically\u00a0<em>2001:db8:face\/48<\/em>. That doesn&#8217;t guarantee that I know what I&#8217;m talking about, but at least it doesn&#8217;t guarantee that I know nothing \u2026 as would be the case if I were using some random real IPv6 address.<\/li>\n<li>None of the following should interfere with anything you might be doing with IPv4. With the exception of times when I reloaded the router out of frustration, and occasionally to load a new firmware, my IPv4 connectivity was up and running continuously.<\/li>\n<\/ol>\n<p>Before starting you need an IPv6 address to configure; unless you have a large internal network it doesn&#8217;t make sense to start playing with a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Unique_local_address\">ULA<\/a> address. So get an allocation from your ISP. If you have a half-reasonable ISP, they will allocate you something like\u00a0<em>2001:db8:face\/48<\/em> which will give you 65536 different subnets to play with &#8211; perhaps\u00a0<em>slightly<\/em>over the top for a home network! To start with, you need to configure the router itself to enable IPv6 :-<\/p>\n<pre>ipv6 source-route\r\nipv6 general-prefix MYISP 2001:db8:face::\/48\r\nipv6 unicast-routing\r\nipv6 cef<\/pre>\n<p>This basically enables IPv6 routing (with no routing protocols &#8211; only static and learnt routes) and configures a &#8220;general prefix&#8221; with the network details of what your ISP has provided you with. This can be used later to configure addresses in a way that means that changing ISP isn&#8217;t quite so painful, and in a way that is less error prone &#8211; typing in IPv6 addresses is a lot more prone to typos than IPv4 addresses. Once that is done, it is time to look at IPv6 security \u2026 normally people suggest getting everything working first, but as I am more of a security geek than a networking geek, I would suggest security comes first. This is not a great deal different to IPv4 security except that forgetting about NAT makes things simpler :-<\/p>\n<pre>ipv6 inspect routing-header\r\nipv6 inspect name ipv6-allowed-out icmp\r\nipv6 inspect name ipv6-allowed-out tcp\r\nipv6 inspect name ipv6-allowed-out udp\r\nipv6 inspect name ipv6-allowed-out ftp<\/pre>\n<p>This basically defines what traffic is allowed out (assuming it&#8217;s applied appropriately to an interface). Nothing really odd here \u2026 basically everything is allowed out, and I ask the router to inspect for routing information that might be available. The next bit is the incoming ACL :-<\/p>\n<pre>ipv6 access-list access-to-servers\r\n permit icmp any any\r\n permit tcp any host 2001:db8:face:f00d::c0:ffee eq 22\r\n deny ipv6 any any log<\/pre>\n<p>Several key points about this ACL :-<\/p>\n<ol>\n<li>All IPv6 ACLs are &#8220;extended&#8221;.<\/li>\n<li>All IPv6 ACLs are named rather than numbered.<\/li>\n<li>The ICMP bit looks a little permissive, but ICMP is <em>very<\/em> much more required for a functioning IPv6 network than an IPv4 network. It can be tuned down somewhat, but you <em>need<\/em> ICMP for your network to work.<\/li>\n<li>The rule that allows access to my server on port 22 does not allow the use of the previously defined general-prefix. Come on Cisco, do the right thing here!<\/li>\n<\/ol>\n<p>And another ACL for access to the router&#8217;s SSH port :-<\/p>\n<pre>ipv6 access-list authorised-v6\r\n permit ipv6 2001:db8:face::\/48 any\r\n deny ipv6 any any<\/pre>\n<p>And we might as well apply that last ACL right away :-<\/p>\n<pre>line vty 0 4\r\n\u00a0 ipv6 access-class authorised-v6 in<\/pre>\n<p>Now we have the basics ready, we can start to configure interfaces. Before you start, it is worth figuring out what network addresses to use. IPv6 does of course allow the possibility of using wildly inappropriate <a href=\"http:\/\/en.wikipedia.org\/wiki\/Hexspeak\">hexspell<\/a> words as network address, or you could be very sensible and come up with an appropriate allocation scheme. \u00a0For larger networks, it is well worth reserving a large swathe of networks (such as 0000-7ffff) for someone to come along later to create a &#8220;better&#8221; scheme \u2026 as somebody who has dealt with a large IPv4 network where the original allocation scheme was somewhat suboptimal, I firmly believe that later network administrators should have the freedom to change the scheme in the light of more experience. You will often encounter the assumption that the host part of a network is\u00a0<em>always<\/em> 64 bits (or the network mask is always \/64). Whilst this is not a requirement at all, there are popular features of IPv6 that only work on a network that size such as address auto-configuration (<a href=\"http:\/\/en.wikipedia.org\/wiki\/SLAAC#Stateless_address_autoconfiguration_.28SLAAC.29\">SLAAC<\/a>). In practice this means that you should always create networks with a \/64 netmask, unless you have a\u00a0<em>very<\/em> good reason not to (for instance when configuring statically configured links between routers). Even if you have no intention of allowing address auto-configuration. As a minimum, you will need two networks &#8211; one for the external interface, and one for the internal interface(s). As you may have guessed, we have already specified what the internal network is: <em>2001:db8:face:f00d\/64<\/em>, and I will use <em>2001:db8:face:1ced\/64<\/em>as the external interface. The first interface to configure is the internal network :-<\/p>\n<pre>interface Vlan101\r\n ipv6 address MYISP 0:0:0:F00D::1\/64\r\n ipv6 enable \r\n ipv6 nd prefix 2001:db8:face:f00d::1\/61\r\n ipv6 nd router-preference High<\/pre>\n<p>The command to give the network and the interface an address requires a little explanation. First of all, we&#8217;re lucky enough to be able to use the &#8220;general-prefix&#8221; that we defined earlier. This &#8220;general-prefix&#8221; is merged with the unusual looking address that follows it :-<\/p>\n<table>\n<tbody>\n<tr>\n<td>MYISP general-prefix<\/td>\n<td>2001<\/td>\n<td>db8<\/td>\n<td>face<\/td>\n<\/tr>\n<tr>\n<td>Address to merge<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>F00D::1\/64<\/td>\n<\/tr>\n<tr>\n<td>Result<\/td>\n<td>2001<\/td>\n<td>db8<\/td>\n<td>face<\/td>\n<td>F00D::1\/64<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This provides the interface with an address.\u00a0The next command simply enables IPv6 on the interface. The\u00a0<em>ipv6 nd prefix<\/em> command tells the router what &#8220;prefix&#8221; to advertise to clients wishing to autoconfigure (using SLAAC).<\/p>\n<blockquote><p>As an aside, the whole topic of managing IPv6 addresses on clients is worth an article on its own &#8211; auto-configuration sounds like a good option (and indeed may be a good choice), but there are situations where you would prefer to not allow auto-configuration. And not all clients work equally well with all options.<\/p><\/blockquote>\n<p>The next command (<em>ipv6 nd router-preference High<\/em>) is a weak attempt to guard against false Router\u00a0Advertisement\u00a0messages &#8211; advertising this router as a High preference one\u00a0<em>may<\/em> prioritise it&#8217;s use over any other mysterious routers that appear on this network. In practice, it is necessary to block RA messages from non-router ports using a switch feature such as\u00a0<a href=\"http:\/\/www.insinuator.net\/2011\/03\/ipv6-security-part-2-ra-guard-%E2%80%93-lets-get-practical\/\"><em>ipv6 nd raguard<\/em><\/a>. Once this interface is configured, you may well start to see IPv6 hosts with the command\u00a0<em>show ipv6 neighbours<\/em>. And onto the configuration of the outside interface :-<\/p>\n<pre>interface Dialer0\r\n ipv6 address MYISP ::1ced:0:0:0:1\/64\r\n ipv6 enable\r\n no ipv6 nd ra suppress\r\n ipv6 inspect ipv6-allowed-out out\r\n ipv6 traffic-filter access-to-servers in\r\n ipv6 virtual-reassembly in<\/pre>\n<p>This starts off in much the same way as the previous interface configuration, but in this case I also :-<\/p>\n<ol>\n<li>Explicitly enable RA messages on the interface with <em>no ipv6 nd ra suppress<\/em>. This is to ensure that the RA messages get out to the ISP&#8217;s router on the &#8220;other end&#8221;.<\/li>\n<li>Uses <em>ipv6 inspect ipv6-allowed-out out<\/em> so that IPv6 traffic is allowed out (and any associated packets are allowed back in again!).<\/li>\n<li>Uses <em>ipv6 traffic-filter access-to-servers in<\/em> to allow any unsolicited IPv6 traffic necessary in.<\/li>\n<li>Uses\u00a0<em>ipv6 virtual-reassembly in<\/em> to use Cisco&#8217;s VFR feature to protect against\u00a0fragmentation\u00a0attacks.<\/li>\n<\/ol>\n<p>Note that I have statically configured the address on this interface. Some ISPs require this, and some require that the interface is set to auto-configuration (<em>ipv6 address autoconfig<\/em> or\u00a0<em>ipv6 address dhcp<\/em>). The last step is to configure a default route :-<\/p>\n<pre>ipv6 route ::\/0 Dialer0<\/pre>\n<p>Some misconceptions I&#8217;ve come across through googling for tips and assistance :-<\/p>\n<ol>\n<li>There are plenty of examples which show internal interfaces configured with\u00a0<em>ipv6 nd prefix XXX<\/em> in addition to the interface address. As far as I can see (and as demonstrated by my home network actually networking), there is no need to specify this prefix unless you are advertising multiple prefixes on an interface, or doing something even stranger.<\/li>\n<li>Examples often include\u00a0<em>ipv6 nd ra interval ${some-value}<\/em>, which as far as I can see is somewhat unnecessary except that the default value of 200s means that connected hosts may take a while to spot the router.<\/li>\n<li>There are plenty of examples for setting up IPv6 with a tunnel within IPv4 where the IPv6 MTU is set to some value lower than the default such as\u00a0<em>ipv6 mtu 1280<\/em>. Tuning the MTU for native IPv6 should not be necessary, and even if it is, the right value would be somewhat higher.<\/li>\n<\/ol>\n<p>And of course, if anyone believes I&#8217;ve done something wrong, please let me know!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just like previously, please read the disclaimerbefore proceeding; I ain&#8217;t no CCIE! Several points before diving off into the configuration :- Somewhat surprisingly, the most difficult part of getting IPv6 up and running was not the configuration nor the process of switching ISP to one that supported native IPv6. The most difficult part was acquiring <a href='https:\/\/really.zonky.org\/?p=2458' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[775],"tags":[776,1006],"class_list":["post-2458","post","type-post","status-publish","format-standard","hentry","category-cisco","tag-ios","tag-ipv6","category-775-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-DE","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/2458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2458"}],"version-history":[{"count":10,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/2458\/revisions"}],"predecessor-version":[{"id":2473,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/2458\/revisions\/2473"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}