分享
 
 
 

JunOS Secure BGP Template

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

/* ... begin template ... */

version 4.3R3;

/* JUNOS 4.3R3 Secure BGP template */

routing-options {

options {

/* Turn off DNS resolution */

no-resolve;

}

static {

/* This is our aggregate static route */

route 1.88.0.0/19 discard;

/* More specific routes used with discard route above. Remove these

if using an IGP to discover internal routes. */

route 1.88.50.0/24 next-hop 192.168.50.5;

route 1.88.55.0/24 next-hop 192.168.50.8;

route 1.88.75.128/25 next-hop 192.168.50.10;

/* Route to loopback of our iBGP peer */

route 172.17.70.2/32 next-hop 192.168.50.2;

/* Black-hole routes for traffic destined to these networks */

route 0.0.0.0/8 discard;

route 1.0.0.0/8 discard;

route 2.0.0.0/8 discard;

route 5.0.0.0/8 discard;

route 7.0.0.0/8 discard;

route 10.0.0.0/8 discard;

route 23.0.0.0/8 discard;

route 27.0.0.0/8 discard;

route 31.0.0.0/8 discard;

route 36.0.0.0/8 discard;

route 37.0.0.0/8 discard;

route 39.0.0.0/8 discard;

route 41.0.0.0/8 discard;

route 42.0.0.0/8 discard;

route 49.0.0.0/8 discard;

route 50.0.0.0/8 discard;

route 73.0.0.0/8 discard;

route 74.0.0.0/8 discard;

route 75.0.0.0/8 discard;

route 76.0.0.0/8 discard;

route 77.0.0.0/8 discard;

route 78.0.0.0/8 discard;

route 79.0.0.0/8 discard;

route 89.0.0.0/8 discard;

route 90.0.0.0/8 discard;

route 91.0.0.0/8 discard;

route 92.0.0.0/8 discard;

route 93.0.0.0/8 discard;

route 94.0.0.0/8 discard;

route 95.0.0.0/8 discard;

route 96.0.0.0/8 discard;

route 97.0.0.0/8 discard;

route 98.0.0.0/8 discard;

route 99.0.0.0/8 discard;

route 100.0.0.0/8 discard;

route 101.0.0.0/8 discard;

route 102.0.0.0/8 discard;

route 103.0.0.0/8 discard;

route 104.0.0.0/8 discard;

route 105.0.0.0/8 discard;

route 106.0.0.0/8 discard;

route 107.0.0.0/8 discard;

route 108.0.0.0/8 discard;

route 109.0.0.0/8 discard;

route 110.0.0.0/8 discard;

route 111.0.0.0/8 discard;

route 112.0.0.0/8 discard;

route 113.0.0.0/8 discard;

route 114.0.0.0/8 discard;

route 115.0.0.0/8 discard;

route 116.0.0.0/8 discard;

route 117.0.0.0/8 discard;

route 118.0.0.0/8 discard;

route 119.0.0.0/8 discard;

route 120.0.0.0/8 discard;

route 121.0.0.0/8 discard;

route 122.0.0.0/8 discard;

route 123.0.0.0/8 discard;

route 127.0.0.0/8 discard;

route 128.0.0.0/16 discard;

route 169.254.0.0/16 discard;

route 172.16.0.0/12 discard;

route 173.0.0.0/8 discard;

route 174.0.0.0/8 discard;

route 175.0.0.0/8 discard;

route 176.0.0.0/8 discard;

route 177.0.0.0/8 discard;

route 178.0.0.0/8 discard;

route 179.0.0.0/8 discard;

route 180.0.0.0/8 discard;

route 181.0.0.0/8 discard;

route 182.0.0.0/8 discard;

route 183.0.0.0/8 discard;

route 184.0.0.0/8 discard;

route 185.0.0.0/8 discard;

route 186.0.0.0/8 discard;

route 187.0.0.0/8 discard;

route 189.0.0.0/8 discard;

route 190.0.0.0/8 discard;

route 192.0.2.0/24 discard;

route 192.168.0.0/16 discard;

route 197.0.0.0/8 discard;

route 198.18.0.0/15 discard;

route 223.0.0.0/8 discard;

route 240.0.0.0/4 discard;

}

/* Our AS Number */

autonomous-system 111;

/* Export the policy that turns on flow based load balancing */

forwarding-table {

export load-balancing;

}

/* Keep certain announcements from entering the routing table,

but permit specific discard routes to remain there. Use

'show route martians' to view them. */

martians {

0.0.0.0/8 longer;

1.0.0.0/8 longer;

2.0.0.0/8 longer;

5.0.0.0/8 longer;

7.0.0.0/8 longer;

10.0.0.0/8 longer;

23.0.0.0/8 longer;

27.0.0.0/8 longer;

31.0.0.0/8 longer;

36.0.0.0/8 longer;

37.0.0.0/8 longer;

39.0.0.0/8 longer;

41.0.0.0/8 longer;

42.0.0.0/8 longer;

49.0.0.0/8 longer;

50.0.0.0/8 longer;

73.0.0.0/8 longer;

74.0.0.0/8 longer;

75.0.0.0/8 longer;

76.0.0.0/8 longer;

77.0.0.0/8 longer;

78.0.0.0/8 longer;

79.0.0.0/8 longer;

89.0.0.0/8 longer;

90.0.0.0/8 longer;

91.0.0.0/8 longer;

92.0.0.0/8 longer;

93.0.0.0/8 longer;

94.0.0.0/8 longer;

95.0.0.0/8 longer;

96.0.0.0/8 longer;

97.0.0.0/8 longer;

98.0.0.0/8 longer;

99.0.0.0/8 longer;

100.0.0.0/8 longer;

101.0.0.0/8 longer;

102.0.0.0/8 longer;

103.0.0.0/8 longer;

104.0.0.0/8 longer;

105.0.0.0/8 longer;

106.0.0.0/8 longer;

107.0.0.0/8 longer;

108.0.0.0/8 longer;

109.0.0.0/8 longer;

110.0.0.0/8 longer;

111.0.0.0/8 longer;

112.0.0.0/8 longer;

113.0.0.0/8 longer;

114.0.0.0/8 longer;

115.0.0.0/8 longer;

116.0.0.0/8 longer;

117.0.0.0/8 longer;

118.0.0.0/8 longer;

119.0.0.0/8 longer;

120.0.0.0/8 longer;

121.0.0.0/8 longer;

122.0.0.0/8 longer;

123.0.0.0/8 longer;

127.0.0.0/8 longer;

128.0.0.0/16 longer;

169.254.0.0/16 longer;

172.16.0.0/12 longer;

173.0.0.0/8 longer;

174.0.0.0/8 longer;

175.0.0.0/8 longer;

176.0.0.0/8 longer;

177.0.0.0/8 longer;

178.0.0.0/8 longer;

179.0.0.0/8 longer;

180.0.0.0/8 longer;

181.0.0.0/8 longer;

182.0.0.0/8 longer;

183.0.0.0/8 longer;

184.0.0.0/8 longer;

185.0.0.0/8 longer;

186.0.0.0/8 longer;

187.0.0.0/8 longer;

189.0.0.0/8 longer;

190.0.0.0/8 longer;

192.0.2.0/24 longer;

192.168.0.0/16 longer;

197.0.0.0/8 longer;

198.18.0.0/15 longer;

223.0.0.0/8 longer;

240.0.0.0/4 longer;

}

}

