Julien Goodwin
JunOS apply-groups 
22nd-Nov-2011 12:44 am
southpark cartoon
Ivan Pepelnjak has recently been playing with JunOS, and was wondering how people configure various things.

Here's how to use Juniper's built-in groups feature to make configuring backbone interfaces in an IS-IS+MPLS environment trivial (and I've thrown in IPv6 for free). This is not a complete config (notably IS-IS I've left out as I'm too tired to write that as well).

One other trick I've included is using groups to set your own defaults, in this case the frame scrambler for SONET links.

groups {
	BACKBONE {
		interfaces {
			<*> {
				mtu 2000;
				unit 0 {
					family iso;
					family inet6;
					family mpls;
				}
			}
		}
	}
	SONET-DEFAULTS {
		interfaces {
			<so-*> {
				sonet-options {
					fcs 32;
				}
			}
		}
	}
}
interfaces {
	apply-groups SONET-DEFAULTS;
	ge-0/0/0 {
		apply-groups BACKBONE;
		unit 0 {
			description "A Backbone link";
			family inet {
				address 10.1.2.3/26;
			}
		}
	}
	so-0/1/0 {
		apply-groups BACKBONE;
		unit 0 {
			description "Another backbone link";
			family inet {
				address 10.2.3.6/28;
			}
		}
	}
			
}
protocols {
	rsvp {
		interface all;
		interface fxp0 {
			disable;
		}
	}
	mpls {
		interface all;
		interface fxp0 {
			disable;
		}
	}
}
This page was loaded Aug 23rd 2014, 5:18 pm GMT.