当前位置:文档之家› juniper路由器配置

juniper路由器配置

juniper路由器配置一.路由器网络服务安全配置:默认情况下,系统启动了许多无用服务,这些服务在占用系统资源的同时也造成一定的安全隐患,应该在尽可能的情况下停止或限制这些服务1. SNMP服务使用如下命令来停止SNMP服务:setsystemprocessessnmpdisable使用如下命令来设置SNMP通讯字符串:setsnmpcommunitymysnmpauthorizationread-only使用如下命令来在接口上设备SNMP通讯字符串:setsnmpinterfacefxp0communitymysnmp使用如下命令来在接口上禁止SNMP服务trap:setinterfacesfxp0unit0trapsdisable使用如下命令来限制SNMP的访问客户端:setsnmpcommunitymysnmpclients192.168.0.0/24 setsnmpcommunitymysnmpclients0.0.0.0/0restrict上述命令只允许192.168.0.0/24网段访问路由器的SNMP服务2.停止接口广播转发:广播转发容易造成smurf攻击,因此应该使用如下命令停止:setsystemno-redirects接口级别停止广播转发使用如下命令:setinterfacesfxp0unit0familyinetno-redirects3.停止dhcp-relay服务,dhcp-relay服务用于在不同网段使用同一个dhcp 服务器,如果没有使用,则应该使用如下命令停止:setsystemdhcp-relaydisable4.禁止IGMP服务,IGMP服务如果在没有使用的情况下应该使用如下命令禁止:setprotocolsigmpinterfacealldisable5.禁止PIM服务(?),PIM服务如果在没有使用的情况下应该使用如下命令禁止:setprotocolspimdisable6.禁止SAP服务(?),SAP服务如果在没有使用的情况下应该使用如下命令禁止:setprotocolssapdisable7.禁止IPSourceRouting源路由setchassisno-source-route二.路由器登录控制:1.设置系统登录Banner:setsystemloginmessageWarning:ifyouNOTauthorizedtoaccessthissystem,dis connectNOW!2.设置登录超时时间:默认情况下,系统登录没有登录超时时间限制,应该将登录超时时间设置为15分钟:setcliidle-timeout153.建议采取用户权限分级管理策略setsystemloginclasstier1idle-timeout15setsystemloginclasstier1permissions[configureinterfacenetworkroutings nmpsystemtraceviewfirewall]setsystemloginclasstier2idle-timeout15setsystemloginclasstier2permissionsallsetsystemloginuseradminfull-nameAdministrator setsystemloginuseradminuid2000setsystemloginuseradminclasstier2 setsystemloginuseradminauthenticationencrypted-password setsystemloginusertier1uid2001setsystemloginusertier1classtier1setsystemloginusertier2uid2002setsystemloginusertier2classtier24. 限制系统ssh、telnet服务连接数量:以下配置将ssh,telnet连接最大数量限制为10个,并且每分钟最多有5个可以连接:setsystemservicessshconnection-limit10rate-limit5 setsystemservicestelnetconnection-limit10rate-limit5以下特性JUNOS5.0以上支持:setsystemservicesroot-logindeny(禁止root远程登陆)setsystemservicesprotocol-versionv2(使用sshv2)三.配置系统日志服务:1.设置系统kernel级警告发到console上setsystemsyslogconsolekernelwarning2.配置登录系统日志到单独的auth.log文件中setsystemsyslogfileauth.logauthorizationinfo3.配置系统配置更改日志到单独的change.log文件中setsystemsyslogfilechange.logchange-loginfo4.配置系统所有日志到日志服务器setsystemsysloghostx.x.x.x.anyinfo四.路由策略安全1.配置以下保留地址的黑洞路由setrouting-optionsoptionsno-resolvesetrouting-optionsoptionssyslogleveldebugsetrouting-optionsstaticroute0.0.0.0/8discardsetrouting-optionsstaticroute10.0.0.0/8discardsetrouting-optionsstaticroute20.20.20.0/24discardsetrouting-optionsstaticroute127.0.0.0/8discardsetrouting-optionsstaticroute169.254.0.0/16discardsetrouting-optionsstaticroute172.16.0.0/12discardsetrouting-optionsstaticroute192.0.2.0/24discardsetrouting-optionsstaticroute192.168.0.0/16discardsetrouting-optionsstaticroute204.152.64.0/23discardsetrouting-optionsstaticroute224.0.0.0/4discard2.设置strict模式的unicastRPFsetinterfacesso-0/0/0unit0familyinetrpf-check3.设置相应prefix-list,禁止保留地址访问setpolicy-optionsprefix-listreserved0.0.0.0/8setpolicy-optionsprefix-listreserved10.0.0.0/8setpolicy-optionsprefix-listreserved20.20.20.0/24setpolicy-optionsprefix-listreserved127.0.0.0/8setpolicy-optionsprefix-listreserved169.254.0.0/16setpolicy-optionsprefix-listreserved172.16.0.0/12setpolicy-optionsprefix-listreserved192.0.2.0/24setpolicy-optionsprefix-listreserved204.152.64.0/23setpolicy-optionsprefix-listreserved224.0.0.0/4 setfirewallfilterinbound-filterterm1fromprefix-listreserved setfirewallfilterinbound-filterterm1thencountspoof-inbound-reserved setfirewallfilterinbound-filterterm1thendiscardsetinterfacesge-0/0/0unit0familyinetfilterinputinbound-filter五. Firewall-Policy设置Firewall-Policy可以限制进入及流量主机数据包的来源、目标地址、协议、端口号、流量等,应用Firewall-Policy可以实现类似于防火墙的性能,但一般不建议在骨干路由器上使用,以下是Firewall-Policy的使用方法:1.创建Firewall-Policy:setfirewallfilterlocal-sectermsec-in1fromdestination-porttelnet setfirewallfilterlocal-sectermsec-in1fromdestination-address172.16.0.1/32setfirewallfilterlocal-sectermsec-in1fromsource-address192.168.0.0/24 setfirewallfilterlocal-sectermsec-in1thenacceptsetfirewallfilterlocal-sectermsec-in2fromdestination-porttelnet setfirewallfilterlocal-sectermsec-in2fromdestination-address172.16.0.1/32setfirewallfilterlocal-sectermsec-in2thendiscardsetfirewallfilterlocal-sectermsec-in3fromsetfirewallfilterlocal-sectermsec-in1thenaccept2.应用到路由器的端口上:setinterfacesfxp0unit0familyinetfilterinputlocal-sec以上例子不允许除192.168.0.0/24网段外所有地址telnet访问172.16.0.1,但允许其它任何包通过。

