{"id":66,"date":"2017-02-03T15:40:42","date_gmt":"2017-02-03T15:40:42","guid":{"rendered":"http:\/\/coherence.co.za\/?page_id=66"},"modified":"2017-02-06T10:03:57","modified_gmt":"2017-02-06T10:03:57","slug":"blog","status":"publish","type":"page","link":"http:\/\/coherence.co.za\/?page_id=66","title":{"rendered":"Blog"},"content":{"rendered":"<div id=\"pl-66\"  class=\"panel-layout\" ><div id=\"pg-66-0\"  class=\"panel-grid panel-no-style\" ><div id=\"pgc-66-0-0\"  class=\"panel-grid-cell\" ><div id=\"panel-66-0-0-0\" class=\"so-panel widget widget_siteorigin-panels-postloop panel-first-child panel-last-child\" data-index=\"0\" >\n\n\t\t\n\t\t\n<article id=\"post-122\" class=\"post-122 post type-post status-publish format-standard hentry category-uncategorised tag-juniper tag-load-balancing tag-networking\">\n\n\t\n\t<div class=\"entry-main\">\n\n\t\t\n\t\t<header class=\"entry-header\">\n\t\t\t\n\t\t\t<h1 class=\"entry-title\"><a href=\"http:\/\/coherence.co.za\/?p=122\" title=\"Permalink to ECMP next hop on Juniper M T and SRX series routers\" rel=\"bookmark\">ECMP next hop on Juniper M T and SRX series routers<\/a><\/h1>\n\n\t\t\t\t\t\t\t<div class=\"entry-meta\">\n\t\t\t\t\tPosted on <a href=\"http:\/\/coherence.co.za\/?p=122\" title=\"12:55 am\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"2019-10-02T00:55:59+01:00\">2nd Oct 2019<\/time><\/a><time class=\"updated\" datetime=\"2019-10-02T10:11:24+01:00\">2nd Oct 2019<\/time> <span class=\"byline\"> by <span class=\"author vcard\"><a class=\"url fn n\" href=\"http:\/\/coherence.co.za\/?author=2\" title=\"View all posts by Enrico Zanolin\" rel=\"author\">Enrico Zanolin<\/a><\/span><\/span> \t\t\t\t<\/div><!-- .entry-meta -->\n\t\t\t\n\t\t<\/header><!-- .entry-header -->\n\n\t\t\t\t\t<div class=\"entry-content\">\n\t\t\t\t<p><img loading=\"lazy\" src=\"http:\/\/coherence.co.za\/wp-content\/uploads\/2019\/10\/path-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" class=\"alignright size-medium wp-image-124\" srcset=\"http:\/\/coherence.co.za\/wp-content\/uploads\/2019\/10\/path-300x225.jpg 300w, http:\/\/coherence.co.za\/wp-content\/uploads\/2019\/10\/path-768x576.jpg 768w, http:\/\/coherence.co.za\/wp-content\/uploads\/2019\/10\/path.jpg 960w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>If like me, you have to jump around customer requirements, you may one day find yourself in a situation where you need to utilise capacity on 2 or more links between locations. My preference is to bond my uplinks with 802.1ax\/802.3ad\/LACP and let the upstream provider deal with the rest. Sometimes the providers let you down and can do nothing. They cant run LACP from their edge device to you, and they can&#8217;t transit your LACP frames so that you can perform your own LACP between locations. Also sometimes you have multiple links for different providers.<\/p>\n<p>In this situation your last resort is Equal Cost Multi Path(ECMP) next hop. If you have a 2 or more routes in your routing table with exactly the same metrics and there are none that are more preferred, an ECMP decision is triggered. On Juniper routing platforms this is quite rudimentary in that one of the routes will be chosen (at random or based on src\/dst hashes) for a particular route and installed in the FIB (the hardware forwarding engine). This means that the effectiveness of the traffic spread is limited to the number of routes in your table in a particular direction.<\/p>\n<p>My typical implementation involves running OSPF between routers on each link with identical metrics. From the &#8220;remote&#8221; end of the network I do not aggregate the advertised prefixes, as this would reduce the pool of routes, and instead advertise all prefixes individually. This is often a whole bunch of \/32 point to point customer IP&#8217;s and this is also partially why I choose to use OSPF for this.<\/p>\n<p>Advertising from the core however is a bit more of a problem. Here typically you are advertising mainly the default route. There may be some peering routes that you have on either end and you may include those too, but typically you do not want to be sending a full table to some remote end of the network, as usually the reason you are here in the first place is that you are resource constrained.<\/p>\n<p>The practical upshot is that traffic will balance ok in the direction towards the &#8220;remote&#8221; node, but very little or not at all inbound from the &#8220;remote&#8221; node. Typically this is the &#8220;download&#8221; direction and usually the direction most of the load is in in any case, but our situation is not ideal.<\/p>\n<p>To achieve a better spread, and to not have to worry to much about how many routes you are using, you need to implement a policy on the forwarding table. I know it sounds like I made that up, but yes, thats a real thing. If you do not do this then your traffic spread\/diversity will be constrained by the points discussed above.<\/p>\n<p>So we create the policy..<\/p>\n<pre class=\"p1\"><span class=\"s1\">set policy-options policy-statement my-default-balancing-policy then load-balance consistent-hash<\/span><\/pre>\n<p>And then apply it to the forwarding table..<\/p>\n<pre class=\"p1\"><span class=\"s1\">set routing-options forwarding-table export\u00a0my-default-balancing-policy<\/span><\/pre>\n<p class=\"p1\">This will now let your traffic use all equal routes instead of just the selected one.<\/p>\n<p class=\"p1\">Your 2 balancing options are consistent-hash and per-packet. Per packet will send packets down each link in a round robin fashion and will result in nearly perfect load spread. However, this will cause out of order packet delivery between the sites as there will always be performance differences on the links which is why I never use it. The performance impact of out of order packets, on TCP specifically, is significant. The consistent-hash looks at\u00a0the traffic IP source, destination and protocol fields and uses those values to calculate which link to use. This is good at keeping traffic flows on one path and packet delivery consistent.<\/p>\n<p class=\"p1\">ECMP algorithm choice on the MX series platform is performed quite differently, but many of the points discussed above are still valid. This is to be expected as the MX is a routing and switching platform so hashing at multiple layers is possible (L2\/L3\/L4) There are many more options to consider and we will leave that for another time.<\/p>\n<p class=\"p1\">A final note, the above hash looks at L3 information as a key for hashing and on an MPLS enabled network this may not be enough. You can also set ECMP options for MPLS with the following statement.<\/p>\n<pre class=\"p1\"><span class=\"s1\">set chassis maximum-ecmp 16<\/span><\/pre>\n<p class=\"p1\">Options are 16\/32\/64 and allow for up to that many alternate LSP to load balance across (thats if you have multiple LSP&#8217;s to your destination).<\/p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><!-- .entry-content -->\n\t\t\n\t\t\n\t<\/div>\n\n<\/article><!-- #post-122 -->\n\n\t\n\t\t\n<article id=\"post-94\" class=\"post-94 post type-post status-publish format-standard hentry category-uncategorised tag-debian tag-raid tag-redundancy\">\n\n\t\n\t<div class=\"entry-main\">\n\n\t\t\n\t\t<header class=\"entry-header\">\n\t\t\t\n\t\t\t<h1 class=\"entry-title\"><a href=\"http:\/\/coherence.co.za\/?p=94\" title=\"Permalink to Monitoring HP G5 server hardware RAID on Debian\" rel=\"bookmark\">Monitoring HP G5 server hardware RAID on Debian<\/a><\/h1>\n\n\t\t\t\t\t\t\t<div class=\"entry-meta\">\n\t\t\t\t\tPosted on <a href=\"http:\/\/coherence.co.za\/?p=94\" title=\"8:11 pm\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"2017-02-07T20:11:36+00:00\">7th Feb 2017<\/time><\/a><time class=\"updated\" datetime=\"2017-02-07T20:54:43+00:00\">7th Feb 2017<\/time> <span class=\"byline\"> by <span class=\"author vcard\"><a class=\"url fn n\" href=\"http:\/\/coherence.co.za\/?author=2\" title=\"View all posts by Enrico Zanolin\" rel=\"author\">Enrico Zanolin<\/a><\/span><\/span> \t\t\t\t<\/div><!-- .entry-meta -->\n\t\t\t\n\t\t<\/header><!-- .entry-header -->\n\n\t\t\t\t\t<div class=\"entry-content\">\n\t\t\t\t<p>Personally I prefer to use Linux MDADM software raid because of the following factors<\/p>\n<ul>\n<li>Homogenous set of utilities, always the same, unlike all the different custom utils from all the many hardware vendors.<\/li>\n<li>Long term support for the platform.<\/li>\n<li>Proven performance and stability.<\/li>\n<li>Cheaper RAID cards use the CPU in any case and the MDADM implementation will blow it out the water for features\/performance.<\/li>\n<li>Ability to run any type of RAID level unlike most hardware which\u00a0usually only support 0,1 and 0+1.<\/li>\n<\/ul>\n<p>But some times you get a system with decent dedicated controllers with cache and battery backup and you want to be able to offload to it. This is what was in my G5 system<\/p>\n<pre>\r\nlspci -nn\r\n06:00.0 RAID bus controller [0104]: Hewlett-Packard Company Smart Array Controller [103c:3230] (rev 04)\r\n<\/pre>\n<p>Googling &#8220;pciid 103c:3230&#8221; quickly yielded that I was dealing with a &#8220;HP Smart Array P400i&#8221; card<\/p>\n<p>Now while the card is supported by the OS out of the box an I can see any array that I created in the BIOS, the problem that I sit with is that I need to be able to monitor the disks for failure and issue rebuild commands without taking the system down. Trying to get this right with the vendor provided tools is usually near impossible as the vendor abandoned support and usually only had support for one or 2 commercial linux distros in any case. Enter the good folks at the HWraid project<\/p>\n<p>Just add their repository and install the tools for your card (in this case the HP tools)<\/p>\n<pre>\r\necho deb http:\/\/hwraid.le-vert.net\/debian squeeze main &gt;&gt; \/etc\/apt\/sources.list\r\napt-get update\r\napt-get install hpacucli\r\n<\/pre>\n<p>Now we test the tools.<\/p>\n<pre>hpacucli controller slot=0 physicaldrive all show\r\nSmart Array P400i in Slot 0 (Embedded)\r\n\u00a0\u00a0 \r\n\u00a0 \u00a0 \u00a0 physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SATA, 500 GB, OK)\r\n\u00a0 \u00a0 \u00a0 physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SATA, 500 GB, OK)\r\n<\/pre>\n<p>Success.. now that I have the tools that can interrogate the controller, I need to build some monitoring, so I add a script which I schedule to run every hour in cron.<\/p>\n<pre>\r\n#!\/bin\/bash\r\nMAIL=noc@acme.com\r\nHPACUCLI=`which hpacucli`\r\nHPACUCLI_TMP=\/tmp\/hpacucli.log\r\n\r\nif [ `$HPACUCLI ctrl all show config | grep -E 'Failed|Rebuilding'| wc -l` -gt 0 ]\r\nthen\r\nmsg=\"RAID Controller Errors\"\r\nlogger -p syslog.error -t RAID \"$msg\"\r\n$HPACUCLI ctrl all show config > $HPACUCLI_TMP\r\nmail -s \"$HOSTNAME [ERROR] - $msg\" \"$MAIL\" < $HPACUCLI_TMP\r\necho $msg\r\ncat $HPACUCLI_TMP\r\nrm -f $HPACUCLI_TMP\r\nfi\r\n<\/pre>\n<p>Configure your mail subsystem and ensure your system is actually able to send mail.<\/p>\n<pre>dpkg-reconfigure exim4-config<\/pre>\n<p>The script is very basic but it gets the job done, and yes you will\u00a0generate alerts every hour if there is an issue until its resolved, think of it as a feature. The script sends a mail to the hardcoded email address as well as adds it to your syslog. If you are performing syslog monitoring and alerts with something like Solarwinds, Splunk or Graylog then you could rather depend on those systems for alerts by checking for the alert message in syslog and scrap the emailing bit of the script.<\/p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><!-- .entry-content -->\n\t\t\n\t\t\n\t<\/div>\n\n<\/article><!-- #post-94 -->\n\n\t\n\t\t\n<article id=\"post-83\" class=\"post-83 post type-post status-publish format-standard hentry category-uncategorised tag-juniper tag-mpls tag-networking tag-redundancy tag-vpls\">\n\n\t\n\t<div class=\"entry-main\">\n\n\t\t\n\t\t<header class=\"entry-header\">\n\t\t\t\n\t\t\t<h1 class=\"entry-title\"><a href=\"http:\/\/coherence.co.za\/?p=83\" title=\"Permalink to Juniper M10 value propositon\" rel=\"bookmark\">Juniper M10 value propositon<\/a><\/h1>\n\n\t\t\t\t\t\t\t<div class=\"entry-meta\">\n\t\t\t\t\tPosted on <a href=\"http:\/\/coherence.co.za\/?p=83\" title=\"11:16 pm\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"2017-02-05T23:16:56+00:00\">5th Feb 2017<\/time><\/a><time class=\"updated\" datetime=\"2019-09-30T14:57:33+01:00\">30th Sep 2019<\/time> <span class=\"byline\"> by <span class=\"author vcard\"><a class=\"url fn n\" href=\"http:\/\/coherence.co.za\/?author=2\" title=\"View all posts by Enrico Zanolin\" rel=\"author\">Enrico Zanolin<\/a><\/span><\/span> \t\t\t\t<\/div><!-- .entry-meta -->\n\t\t\t\n\t\t<\/header><!-- .entry-header -->\n\n\t\t\t\t\t<div class=\"entry-content\">\n\t\t\t\t<p>The Juniper M series of routers have been obsoleted but are a really good value proposition if all you need is a few gig of reliable routing capability. The M10\/M10i is a redundant H\/A solution that is readily available in the refurbished market from sub 2000 USD and the most cost effective way to bootstrap a small enterprise with a robust core.<\/p>\n<p>What You Get<\/p>\n<p><a href=\"http:\/\/coherence.co.za\/wp-content\/uploads\/2017\/02\/JUNIPER-M10i-1.jpg\"><img loading=\"lazy\" class=\"alignright wp-image-89 size-medium\" src=\"http:\/\/coherence.co.za\/wp-content\/uploads\/2017\/02\/JUNIPER-M10i-1-300x139.jpg\" width=\"300\" height=\"139\" srcset=\"http:\/\/coherence.co.za\/wp-content\/uploads\/2017\/02\/JUNIPER-M10i-1-300x139.jpg 300w, http:\/\/coherence.co.za\/wp-content\/uploads\/2017\/02\/JUNIPER-M10i-1-768x356.jpg 768w, http:\/\/coherence.co.za\/wp-content\/uploads\/2017\/02\/JUNIPER-M10i-1-1024x475.jpg 1024w, http:\/\/coherence.co.za\/wp-content\/uploads\/2017\/02\/JUNIPER-M10i-1.jpg 1500w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<ul>\n<li>5U Chassis<\/li>\n<li>2 x C-FEB Forwarding Boards (active + standby)<\/li>\n<li>8 x PIC Physical Interface Card slots<\/li>\n<li>2 x Routing Engines 400Mhz CPU 256M RAM (higher spec available for more $)<\/li>\n<li>4 x 300W PSU (2 Required for operation 3\/4 for redundancy)<\/li>\n<li>In Service replaceable fan tray<\/li>\n<\/ul>\n<p>Pro&#8217;s<\/p>\n<ul>\n<li>Fully redundant PSU, routing engine and switch fabric.<\/li>\n<li>High availability features<\/li>\n<li>Cheap and available<\/li>\n<li>Enterprise grade<\/li>\n<li>MPLS and IPV6 support<\/li>\n<li>Dedicated out of band ethernet and RS232 management ports<\/li>\n<li>Plenty of SONET\/SDH\/ATM PIC options at reasonable pricing<\/li>\n<\/ul>\n<p>Con&#8217;s<\/p>\n<ul>\n<li>Limited capacity (1G per PIC\/slot)<\/li>\n<li>Relatively inefficient\u00a0(power and size vs throughput)<\/li>\n<li>End Of Life<\/li>\n<li>No layer-2 capability (kind of.. see below)<\/li>\n<li>Only vlan-tagging support, no stacked-vlan-tagging or flexible-vlan-tagging (ie. no L3 support for\u00a0 Q-in-Q).<\/li>\n<\/ul>\n<p>The 1G limitation per port is the hard limit on this device and I would not want to try and use it anywhere beyond a total of 4G of capacity as balancing evenly across ports starts to become a factor. The M series routers are IP\/MPLS routers supporting all the standard BGP\/IS-IS\/OSPF and MPLS protocols as well as allowing for multiple routing instances.<\/p>\n<p>Stateful firewalling and VPN is possible but would require a services PIC, two for redundancy. If this is what you are needing then you are generally better off looking at something else as they can be expensive and limited to 1G per module.<\/p>\n<p>Now the M series were made in an era when layer-2 and layer-3\u00a0functionality was typically serviced by separate devices, so the M series routers are just that, routers, they have no switching capability at all. Well kind of, it support 802.3ad LACP link bonding between PIC&#8217;s and with the progression of technology and standards, Junos and the M platform received upgrades and features which included MPLS and VPLS functionality which is technically a layer-2 technology.<\/p>\n<p>Because of the lack of switching support VPLS is limited in what it can do and you can run into issues if you are not aware of of these limitation. How we typically implement is as follows<\/p>\n<ul>\n<li>4 x 1G ethernet PIC&#8217;s<\/li>\n<li>2 x 2 Ports bonded with LACP into 2 aggregated ethernet ports on switches<\/li>\n<\/ul>\n<p><em>(these numbers can be doubled for more capacity)<\/em><\/p>\n<p>We use the 2 aggregated ports to provide a network facing port and a services facing port. They also provide link redundancy into the network, they typically all uplink into the same switch stack and are used to provide a pair of interfaces\/VLAN&#8217;s for the M10 which can also be used to loop traffic where required. You could do this all with one AE port with all the physicals in it and just use VLANs but I like to split my roles across interfaces for easier visibility and troubleshooting.<\/p>\n<p>So on one VLAN on the network AE we set up MPLS\u00a0capability with all the layer-3 stuff that&#8217;s required to make MPLS work. On the services port we setup a customer or service facing VLAN that we want to tunnel using VPLS. This is done by setting the VLAN port encapsulation to vlan-vpls and then creating a routing instance of\u00a0\u00a0instance-type vpls and adding the interface to that instance type. Now this is technically a switching function that is being performed on a routing only device.<\/p>\n<p>The caveat is that you need to create a separate routing instance for every layer-2 service that you want to use. You CANNOT use VLAN&#8217;s on the VPLS service because you will run into MAC learning issues due to the fact that the M10 is not layer-2 aware and cannot differentiate between the different broadcast domains of multiple VLAN&#8217;s. It will work for a bit but you will run into random dropped packets as the MAC learning table on your endpoint devices gets polluted.<\/p>\n<p>The flexible-vlan-tagging or stacked-vlan-tagging option on interfaces is allowed but ultimately not supported. On commit the device spits warnings in the messages log and when you try and configure the inner and outer tag the router will not accept the configuration. You should configure the vlan-tagging option instead.<\/p>\n<p>A simpler supported L2 feature is the l2circuit using MPLS.\u00a0 It is a point to point only tunnel that does not perform any MAC learning whatsoever, it just take the frame on one side and spits it out on the other. This can be configured on VLANs on ethernet ports if the encapsulation type on the VLAN is set to vlan-ccc. The port will accept further tags if they are present as well as &#8220;L2 local&#8221; frames such as LACP,LLDP,STP BPDU&#8217;s etc&#8230; The service is only really limited by overall MTU. This is because the M10 is not involved in any L2 learning so it will transparently pass the frame from one endpoint to the other endpoint. This is also why you can only have one endpoint because the M10 cannot make a path determination with no address information.<\/p>\n<p>The down side is that troubleshooting can be a bit harder in that you cannot see any learned MAC&#8217;s but the up side is that you do not need to worry about memory + MAC learning limits.<\/p>\n<p>As mentioned above, the lack of L2 support means that we usually pair an M10 with 2 EX4200&#8217;s in VC mode. QFX would be better but we are looking at a budget solution here so they don&#8217;t make sense. This gives you a certain amount of L2 flexibility that will cover most use cases. Be aware that EX series switches only support VLAN swap and push functions NOT VLAN pop. This can be somewhat limiting in this environment. One final note regarding the EX configuration for l2circuits, you can configure &#8220;dot1-tunneling\u00a0<span class=\"s1\">layer2-protocol-tunneling all&#8221; on the EX4200&#8217;s which will ensure you can transparently take all frames from a customer facing VLAN to a l2circuit on the M10. This is also where we can look at MAC learning for troubleshooting as the switch will learn customer MAC&#8217;s, and also where we set MAC learning limits to prevent possible issues introduced on the EX by customer networks.<\/span><\/p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><!-- .entry-content -->\n\t\t\n\t\t\n\t<\/div>\n\n<\/article><!-- #post-83 -->\n\n\t\n\t\t\n<article id=\"post-78\" class=\"post-78 post type-post status-publish format-standard hentry category-uncategorised tag-ipv4 tag-mikrotik tag-networking\">\n\n\t\n\t<div class=\"entry-main\">\n\n\t\t\n\t\t<header class=\"entry-header\">\n\t\t\t\n\t\t\t<h1 class=\"entry-title\"><a href=\"http:\/\/coherence.co.za\/?p=78\" title=\"Permalink to Saving IP space on your point to point peering subnets using \/31 subnets aka RFC3021\" rel=\"bookmark\">Saving IP space on your point to point peering subnets using \/31 subnets aka RFC3021<\/a><\/h1>\n\n\t\t\t\t\t\t\t<div class=\"entry-meta\">\n\t\t\t\t\tPosted on <a href=\"http:\/\/coherence.co.za\/?p=78\" title=\"12:10 am\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"2017-02-04T00:10:36+00:00\">4th Feb 2017<\/time><\/a><time class=\"updated\" datetime=\"2017-02-04T00:17:43+00:00\">4th Feb 2017<\/time> <span class=\"byline\"> by <span class=\"author vcard\"><a class=\"url fn n\" href=\"http:\/\/coherence.co.za\/?author=1\" title=\"View all posts by admin\" rel=\"author\">admin<\/a><\/span><\/span> \t\t\t\t<\/div><!-- .entry-meta -->\n\t\t\t\n\t\t<\/header><!-- .entry-header -->\n\n\t\t\t\t\t<div class=\"entry-content\">\n\t\t\t\t<p>Most of us are used to allocating a \/30 subnet for point to point peering, which gives us 2 device IP&#8217;s, a network address, and a broadcast address. With the exhaustion of IPV4 space it&#8217;s useful to be able to save wherever you can, so where possible you should consider \/31 allocation instead of \/30. Most modern day vendors support RFC3021 and using it is as simple as just specifying the \/31 subnet mask. I have used this on various Juniper and Cisco devices in the past without any issues, but unfortunately not all vendors or models support it so your mileage will vary.<\/p>\n<p>I would also, always recommend performing further testing beyond just a ICMP reachability tests if broadcast protocols are involved. A prime example is if you use something like the OSPF routing protocol that uses broadcast as a discovery mechanism. It should work but if it does not then possibly see if you can set it o P2P operation before reverting back to a \/30 allocation.<br \/>\nI need to mention Mikrotik specifically here because they do not support RFC3021 in an obvious way. If you just specify x.x.x.x\/31 it wont work. You need to specify a \/32 with a matching network address. So 1.1.1.0\/31 would look like so<\/p>\n<pre>\/ip address add address=1.1.1.0\/32 network=1.1.1.1 interface=ether1<\/pre>\n<p>The above example is compatible with RFC3021 but is actually different in that the network address does not have to fall within the same \/31 as the IP. I have struggled to find the RFC for this assignment scheme but it allows you to be able to add the same IP multiple times with a different network address. This allows you to reach multiple devices on the same network segment using only a single IP per device. This obviously only works if all devices support this format.<\/p>\n<p>Example of using this to connect to 2 other routers with IP&#8217;s 2.2.2.2 and 3.3.3.3.<\/p>\n<pre>\/ip address add address=1.1.1.0\/32 network=2.2.2.2 interface=ether1\r\n\/ip address add address=1.1.1.0\/32 network=3.3.3.3 interface=ether1<\/pre>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><!-- .entry-content -->\n\t\t\n\t\t\n\t<\/div>\n\n<\/article><!-- #post-78 -->\n\n\t\n\t\t\n<article id=\"post-76\" class=\"post-76 post type-post status-publish format-standard hentry category-uncategorised tag-mikrotik tag-proxy-arp\">\n\n\t\n\t<div class=\"entry-main\">\n\n\t\t\n\t\t<header class=\"entry-header\">\n\t\t\t\n\t\t\t<h1 class=\"entry-title\"><a href=\"http:\/\/coherence.co.za\/?p=76\" title=\"Permalink to &#8220;Stealing&#8221; a single IP from a subnet that you do not control.\" rel=\"bookmark\">&#8220;Stealing&#8221; a single IP from a subnet that you do not control.<\/a><\/h1>\n\n\t\t\t\t\t\t\t<div class=\"entry-meta\">\n\t\t\t\t\tPosted on <a href=\"http:\/\/coherence.co.za\/?p=76\" title=\"11:34 pm\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"2017-02-03T23:34:50+00:00\">3rd Feb 2017<\/time><\/a><time class=\"updated\" datetime=\"2017-02-03T23:35:23+00:00\">3rd Feb 2017<\/time> <span class=\"byline\"> by <span class=\"author vcard\"><a class=\"url fn n\" href=\"http:\/\/coherence.co.za\/?author=1\" title=\"View all posts by admin\" rel=\"author\">admin<\/a><\/span><\/span> \t\t\t\t<\/div><!-- .entry-meta -->\n\t\t\t\n\t\t<\/header><!-- .entry-header -->\n\n\t\t\t\t\t<div class=\"entry-content\">\n\t\t\t\t<p>The requirements to do weird and wonderful things never cease when it comes to networking and unprepared clients. I won&#8217;t go into the why, but I will share with you an interesting hack that I have not really seen done elsewhere. Here is the scenario, I have a DMZ subnet and a DMZ router lets say on \u00a01.1.1.0\/28, I want to take one of those IP&#8217;s and terminate it on another device without using NAT. \u00a0Now here is the trick, the device in question sits one or more routed hops away and I DO NOT have access to the DMZ router.<\/p>\n<p>This is especially useful when you want a device to actually have the IP terminated on it, and you want to avoid NAT because of ALG issues (eg SIP.).<\/p>\n<p>You will need..<\/p>\n<ul>\n<li>1x Mikrotik router (in my case it was a virtual x86 one in a VM)<\/li>\n<li>1x Interface in the DMZ<\/li>\n<li>1x Interface in the &#8220;Other&#8221; network<\/li>\n<li>Enable proxy-arp on the DMZ interface<\/li>\n<li>Set up a filter to only deal with the arps you are interested in<\/li>\n<\/ul>\n<p>The filter functionality we need to use on Mikrotik is only available under the bridging firewall (which is the equivalent of ebtables for all the netfilter people), so we need to use a bridge interface for the filtering to work. We filter because we don&#8217;t want to introduce a device that responds to all ARP requests on the network. Introducing new behaviour in a system may break something so avoid it where possible.<\/p>\n<p>Possibly scenarios are.. an IP scanning security appliance performs network scans and detects all these new active IP&#8217;s and then raises false alarms or.. possibly there is another device on the segment also performing proxy-arp so as to make something work and introducing another proxy-arp device will break that. Cisco IOS configurations found in X.21 routers (and probably others) seem to like to enable proxy-arp by default, I never did like this and still to this day find them scattered around corporate environments.<\/p>\n<p>Lets use the following IP&#8217;s in the example.<\/p>\n<ul>\n<li>1.1.1.1 DMZ router IP, aka the gateway to the internet<\/li>\n<li>1.1.1.3 Router IP, we strictly don&#8217;t need this but you probably want to allocate an IP to the router so that you can manage it.<\/li>\n<li>1.1.1.5 IP we want to steal\/route onwards<\/li>\n<li>192.168.50.1\/24 Router IP on the private network that the hosted device sits on<\/li>\n<li>192.168.50.12\/24 IP of the device that needs to host the &#8220;stolen&#8221; IP<\/li>\n<\/ul>\n<p>So lets get started by creating the bridge and enabling proxy-arp on it.<\/p>\n<p>\/interface bridge<br \/>\nadd arp=proxy-arp name=br-dmz protocol-mode=none<br \/>\n\/interface bridge port<br \/>\nadd bridge=br-dmz interface=ether1<\/p>\n<p>Lets number the interfaces<\/p>\n<pre>\/ip address\r\n add address=1.1.1.3\/28 interface=br-dmz\r\n add address=192.168.50.1\/24 interface=ether2<\/pre>\n<p>Then we add the ARP filters that accept ARP requests for the router IP and the forwarded IP only.<\/p>\n<pre>\/interface bridge filter\r\n add arp-dst-address=1.1.1.3\/32 arp-opcode=request chain=input \\\r\n mac-protocol=arp\r\n add arp-dst-address=1.1.1.5\/32 arp-opcode=request chain=input \\\r\n mac-protocol=arp\r\n add action=drop arp-opcode=request chain=input log=yes mac-protocol=arp\r\n<\/pre>\n<p>If you are using VLAN instead on physical interfaces you may need to enable<\/p>\n<pre>\/interface bridge settings\r\n set use-ip-firewall-for-vlan=yes<\/pre>\n<p>OK, so now we have the &#8220;stolen&#8221; the IP lets send it to the device that we want host it on<\/p>\n<pre>\/ip route\r\n add distance=1 dst-address=1.1.1.5\/32 gateway=192.168.50.12\r\n add distance=1 dst-address=0.0.0.0\/0 gateway=1.1.1.1<\/pre>\n<p>I wont go into how you get the host to use the IP as a source address for originating outgoing connections, but as it stands if you install 1.1.1.5\/32 on an active physical interface or on a loopback interface(recommended) of the device, most devices will work from an inbound connection perspective (ie they will be reachable on that IP). I cannot really cover outgoing source address selection, as this will vary depending on the device and OS. but in most cases I would look to see if you can set a &#8220;preferential source address&#8221; attribute \u00a0on the default route of the devices routing table.<\/p>\n<p>&nbsp;<\/p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><!-- .entry-content -->\n\t\t\n\t\t\n\t<\/div>\n\n<\/article><!-- #post-76 -->\n\n\t\n\t\t<nav role=\"navigation\" id=\"nav-below\" class=\"site-navigation paging-navigation\">\n\t\t<h2 class=\"assistive-text\">Post navigation<\/h2>\n\n\t\n\t\t<div class='pagination'><span aria-current=\"page\" class=\"page-numbers current\">1<\/span>\n<a class=\"page-numbers\" href=\"http:\/\/coherence.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fpages%2F66&#038;paged=2\">2<\/a>\n<a class=\"next page-numbers\" href=\"http:\/\/coherence.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fpages%2F66&#038;paged=2\">Next &raquo;<\/a><\/div>\n\n\t\n\t<\/nav><!-- #nav-below -->\n\t\n<\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>&nbsp; Making your Debian server networking redundant Debian guest exposing console to KVM host Broken web pages\/downloads \u2013 AAAaaarrrrgh!<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/pages\/66"}],"collection":[{"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/coherence.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=66"}],"version-history":[{"count":4,"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/pages\/66\/revisions"}],"predecessor-version":[{"id":92,"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/pages\/66\/revisions\/92"}],"wp:attachment":[{"href":"http:\/\/coherence.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}