[prev in list] [next in list] [prev in thread] [next in thread] 

List:       juniper-nsp
Subject:    Re: [j-nsp] set MED only on empty
From:       Alexander Arseniev via juniper-nsp <juniper-nsp () puck ! nether ! net>
Date:       2020-09-20 18:26:29
Message-ID: mailman.59.1600626394.1403.juniper-nsp () puck ! nether ! net
[Download RAW message or body]

Return-Path: <arseniev@btinternet.com>
X-Original-To: juniper-nsp@puck.nether.net
Delivered-To: juniper-nsp@puck.nether.net
Received: from sa-prd-fep-041.btinternet.com (mailomta19-sa.btinternet.com \
[213.120.69.25])  (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 \
bits))  (No client certificate requested)
	by puck.nether.net (Postfix) with ESMTPS id C9C925401BE
	for <juniper-nsp@puck.nether.net>; Sun, 20 Sep 2020 14:26:30 -0400 (EDT)
Received: from sa-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.38.7])
          by sa-prd-fep-041.btinternet.com with ESMTP
          id <20200920182629.SGEQ19995.sa-prd-fep-041.btinternet.com@sa-prd-rgout-004.btmx-prd.synchronoss.net>;
  Sun, 20 Sep 2020 19:26:29 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com; s=btmx201904; \
t00626389;  bh-txGDrCFNZwEhCFbucJ0JAVarnCr1Y5CP0oD9UL6bM=;
        h=From:To:Subject:Date:Message-Id:In-Reply-To:References:Reply-To:Mime-Version;
  b=Kmx9yS/WOfE7ciPH78cZ4VbKqP4EWLWgWXBGpYZlzgtknQ8Sg4c65VYnm9olydCwc42VQ5UNChG7PME7p4 \
yMvVhzvfGf8cer9SLm6OA07iONzADdnT9tfrWgV0A+8aYn515tvHUqTlopxcwDLAIWyqfIyxNXy9jpVYXjWTJF \
xPJUreCkRFQlQqQ3KVa6JcDMTUGPnHceJwpmJr7sppr4evJrL8DDxlUG1Md0QvA7m8wKYJOul1EVtSrkyg/asF \
kXDlNojJ3ecmChzW++BLArT9yHPrEqCj/noW7TcuSdw0y6NTxS2MNo+4peoPybg+cvAUwDTsn3TEsFPGx7ZgDbZg=Authentication-Results: \
btinternet.com;  auth=pass (PLAIN) smtp.auth=arseniev@btinternet.com
X-Originating-IP: [86.154.151.113]
X-OWM-Source-IP: 86.154.151.113 (GB)
X-OWM-Env-Sender: arseniev@btinternet.com
X-VadeSecure-score: verdict=clean score=0/300, class=clean
X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedujedruddtgdduvdegucetufdoteggodetrfdo \
tffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftd \
dunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfrhgfgggtgfesthhq \
redttderjeenucfhrhhomhepfdetlhgvgigrnhguvghrucetrhhsvghnihgvvhdfuceorghrshgvnhhivghvse \
gsthhinhhtvghrnhgvthdrtghomheqnecuggftrfgrthhtvghrnhepveejtefhhfevgfegkeetvdduhfeugeel \
jeeiheetudfhudduteffuefhheeufeefnecuffhomhgrihhnpehjuhhnihhpvghrrdhnvghtpdhnvghthhgvrh \
drnhgvthenucfkphepkeeirdduheegrdduhedurdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr \
rghmpehhvghloheplgduledvrdduieekrddurdduudejngdpihhnvghtpeekiedrudehgedrudehuddruddufe \
dpmhgrihhlfhhrohhmpeeorghrshgvnhhivghvsegsthhinhhtvghrnhgvthdrtghomheqpdhrtghpthhtohep \
oegsrghlughurhesghhighgrsghithdrughkqedprhgtphhtthhopeeojhhunhhiphgvrhdqnhhsphesphhutghkrdhnvghthhgvrhdrnhgvtheq
                
X-RazorGate-Vade-Verdict: clean 0
X-RazorGate-Vade-Classification: clean
X-SNCR-hdrdom: btinternet.com
Received: from [192.168.1.117] (86.154.151.113) by \
sa-prd-rgout-004.btmx-prd.synchronoss.net (5.8.340) (authenticated as \
arseniev@btinternet.com)  id 5ED9B66111E91964; Sun, 20 Sep 2020 19:26:29 +0100
From: "Alexander Arseniev" <arseniev@btinternet.com>
To: "Baldur Norddahl" <baldur@gigabit.dk>, "Juniper List"
 <juniper-nsp@puck.nether.net>
