{"id":272,"date":"2017-08-13T17:25:10","date_gmt":"2017-08-13T21:25:10","guid":{"rendered":"http:\/\/puluka.com\/home\/?p=272"},"modified":"2017-08-13T17:25:10","modified_gmt":"2017-08-13T21:25:10","slug":"screenos-dual-wan-with-ospf-on-two-sites","status":"publish","type":"post","link":"http:\/\/puluka.com\/home\/networking\/screenos\/screenos-dual-wan-with-ospf-on-two-sites\/","title":{"rendered":"ScreenOS \u2013 Dual WAN with OSPF on Two Sites"},"content":{"rendered":"<p><strong>Product<\/strong>: ScreenOS<br \/>\n<strong>Version<\/strong>: 6.0 and higher<\/p>\n<h2>Network Topology<\/h2>\n<p><a href=\"http:\/\/puluka.com\/home\/wp-content\/uploads\/2017\/08\/Dual-WAN-OSPF.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-273\" src=\"http:\/\/puluka.com\/home\/wp-content\/uploads\/2017\/08\/Dual-WAN-OSPF-300x186.jpg\" alt=\"\" width=\"300\" height=\"186\" srcset=\"http:\/\/puluka.com\/home\/wp-content\/uploads\/2017\/08\/Dual-WAN-OSPF-300x186.jpg 300w, http:\/\/puluka.com\/home\/wp-content\/uploads\/2017\/08\/Dual-WAN-OSPF-768x476.jpg 768w, http:\/\/puluka.com\/home\/wp-content\/uploads\/2017\/08\/Dual-WAN-OSPF-1024x635.jpg 1024w, http:\/\/puluka.com\/home\/wp-content\/uploads\/2017\/08\/Dual-WAN-OSPF.jpg 1213w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nTwo sites that each have redundant internet connections. This establishes two VPN tunnels and uses OSPF to set routing priorities over the tunnels to use the primary line.<\/p>\n<h2>Description:<\/h2>\n<p>Each site has two internet connections and interfaces that allow route based VPNs to exist at the same time. Using OSPF route priorities the primary line is in use unless this fails. When the first tunnel fails the second will automatically take over. On restoration of the first line route priorities automatically revert to the primary line.<\/p>\n<p>The process utilizes IPSEC VPN in route mode and OSPF.<\/p>\n<ol>\n<li>Create OSPF settings on the trust virtual router<\/li>\n<li>Assign the interfaces to the OSPF settings needed<\/li>\n<li>Create the IPSEC VPN gateway and connection<\/li>\n<\/ol>\n<h3>Zone Layout<\/h3>\n<p>untrust interface is ethernet0\/0<br \/>\ntrust interface is bgroup0<br \/>\ntunnel.1 interface is in trust zone<\/p>\n<p>This zone layout puts all sites and tunnels into the same security zone.\u00a0 No policies need to be created on any device for full communications across the entire hub and spoke network.\u00a0 This is assuming that intra zone blocking is NOT enabled on any of the firewalls for the trust zone.\u00a0 This is the default behavior for the trust zone. You can change the zone of the tunnel interface to untrust and create policies as needed to allow traffic..<\/p>\n<h2>Configuration:<\/h2>\n<p><strong>1. Create OSPF Settings <\/strong><\/p>\n<p>CLI<br \/>\nSet vr trust router-id 10.0.1.1 **Change to match LAN ip address on site B<br \/>\nset vr trust protocol ospf<br \/>\nset vr trust protocol ospf enable<br \/>\nset vr trust protocol ospf area 1 (** Change to area 2 on Site B)<\/p>\n<p>Web<br \/>\nNetwork \u2013 Virtual Routers \u2013 Trust-vr (select edit)<br \/>\nSet router id and hit apply<br \/>\nClick on \u201cCreate OSPF instance\u201d<br \/>\nCheck enable OSPF on bottom (not distribute default route) and apply<br \/>\nHit the Area Menu<br \/>\nCreate Area 1 on site A and Area 2 on Site B<\/p>\n<p><strong> 2. Assign OSPF settings to interfaces<\/strong><\/p>\n<p>Setup the bgroup0 LAN interface<\/p>\n<p>CLI<br \/>\nset interface bgroup0 protocol ospf area 1 (**Change area 2 on site B)<br \/>\nset interface bgroup0 protocol ospf enable<\/p>\n<p>WEB<br \/>\nNetwork \u2013 Interfaces \u2013 List<br \/>\nSelect bgroup0 edit button<br \/>\nSelect OSPF tab<br \/>\nCheck Bind to Area 1 (**Change area 2 on site B)<br \/>\nSelect Enable button<br \/>\nRemove reduce flooding default<br \/>\nApply<\/p>\n<p>Create and setup the tunnel interfaces for the VPN<\/p>\n<p>CLI<br \/>\nset interface tunnel.1 zone Trust<br \/>\nset interface tunnel.1 ip 10.0.0.2\/30 (** change ip address to 10.0.0.3 for site B)<br \/>\nset interface tunnel.1 protocol ospf area 0.0.0.0<br \/>\nset interface tunnel.1 protocol ospf enable<br \/>\nset interface tunnel.2 zone Trust<br \/>\nset interface tunnel.2 ip 10.0.0.5\/30 (**change ip address to 10.0.0.6 for site B)<br \/>\nset interface tunnel.2 protocol ospf area 0.0.0.0<br \/>\nset interface tunnel.2 protocol ospf enable<br \/>\nset interface tunnel.2 protocol ospf cost 20<\/p>\n<p>WEB<br \/>\nCreate tunnel.1 and tunnel.2 with these parameters<br \/>\nNetwork \u2013 Interfaces \u2013 List<br \/>\nNew Tunnel IF in upper right<br \/>\nTrust zone<br \/>\nUnnumbered<br \/>\nbgroup0 interface<br \/>\nOSPF tab<br \/>\nCheck Bind to Area 0<br \/>\nCheck enable<br \/>\nRemove demand circuit and reduce flooding<br \/>\nSet as Point-to-point<br \/>\nOn tunnel.2 raise the cost to 20<\/p>\n<p><strong>3. Create IPSEC VPN Gateways and connection <\/strong><\/p>\n<p>Gateways to remote site. Create two on each firewall and be sure to change the outgoing interface to the correct one for the primary and backup connections.<\/p>\n<p>CLI<br \/>\nFirewall Site A<br \/>\nset ike gateway SiteB1-GW address 2.2.2.2 Main outgoing-interface ethernet0\/0 preshare juniper sec-level standard<br \/>\nset ike gateway SiteB2-GW address 4.4.4.4 Main outgoing-interface ethernet0\/1 preshare juniper sec-level standard<\/p>\n<p>Firewall Site B<br \/>\nset ike gateway SiteA1-GW address 1.1.1.1 Main outgoing-interface ethernet0\/0 preshare juniper sec-level standard<br \/>\nset ike gateway SiteA2-GW address 3.3.3.3 Main outgoing-interface ethernet0\/1 preshare juniper sec-level standard<\/p>\n<p>Firewall Site A<\/p>\n<p>WEB<br \/>\nVPNs \u2013 AutoKey Advanced \u2013 Gateway<br \/>\nCreate new gateway<br \/>\nName SiteB1-GW (**Change to SiteB2-GW for secondary)<br \/>\nIP: 2.2.2.2 (**change to 4.4.4.4 for SiteB2-GW)<br \/>\nAdvanced button<br \/>\nPreshared key: juniper<br \/>\nOutgoing interface ethernet0\/0 (Change to ethernet 0\/1 for SiteB2-GW)<\/p>\n<p>Firewall Site B<br \/>\nVPNs \u2013 AutoKey Advanced \u2013 Gateway<br \/>\nCreate new gateway<br \/>\nName SiteA1-GW (**Change to SiteA2-GW for secondary)<br \/>\nIP: .1.1.1.1 (**change to 2.2.2.2 for SiteA2-GW)<br \/>\nAdvanced button<br \/>\nPreshared key: juniper<br \/>\nOutgoing interface ethernet0\/0 (Change to ethernet 0\/1 for SiteA2-GW)<br \/>\nCreate AutoKey IKE Objects<\/p>\n<p>Firewall Site A<\/p>\n<p>CLI<br \/>\nset vpn SiteB1 gateway SiteB1-GW sec-level standard<br \/>\nset vpn SiteB1 bind interface tunnel.1<br \/>\nset vpn SiteB2 gateway SiteB2-GW sec-level standard<br \/>\nset vpn SiteB2 bind interface tunnel.2<\/p>\n<p>WEB<br \/>\nVPNs \u2013 AutoKey IKE<br \/>\nCreate New<br \/>\nName SiteB1 (**change to SiteB2 for Secondary)<br \/>\nAssociated gateway SiteB1-GW (**change to SiteB2-GW for Secondary)<br \/>\nAdvanced button<br \/>\nTunnel interface tunnel.1 (**change to tunnel.2 for secondary)<\/p>\n<p>Firewall Site B<\/p>\n<p>CLI<br \/>\nset vpn SiteA1 gateway SiteA1-GW sec-level standard<br \/>\nset vpn SiteA1 bind interface tunnel.1<br \/>\nset vpn SiteA2 gateway SiteA2-GW sec-level standard<br \/>\nset vpn SiteA2 bind interface tunnel.2<\/p>\n<p>WEB<br \/>\nVPNs \u2013 AutoKey IKE<br \/>\nCreate New<br \/>\nName SiteA1 (**change to SiteA2 for Secondary)<br \/>\nAssociated gateway SiteA1-GW (**change to SiteA2-GW for Secondary)<br \/>\nAdvanced button<br \/>\nTunnel interface tunnel.1 (**change to tunnel.2 for secondary)<\/p>\n<h2>Verification:<\/h2>\n<p><strong>From Site B checking routes to Site A<\/strong><\/p>\n<p>Testing from Site B<br \/>\nUsing primary Connection<br \/>\nCheck OSPF connection status<br \/>\nVerify that both connections show the neighbor status<\/p>\n<p>get vr trust protocol ospf neighbor<\/p>\n<p>VR: trust-vr RouterId: 10.0.2.1<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nNeighbor(s) on interface tunnel.2 (Area 0.0.0.0)<br \/>\nIpAddr\/IfIndex RouterId Pri State Opt Up StateChg<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n10.0.0.5 10.0.1.1 1 Full E 00:09:47 (+6 -0)<br \/>\nNeighbor(s) on interface tunnel.1 (Area 0.0.0.0)<br \/>\nIpAddr\/IfIndex RouterId Pri State Opt Up StateChg<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n10.0.0.2 10.0.1.1 1 Full E 00:01:33 (+6 -0)<br \/>\nNeighbor(s) on interface bgroup0 (Area 0.0.0.2)<\/p>\n<p>get route protocol ospf<\/p>\n<p>IPv4 Dest-Routes for &lt;trust-vr&gt; (15 entries)<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nID IP-Prefix Interface Gateway P Pref Mtr Vsys<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n* 41 10.0.1.0\/24 tun.1 10.0.0.2 O 60 11 Root<br \/>\nTotal number of ospf routes: 1<\/p>\n<p><strong>During failover<\/strong><\/p>\n<p>get route protocol ospf<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nID IP-Prefix Interface Gateway P Pref Mtr Vsys<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n* 39 10.0.1.0\/24 tun.2 10.0.0.5 O 60 21 Root<br \/>\nTotal number of ospf routes: 1<\/p>\n<p>&nbsp;<\/p>\n<p>WEB<br \/>\nNetwork \u2013 Routing &#8211; Destination.<\/p>\n<h2>References:<\/h2>\n<p><strong>ScreenOS Concepts and Examples Guide<\/strong><br \/>\n<a href=\"http:\/\/www.juniper.net\/techpubs\/software\/screenos\/screenos6.2.0\/index.html\">http:\/\/www.juniper.net\/techpubs\/software\/screenos\/screenos6.2.0\/index.html<\/a><\/p>\n<h3>Route based VPN tunnels<\/h3>\n<p>Concepts &amp; Examples Guide<br \/>\nVolume 5 Virtual Private Networks<br \/>\nChapter 3 VPN Guidelines<br \/>\nChapter 4 VPN: Sit-to-site VPN Configurations<\/p>\n<h3>OSPF<\/h3>\n<p>Concepts &amp; Examples Guide<br \/>\nVolume 7 Routing<br \/>\nChapter 3<\/p>\n<p>Originally Posted June 04, 2011<br \/>\nLast Revised on June 04, 2011<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Product: ScreenOS Version: 6.0 and higher Network Topology Two sites that each have redundant internet connections. This establishes two VPN tunnels and uses OSPF to set routing priorities over the tunnels to use the primary [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-272","post","type-post","status-publish","format-standard","hentry","category-screenos"],"_links":{"self":[{"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/posts\/272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/comments?post=272"}],"version-history":[{"count":1,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/posts\/272\/revisions"}],"predecessor-version":[{"id":274,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/posts\/272\/revisions\/274"}],"wp:attachment":[{"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/media?parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/categories?post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/tags?post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}