/* Routing protocol configuration */

protocols {

bgp {

/* Log additional BGP information to aid in troubleshooting. To

view, use 'show log log-bgp' */

traceoptions {

/* Rotate through 5 files at 1mb each */

file log-bgp size 1m files 5;

/* Trace BGP state transitions */

flag state;

/* Trace BGP normal events */

flag normal;

}

/* Log BGP neighbor changes */

log-updown;

/* Enable bgp route flap damping */

damping;

/* Keep private AS numbers 64512-65535 from leaking out */

remove-private;

family inet {

any {

/* MUST take into account current routing table size and keep

a CLOSE watch on this. Otherwise do NOT use! Prefit

limits can be applied at the group level instead if

desired. */

prefix-limit {

/* Tear down connection when routes reach maximum */

maximum 130000;

/* Start issuing warning messages at teardown percent */

teardown 90;

}

}

}

/* iBGP peer-group with AS 111. Peer-groups save typing and CPU

cycles when multiple neighbors exist with same policy */

group iBGP_111 {

type internal;

description "iBGP with AS 111";

/* Set my address to that of lo0 */

local-address 172.17.70.1;

authentication-key bgpwith111;

/* Set next-hop-self for eBGP routes sent to our iBGP peer */

export next-hop-self;

/* The following is assumed if not entered */

peer-as 111;

/* Loopback address of our internal peer */

neighbor 172.17.70.2;

}

/* eBGP peer-group with AS 222 */

group eBGP_222 {

type external;

description "eBGP with AS 222";

authentication-key bgpwith222;

/* Inbound filtering: Remove bogons, small prefixes, private ASN

advertisements, and set damping parameters. */

import [ nobogons nosmallprefixes noprivateasns damping ];

/* Only announce our netblock */

export announce;

peer-as 222;

/* Allow installation of equal cost BGP paths into inet.0

(routing table), one of which is then selected at random */

multipath;

neighbor 10.10.10.1;

}

/* eBGP peer-group with AS 333 */

group eBGP_333 {

type external;

description "eBGP with AS 333";

authentication-key bgpwith333;

import [ nobogons nosmallprefixes noprivateasns damping ];

export announce;

peer-as 333;

multipath;

neighbor 10.10.5.1;

}

}

}