Subject: Re[2]: [j-nsp] set MED only on empty
Date: Sun, 20 Sep 2020 18:26:29 +0000
Message-Id: <em4821ea78-3a97-4d19-b045-501d29b26387@laptop-t1tojcr7>
In-Reply-To: <CAPq_dj_5FFbCeuP=x_ZmKN7pik2gwyic94n1CHwrCO=Vw3Hn1Q@mail.gmail.com>
References: <CAPq_dj-8FV+szWu_15UNio3hkG_C_P20YHWMCP92bkNX---PbQ@mail.gmail.com>
 <CAHf3uWxvY3-wG71b-WP6XER1KUBL97XODzd6UsNY8dqMYMTmbQ@mail.gmail.com>
 <CAPq_dj_5FFbCeuP=x_ZmKN7pik2gwyic94n1CHwrCO=Vw3Hn1Q@mail.gmail.com>
Reply-To: "Alexander Arseniev" <arseniev@btinternet.com>
User-Agent: eM_Client/7.2.40748.0
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello,
Last time I tested it, "from metric 0" works only if MED is present and 
equals 0.
Back then (around JUNOS 17) I developed a policy to detect missing MED 
which exploits metric2 rollover (basically, subtracting 1 from missing 
MED results in MED==4294967295)
Example below:
regress@R1# show policy-statement CHECK_MED_IMPORT
term CHECK_IF_MED_EXISTS_AND_0 {
     from {
         metric 0; {## accept if MED present && 0
     }
     then accept;
}
term MED_DECREMENT {
     then {
         metric {
             expression {
                 metric multiplier 1 offset -1; ## turns absent MED into 
2^32-1
             }
         }
         next term;
}}
term CHECK_IF_MED_ROLLED_OVER {
     from metric 4294967295;
     then accept; ## sets missing MED to 4294967295 but You can set it to 
smthg else
}
term RESTORE_ORIGINAL_MED {
     then {
         metric add 1;
     }
}

Thanks
Alex

------ Original Message ------
From: "Baldur Norddahl" <baldur@gigabit.dk>
To: "Juniper List" <juniper-nsp@puck.nether.net>
Sent: 19/09/2020 22:49:07
Subject: Re: [j-nsp] set MED only on empty

> Hello
> 
> Metric zero should work, I do not know why I did not think of that.
> 
> Thanks,
> 
> Baldur
> 
> Den lør. 19. sep. 2020 kl. 21.13 skrev Eduardo Schoedler <listas@esds.com.br
> > > 
> 
> > Hi Baldur,
> > 
> > Try match metric, with some tests you can define empty (maybe zero?).
> > 
> > 
> > https://www.juniper.net/documentation/en_US/junos/topics/usage-guidelines/policy-configuring-match-conditions-in-routing-policy-terms.html
> >  
> > 
> > 
> > Regards.
> > 
> > 
> > Em sáb., 19 de set. de 2020 às 12:59, Baldur Norddahl <baldur@gigabit.dk>
> > escreveu:
> > 
> > > Hello
> > > 
> > > 
> > > 
> > > I want to set MED (metric) only when the peer did not specify a MED value.
> > > 
> > > The idea being that peers that set MED have a reason for their choice, but
> > > 
> > > if no MED value is set, I am going to set it to MED=(latency_to_peer_in_ms
> > > 
> > > + 1000). That way we will prefer the route with lowest latency.
> > > 
> > > 
> > > 
> > > But I can not figure out how to match on no MED value in a policy. There
> > > 
> > > must be a way to do this?
> > > 
> > > 
> > > 
> > > Thanks,
> > > 
> > > 
> > > 
> > > Baldur
> > > 
> > > _______________________________________________
> > > 
> > > juniper-nsp mailing list juniper-nsp@puck.nether.net
> > > 
> > > https://puck.nether.net/mailman/listinfo/juniper-nsp
> > > 
> > > --
> > Eduardo Schoedler
> > 
> _______________________________________________
> juniper-nsp mailing list juniper-nsp@puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp



_______________________________________________
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic