{"id":248,"date":"2017-08-13T16:57:40","date_gmt":"2017-08-13T20:57:40","guid":{"rendered":"http:\/\/puluka.com\/home\/?p=248"},"modified":"2017-08-13T16:57:40","modified_gmt":"2017-08-13T20:57:40","slug":"junos-securing-oob-management-traffic","status":"publish","type":"post","link":"http:\/\/puluka.com\/home\/networking\/junos\/junos-securing-oob-management-traffic\/","title":{"rendered":"JUNOS Securing OOB Management Traffic"},"content":{"rendered":"<p><strong>Purpose<\/strong><br \/>\nMost JUNOS based equipment provides a dedicated management ethernet port to create a separate management network.\u00a0 This allows connection and management of the devices independent on the operation and access of the production network.\u00a0 This access does not prevent the remote access and management of the devices from the production network only provide the dedicated management network for access.\u00a0 This technique uses a firewall filter (stateless packet filters) to secure the device against access from the production network so that only management network access is permitted.<\/p>\n<p><strong>Solution<\/strong><br \/>\nJUNOS provides firewall filters to restrict access to interfaces.\u00a0 These are stateless packet filters and not flow based firewall rules.\u00a0 Once a filter is created and applied there is a default deny all rule as the final action for the filter.\u00a0 So all permitted options must be specified or the final rule in the filter must be an allow all rule.<\/p>\n<p>For the security of the device we need to create rules that allow only the management traffic from the management network and further rules that allow necessary routing information protocols from the production sources.\u00a0 To secure the routing engine firewall filters are applied to the loopback address.<\/p>\n<p>In this example the loopback address is 192.168.0.254 and the management network is 192.168.0.0\/24.<\/p>\n<p><strong><em>Firewall Filter Process<\/em><\/strong><br \/>\nUsing firewall filters is a two step process.\u00a0 The filter is created for general use in the firewall hierarchy.\u00a0 Then the filter is applied to the loopback interface at the interface hierarchy.<\/p>\n<p>This filter will block ssh and telnet from anywhere except the management network.\u00a0 But allow all other traffic to the routing engine.<\/p>\n<p>[edit firewall family inet]<br \/>\ndev@lab01# show<br \/>\nfilter mgmt-filter {<br \/>\nterm allow-mgmt{<br \/>\nfrom\u00a0 {<br \/>\nsource-address {<br \/>\n192.168.0.0\/24;<br \/>\n}<br \/>\n}<br \/>\nthen {<br \/>\naccept;<br \/>\n}<br \/>\n}<br \/>\nterm block-mgmt {<br \/>\nfrom\u00a0 {<br \/>\nprotocol\u00a0 tcp{<br \/>\ndestination-port [ ssh telent ];<br \/>\n}<br \/>\n}<br \/>\nthen {<br \/>\nreject;<br \/>\n}<br \/>\n}<br \/>\nterm accept-traffic {<br \/>\nthen accept;<br \/>\n}<br \/>\n}<\/p>\n<p><em><strong>Term \u201caccept-traffic\u201d options for routing engine traffic<\/strong><\/em><br \/>\nThe alternative to accepting all traffic is to specify in detail what protocols are actually used by this routing engine then only accepting this type of traffic.\u00a0 The default deny rule will then drop everything else.\u00a0 These are the items to add to the \u201caccept-traffic\u201d term stanza for specific protocols.\u00a0 Remember to only add those protocols needed from production.\u00a0 The first term already allows everything connecting from the management network.<\/p>\n<p>For this application add a from stanza to accept-traffic term and include all the protocols needed from the production side networks.<\/p>\n<p>Term accept-traffic {<br \/>\nfrom {<br \/>\nadd protocol list from table below<br \/>\n}<br \/>\nthen {<br \/>\naccept;<br \/>\n}<\/p>\n<table border=\"2\" width=\"55%\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td width=\"73%\">Term to add in filter<\/td>\n<td width=\"27%\">Protocol allowed<\/td>\n<\/tr>\n<tr>\n<td>protocol icmp;<br \/>\nicmp-type [ echo-request echo-reply time-exceeded unreachable ];<\/td>\n<td>Ping<\/td>\n<\/tr>\n<tr>\n<td>protocol udp;<br \/>\nttl 1;<\/td>\n<td>Traceroute<\/td>\n<\/tr>\n<tr>\n<td>\nprotocol udp;<br \/>\nsource-port 53;<\/td>\n<td>DNS<\/td>\n<\/tr>\n<tr>\n<td>protocol tcp;<br \/>\nsource-port bgp;<\/td>\n<td>BGP<\/td>\n<\/tr>\n<tr>\n<td>protocol ospf;<\/td>\n<td>OSPF<\/td>\n<\/tr>\n<tr>\n<td>protocol vrrp;<\/td>\n<td>VRRP<\/td>\n<\/tr>\n<tr>\n<td>protocol udp:<br \/>\nsource-port ntp;<\/td>\n<td>NTP<\/td>\n<\/tr>\n<tr>\n<td>\nprotocol udp;<br \/>\nsource-port [ snmp snmptrap ];<\/td>\n<td>SNMP<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Apply Firewall Filter to Loopback address<\/strong><br \/>\nThe firewall filter is applied to the input of the loopback address.<br \/>\ninterfaces {<br \/>\nlo0 {<br \/>\nunit 0 {<br \/>\nfamily inet {<br \/>\nfilter {<br \/>\ninput mgmt-filter;<br \/>\n}<br \/>\naddress 192.168.0.254\/24;<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p><strong>References<\/strong><\/p>\n<p><em><strong>JUNOS Documentation<\/strong><\/em><br \/>\nConfiguring the Junos OS the First Time on a Router with a Single Routing Engine<br \/>\n<a href=\"http:\/\/www.juniper.net\/techpubs\/en_US\/junos10.3\/topics\/task\/configuration\/routing-engine-single-initial-configuration.html\">Configure Router<\/a><\/p>\n<p>Connecting and Configuring an EX Series Switch (CLI Procedure)<br \/>\n<a href=\"http:\/\/www.juniper.net\/techpubs\/en_US\/release-independent\/junos\/topics\/task\/configuration\/ex-series-initial-configuration-setting-up-cli.html\">Configure EX Switch<\/a><\/p>\n<p>Configuring SSH Service for Remote Access to the Router or Switch<br \/>\n<a href=\"http:\/\/www.juniper.net\/techpubs\/en_US\/junos10.2\/topics\/task\/configuration\/ssh-services-configuring.html\">Configure SSH<\/a><\/p>\n<p>Loopback Interface Landing page<br \/>\n<a href=\"http:\/\/www.juniper.net\/techpubs\/en_US\/junos10.3\/information-products\/pathway-pages\/config-guide-network-interfaces\/loopback-interface.html\">Loopback Page<\/a><\/p>\n<p><em><strong>JUNOS as a second language course<\/strong><\/em><br \/>\nChapter 9: Firewall Filters<br \/>\n<a href=\"https:\/\/learningportal.juniper.net\/juniper\/resources\/courses\/ed_serv\/edu_jun_wbt_jsl_second\/index.html\">JUNOS as a Second Language<\/a><\/p>\n<p><em><strong>\u00a0Knowledge Base Articles<\/strong><\/em><\/p>\n<p>JUNOS: Securing routing engine for out-of-band management<\/p>\n<p><a href=\"http:\/\/kb.juniper.net\/InfoCenter\/index?page=content&amp;id=KB10880\">KB10880<\/a><\/p>\n<p>Firewall Filter on loopback interface<br \/>\n<a href=\"http:\/\/kb.juniper.net\/InfoCenter\/index?page=content&amp;id=KB12791\">KB12791<\/a><\/p>\n<p>Originally Posted December 05, 2010<br \/>\nLast Revised on May 28, 2011<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Purpose Most JUNOS based equipment provides a dedicated management ethernet port to create a separate management network.\u00a0 This allows connection and management of the devices independent on the operation and access of the production network.\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-248","post","type-post","status-publish","format-standard","hentry","category-junos"],"_links":{"self":[{"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/posts\/248","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=248"}],"version-history":[{"count":1,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/posts\/248\/revisions"}],"predecessor-version":[{"id":249,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/posts\/248\/revisions\/249"}],"wp:attachment":[{"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/media?parent=248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/categories?post=248"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/puluka.com\/home\/wp-json\/wp\/v2\/tags?post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}