/* Route filtering configuration */

policy-options {

/* List of root-servers.net as of 09/11/01.

Refer to RIPE-229 [6] on keeping this list current. */

prefix-list root-servers.net {

128.8.0.0/16;

128.9.0.0/16;

128.63.0.0/16;

192.5.4.0/23;

192.33.4.0/24;

192.36.148.0/24;

192.112.36.0/24;

192.203.230.0/24;

193.0.14.0/24;

198.32.64.0/24;

198.41.0.0/24;

202.12.27.0/24;

}

/* Match what we configured as our static aggregate netblock */

policy-statement announce {

term 1 {

from {

protocol static;

route-filter 1.88.0.0/19 exact;

}

then accept;

}

term 2 {

then reject;

}

}

/* Martians list will reject bogon routes not listed here. Don't want

multicast address range listed in the martian list. */

policy-statement nobogons {

from route-filter 224.0.0.0/4 orlonger reject;

}

/* Reject advertisements that contain private AS numbers. */

policy-statement noprivateasns {

from as-path private;

then reject;

}

/* AS-PATH referenced in the noprivateasns policy. */

as-path private 64512-65535;

/* Drop prefixes larger than /27. Other BGP policies may vary */

policy-statement nosmallprefixes {

from route-filter 0.0.0.0/0 prefix-length-range /27-/32 reject;

}

/* Set next-hop to self. Used for eBGP routes sent to iBGP peers */

policy-statement next-hop-self {

then {

next-hop self;

}

}

/* Configure load balancing. IP1 ASIC performs packet load balancing on

up to 8 equal cost paths. IP2 ASIC performs flow based load balancing

on up to 16 equal cost paths. Use only if you have an IP2 ASIC. */

policy-statement load-balancing {

then {

load-balance per-packet;

}

}

/* Configure our damping policy according to RIPE-229 and an updated set

of DNS netblocks. */

policy-statement damping {

/* Do NOT dampen DNS root-servers */

term 1 {

from {

prefix-list root-servers.net;

}

then {

damping damp-none;

/* Ignore rest of terms and jump to next policy called */

next policy;

}

}

/* Dampen according to prefix length. JunOS penalises on withdraw

and on readvertise. So one flap attracts a total penalty of 2000.

An attribute change attracts a penalty of 500. */

term 2 {

from {

/* Lower penalty for prefixes of size /21 and smaller */

route-filter 0.0.0.0/0 upto /21 damping damp-short;

/* Medium penalty for prefixes of size /22 to /23 */

route-filter 0.0.0.0/0 upto /23 damping damp-medium;

/* Higher penalty for prefixes of size /24 and larger */

route-filter 0.0.0.0/0 orlonger damping damp-long;

}

then {

next policy;

}

}

}

/* Min: 30 min, Max: 60 min, dampen at 3 flaps */

damping damp-long {

half-life 30;

reuse 1640;

suppress 6000;

max-suppress 60;

}

/* Min: 15 min, Max: 45 min, dampen at 3 flaps */

damping damp-medium {

half-life 15;

reuse 1500;

suppress 6000;

max-suppress 45;

}

/* Min: 10 min, Max: 30 min, dampen at 3 flaps */

damping damp-short {

half-life 10;

reuse 3000;

suppress 6000;

max-suppress 30;

}

/* Do not dampen. Referenced for DNS root-servers */

damping damp-none {

disable;

}

}

/* Firewall filtering rules need to be applied to an interface. In this case

it should be merged with existing firewall policy and applied to lo0. */

firewall {

filter router-protect {

/* Drop and log all unexpected BGP connection attempts */

term 1 {

from {

address {

0.0.0.0/0;

10.10.5.1/32 except;

10.10.10.1/32 except;

172.17.70.1/32 except;

172.17.70.2/32 except;

}

protocol tcp;

port bgp;

}

then {

count manage-discard-bgp;

discard;

}

}

term 2 {

then {

/* Allow all other traffic */

count manage-accept-other;

accept;

}

}

}

}

/* ... end template ... */

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有