以下は、規制されたIOS Telnetログインアクセスの例です。
以下は、IOS NTPコンフィグレーションの例です。
} user remotex {
full-name "radius group-user, super-user rights"; /*RADIUS super-user template grp*/
uid 2010;
class super-user;
}
user remotexx {
full-name "radius group-user, read rights";/* RADIUS show/noc template grp */
uid 2011;
class noc_grp;
} }
services { /* Allowed service, note that finger/tftp etc are not enable */
ssh;
telnet;
ftp; /* Note that JunOS use interactive FTP, not TFTP */
}
syslog { user * {
any alerts;/* Local message to vty, level Alerts and above */
}
console {
alerts;/* Local message to consol, level Alerts and above */
}
host 192.168.1.10 { /* Syslog server */
any any;/* All is sent to syslog server */
facility-override local1;/* Facility local1 will be used, since core router */
log-prefix Lunkan_home;/* All messagies will be added with prefix Lunkan_home */
}
file messages { any notice;
authorization info;
}
file cli_trace {
authorization any;/* All user logins log to local file on router */
interactive-commands any;/* All CLI actions log to local file on router */
archive size 50m files 2 world-readable; /* Local user log 50 Mb, with overwrite to backup file */
}‘‘‘
} ntp {
server 192.168.1.10;/* NTP server, peer is not used but can also/instead be used */
} }
chassis {
no-source-route;/* No ip source-routing */
}
protocols { bgp {
traceoptions {/* Start variables use when BGP monitoring */
file bgp;
flag state;
flag damping;
flag keepalive;
}
log-updown;/* Log message when adjencys flap */
} isis {
traceoptions {/* Start variables use when BGP monitoring */
file isis;
flag state;
flag hello;
}
以下は、JUNOS SNMPコンフィグレーションの例です。SNMPを通じて読み取りパーミッションだけが許可されて いる点に注意してください。
lo0インタフェース上にフィルタを設定することで、ルーティングエンジンへのトラフィックを制限することができま す(ルーティングエンジンへ転送されるすべてのトラフィック)。Juniperルーター上でこのようにトラフィックを制限 しても、パフォーマンスには影響しない点に注意してください。すべて拒否項目のため、コンフィグレーションが長く なっています。制限されていないアクセスを監視することができるように、ロギングが実行されます。望ましくないト ラフィックパターンを監視するためにサンプリングを設定し、制限されていないアクセスのイベントを検索するための 適度な詳細レベルを指定することができます。
snmp {
describtion "blaha";
location " In my home lab";
contact "lunkan@lunkan.net";
community read-only {
authorisation read-only;
clients {
192.168.1.10;/* NMS host, source address for snmp-get (UDP 161) allowed */
} }
trap-group ida { version all;
categories authentication chassis link routing /* SNMP Trap categories */
targets {
192.168.1.10; /*NMS host, destination for traps (UDP 162)*/
} } }
firewall {
filter access { term telnet_ok {
from {
source-address {
192.168.254/24; /* Telnet allowed from prefix and below host, ex a ssh/RADIUS server */
192.168.1.10/32;
}
protocol tcp;
destination-port telnet;
} then {
accept;
} }
term telnet-deny { from {
protocol tcp;
destination-port telnet;
} then {
count telnet_deny;/* Deny Telnet counted */
log;/* Deny Telnet log to var/log file */
discard;
}
}
term snmp_ok { from {
source-address { 192.168.254/24;
192.168.1.10/32;
}
protocol udp;
destination-port snmp;
} then {
accept;
} }
term snmp_deny { from {
protocol udp;
destination-port snmp;
} then {
count snmp_deny;
log;
discard;
} }
term ntp_ok { from {
source-address { 192.168.254/32;
192.168.1.10/32;
}
protocol udp;
destination-port ntp;
} then {
accept;
} }
term ntp_deny { from {
protocol udp;
destination-port ntp;
} then {
count ntp_deny;
log;
discard;
} }
term permit_any {/* So that BGP, IGP etc is accepted to RE */
then accept;
} } }
以下は、JUNOSのカウンタリストの例です。
以下は、ルーティングエンジンへ転送されるすべてのトラフィックに対して有効となるよう、(ループバックが設定さ れていない場合であっても)ループバックにフィルタを適用するJUNOSコンフィグレーションの例です。
以下は、特定の入力トラフィック(たとえば、相互接続点のインタフェースからのトラフィック)をフィルタする JUNOSコンフィグレーションの例です。この方式は、インタフェース上のIOSアクセスリストと同等です。
lab@M10-Oslo> show firewall filter access
Filter/Counter Packet count Byte count access
telnet_deny 0 0
snmp_deny 0 0
ntp_deny 0 0
lo0 {
unit 0 {
family inet { filter {
input access; /* Filter applied to logical interface (RE) */
}
address 1.1.1.1/32;
}
family iso {
address 47.0001.1921.6825.4254.00;
} } }
firewall {
filter access_2 { term martians {
from {
source-address {
127.0.0.0/8;/* rfc1918 denied routes */
10.0.0.0/8;
172.16.0.0/12;
192.168.0.0/16;
} then {
count martians;/* Reject counted */
reject administratively-prohibited; /* Reject and send ICMP messageÖ */
} }
term permit_any {/* Everything else is accepted */
then accept;
} } }
以下は、インタフェースにフィルタを適用するJUNOSコンフィグレーションの例です。
fe-0/3/3 { unit 0 {
family inet { filter {
input access_2;/* Filter inbound from ex GIX */
}
address 194.68.128.1/24;
} } }