juniper\cisco 的mpls-vpn配置简单比较zai cisco下ip vrf testrd 1:1route-target 1:1ip route vrf test 192.168.3.0 255.255.255.0 192.168.2.1interface fa0/0/0ip vrf forwarding testrouter bgp 1no bgp default ipv4-unicastno bgp default route-target filterneighbor 10.1.1.1 remote-as 2address-family vpn4neighbor 10.1.1.1 activeneighbor 10.1.1.1 send-community extendedaddress-family ipv4 vrf testredistribute staticredistribute connect在juniper下Edit routing-instances test #test是vpn的名字{instance-type vrf; #指定routing-instances为vrfroute-distinguisher 4809:1; #rdvrf-target target:4809:1; #rtset interface fe-0/0/0 # 相当于cisco下的interface fa0/0/0 ip vrf forw testset routing-options static route 192.168.3.0/24 next-hop 192.168.2.1 # 相当于cisco中的 ip route vrf}Bgp的配置set protocols bgp group vpn type internal # 因为是internal 所以不需要配置peer-asset protocols bgp group vpn local-address 192.168.0.1set protocols bgp group vpn neighbor 192.168.0.2 family inet-vpn unicast juniper下不需要配置重分发,因为当你在一个vpn下的路由协议起来之后他默认进行。

相关主题