CCNA試験対策 下巻ch7 Implementing DHCP
https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com
Dynamic Host Configuration Protocol
DHCP Concepts
- 4種類のメッセージ(DORA)をやりとりする
- IPアドレス未設定なのにIPパケットでメッセージをやり取りしなければならないという矛盾
- 下記アドレスを利用する:
- 0.0.0.0
- IPアドレス未設定の場合のsource IP address
- 255.255.255.255
- 今いるデータリンクでのブロードキャスト
- ルータは越えない
- 今いるデータリンクでのブロードキャスト
- 0.0.0.0
Supporting DHCP for Remote Subnets with DHCP Relay
- DHCPをどこで動かす
- DHCPをサーバで動かす場合、DHCP DiscoverブロードキャストをDHCPサーバまで届けるためにDHCP relayの設定が必要
- ルータで
from: 0.0.0.0 to: 255.255.255.255
のブロードキャストをfrom:ルータ to:DHCPサーバ
ユニキャストに詰め替える - interfaceの
ip helper-address
コマンド
- ルータで
Information Stored at the DHCP Server
- Acknowledgmentで返すための情報を設定しておく必要がある
- DHCPのIP割り当てモードは3種
- TFTPの設定とかも提供できる
Configuring DHCP Features on Routers and Switches
- DHCPサーバの設定
- 配布するIPアドレス最小値、デフォルトゲートウェイのアドレス、サブネットマスクの設定必須
Configuring DHCP Relay
Router(config)#interface range g0/0/0-1 Router(config-if-range)#no shutdown Router(config-if-range)#interface g0/0/0 Router(config-if)#ip address 172.16.1.1 255.255.255.0 Router(config-if)#interface g0/0/1 Router(config-if)#ip address 172.16.2.1 255.255.255.0 Router(config-if)#interface g0/0/0 Router(config-if)#ip helper-address 172.16.2.11 Router(config-if)#^Z
Router(config-if)#ip helper-address 172.16.2.11
Configuring a Switch as DHCP Client
- Switchの管理用IPアドレスの自動設定
Switch(config)#interface vlan 1 Switch(config-if)#ip address dhcp Switch(config-if)#no shutdown %LINK-5-CHANGED: Interface Vlan1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up %SYS-5-CONFIG_I: Configured from console by console %DHCP-6-ADDRESS_ASSIGN: Interface Vlan1 assigned DHCP address 172.16.1.52, mask 255.255.255.0, hostname Switch4
- 172.16.1.52が配られた
Switch#show dhcp lease Temp IP addr: 172.16.1.52 for peer on Interface: Vlan1 Temp sub net mask: 255.255.255.0 DHCP Lease server: 172.16.2.11 , state: Bound DHCP Transaction id: 104DA91E Lease: 86400 secs, Renewal: 43200 secs, Rebind: 75600 secs Temp default-gateway addr: 172.16.1.1 Next timer fires after: 11:55:38 Retry count: 0 Client-ID:cisco-0004.9AA3.4591-Vlan Client-ID hex dump: 636973636F2D303030342E394141332E 43539312D566C616E Hostname: Switch
Configuring a Router as DHCP Client
- WAN edgeルータでISPからパブリックIPアドレスとnext hopを配ってもらうようなケース
- administrative distance 254のstatic defaultルートが設定される
Identifying Host IPv4 Settings
Host Settings for IPv4
Host IP Settings on Windows
C:\>ipconfig /all FastEthernet0 Connection:(default port) Connection-specific DNS Suffix..: Physical Address................: 0007.EC70.C285 Link-local IPv6 Address.........: FE80::207:ECFF:FE70:C285 IP Address......................: 172.16.1.51 Subnet Mask.....................: 255.255.255.0 Default Gateway.................: 172.16.1.1 DNS Servers.....................: 0.0.0.0 DHCP Servers....................: 172.16.2.11 DHCPv6 Client DUID..............: 00-01-00-01-5D-A1-5D-94-00-07-EC-70-C2-85 ...
- また
netstat -rn
でルート一覧を見ることができる
C:\Users\wand>netstat -rn =========================================================================== インターフェイス一覧 4...00 15 5d 00 06 4c ......Hyper-V Virtual Ethernet Adapter #2 8...00 15 5d 00 06 4a ......Hyper-V Virtual Ethernet Adapter #3 15...4c ed fb 73 94 9b ......Realtek PCIe GbE Family Controller 1...........................Software Loopback Interface 1 20...00 15 5d 96 8c 20 ......Hyper-V Virtual Ethernet Adapter 32...00 15 5d 64 c2 ea ......Hyper-V Virtual Ethernet Adapter #4 =========================================================================== IPv4 ルート テーブル =========================================================================== アクティブ ルート: ネットワーク宛先 ネットマスク ゲートウェイ インターフェイス メトリック 0.0.0.0 0.0.0.0 192.168.3.1 192.168.3.3 25 10.0.75.0 255.255.255.0 リンク上 10.0.75.1 271 10.0.75.1 255.255.255.255 リンク上 10.0.75.1 271 10.0.75.255 255.255.255.255 リンク上 10.0.75.1 271 127.0.0.0 255.0.0.0 リンク上 127.0.0.1 331 127.0.0.1 255.255.255.255 リンク上 127.0.0.1 331 127.255.255.255 255.255.255.255 リンク上 127.0.0.1 331 172.18.208.0 255.255.240.0 リンク上 172.18.208.1 5256 172.18.208.1 255.255.255.255 リンク上 172.18.208.1 5256 172.18.223.255 255.255.255.255 リンク上 172.18.208.1 5256 172.19.96.0 255.255.240.0 リンク上 172.19.96.1 5256 172.19.96.1 255.255.255.255 リンク上 172.19.96.1 5256 172.19.111.255 255.255.255.255 リンク上 172.19.96.1 5256 192.168.3.0 255.255.255.0 リンク上 192.168.3.3 281 192.168.3.3 255.255.255.255 リンク上 192.168.3.3 281 192.168.3.255 255.255.255.255 リンク上 192.168.3.3 281 224.0.0.0 240.0.0.0 リンク上 127.0.0.1 331 224.0.0.0 240.0.0.0 リンク上 10.0.75.1 271 224.0.0.0 240.0.0.0 リンク上 192.168.3.3 281 224.0.0.0 240.0.0.0 リンク上 172.19.96.1 5256 224.0.0.0 240.0.0.0 リンク上 172.18.208.1 5256 255.255.255.255 255.255.255.255 リンク上 127.0.0.1 331 255.255.255.255 255.255.255.255 リンク上 10.0.75.1 271 255.255.255.255 255.255.255.255 リンク上 192.168.3.3 281 255.255.255.255 255.255.255.255 リンク上 172.19.96.1 5256 255.255.255.255 255.255.255.255 リンク上 172.18.208.1 5256 =========================================================================== 固定ルート: なし
Host IP Settings on macOS
ifconfig
netstat -rn
Host IP Settings on Linux
ifconfig
- よりモダンな
ip address
コマンドがある
- よりモダンな
netstat -rn
- よりモダンな
ip route
コマンドがある
- よりモダンな
CCNA試験対策 下巻ch14: WAN Architecture 2/2
https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com
Multiprotocol Label Switch (MPLS)
- SPからみたとき、全顧客のネットワークを同一のIPアドレス空間で管理するわけにはいかない
- たとえば
10.0.0.0/8
を全顧客ぶん同じIPアドレス空間で管理したら、ルーティングテーブルが甚大になる
- たとえば
- MPLSを利用することで顧客ごとにルートを別々に分けられる
- 【所感】IEE802.1Q trunkingのL3版みたいな
- L2.5プロトコルなどと呼ばれる
- L2ヘッダとL3ヘッダの間にMPLSヘッダを加えるから
- VPN実装のひとつ
MPLS VPN Physical Design and Topology
- MPLSはL3の技術なので、SPのネットワークについてrouterのことまで意識する必要が出てくる
- CE: Customer Edge
- PE: Provider Edge
- Access Link: CE-PE間のL3接続
- L2のUNIは何でも良いことになる
- 専用線
- Metro-E
- 4G/5G
- CATV
- L2のUNIは何でも良いことになる
MPLS and Quality of Service
- DSCP: Differentiated Services Code Point
- MPLS VPN上でも使えるよという話
Layer 3 with MPLS VPN
- MetroEはL2なので顧客のroutingのことなどは知ったこっちゃない
- MPLS VPNは真逆 -- CEルータ間のルーティング情報の学習の世話をする
- CE間はneighborではないのでPEがルーティング情報をadvertiseする(CE2-PE2-CE3)
- CE-PE間のBGPとPE-PE間のBGPが異なるのでルートの再配布(redistribution)が行われる(CE1-PE1-PE2-CE2,CE3)
- MPBGP: Multiprotocol BGP
Internet VPNs
Internet Access
- L2の接続方式
Digital Subscriber Line
- 上り/下り帯域幅がAsymmetricなもの=ADSL
- 敷設済の電話回線で高速なインターネットを提供できるので電話会社は潤った
- 中央局のDSLAM: DSL access multiplexerでデジタル信号とアナログ音声信号とを分離する
Cable Internet
- CATV
- DSLとそっくり
Wireless WAN (3G, 4G, LTE, 5G)
Fiber (Ethernet) Internet Access
Internet VPN Fundamentals
- Private WANのセキュリティ機能
- Confidentiality (privacy)
- 盗聴できない
- Authentication
- パケットの送信者の正当性
- Data integrity
- パケットが改竄されていない
- Anti-replay
- 正当なユーザにより送信されたパケットがコピーされ再送されるのを防ぐ
- Confidentiality (privacy)
- 同じものを安価なpublicネットワーク上で実現したい -- Internet VPN
Site-to-Site VPNs with IPsec
- 拠点-拠点間を1本のVPNトンネルで結び、拠点内のデバイスで共用する
- edgeルータで設定を行う
- IPsec
- フレームワークの構成要素
- ESP: Encapsulated Security Payload
- 暗号化
- AES, DESなどを選択
- AH: Authentication Header
- 認証
- SHA, MD5などを選択
- IKE: Internet Key Exchange
- 共通鍵(session key)の交換
- DH3,DH2,DH1などを選択
- ESP: Encapsulated Security Payload
- GRE: Generic Routing Encapsulation
- 暗号化をサポートしていないトンネリングプロトコル
- セキュアなSite-to-Site VPNを実現するにあたっては、GRE over IPsecのようなスタックを組む
Remote Access VPNs with TLS
CCNA試験対策 下巻ch14: WAN Architecture (1/2)
https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com
Metro Ethernet
Metro Ethernet Physical Design and Topology
- PoP: Point of Presence (接続点)
- 顧客の近くの物理的な接続点
- IEEE802.3仕様に縛られる
- 顧客の近くの物理的な接続点
- Access Link
- 顧客と通信事業者との間の物理的接続
- UNI: User-Network Interface (ユーザ・網インタフェース)
- SP網内部は見えない
- 802.1Q trunkingでVLANを切ってるんだろうけれど
- IEEE802.3仕様による伝送上限
Name | Speed | Distance (km) |
---|---|---|
100BASE-LX10 | 100 Mbps | 10 |
100BASE-LX | 1 Gbps | 5 |
100BASE-LX10 | 1 Gbps | 10 |
100BASE-ZX | 1 Gbps | 100 |
10GBASE-LR | 10 Gbps | 10 |
10GBASE-ER | 10 Gbps | 40 |
Ethernet WAN Services and Topologies
Ethernet Line Service (Point-to-Point)
- E-Lineとも
- 専用線のような感じ
- ある顧客の2拠点のルータ間は、1本のクロスオーバーケーブルで接続されているように振る舞う
- 同一サブネット
- ルーティングプロトコルのneighborになる
- EVC: Ethernet Virtual Connection
- E-Lineのtrunk link版みたいなやつ
- 例えばcentral site - remote site構成
- central siteから3本のE-Lineに繋ぐとき、WAN edgeのルータに物理Ethernet接続は3つ要らない。1つですむ
Ethernet LAN service (Full Mesh)
- full meshを組みたいときに
- nC2本のE-Lineを契約するのは酷なのでこういうサービスが提供される
Ethernet Tree Service (Hub and Spoke)
- partial meshを組む
- いろんな呼び方がある
- hub and spoke
- point-to-multipoint
- いろんな呼び方がある
- central site - remote sitesデザインで有用
Layer 3 Design Using Metro Ethernet
- 選定するMetroEサービスにより、WAN edgeルータのルーティングテーブルが変わってくる
Layer 3 Design with E-Line Service
- point-to-point
- E-Line1本ごとにサブネットを切る
Layer 3 Design with E-LAN Service
- E-LAN全体で1つのサブネット
CCNA試験対策 下巻ch13: LAN Architecture
https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com
Analyzing Campus LAN Topologies
Two-Tier Campus Design (Collapsed Core)
The Two-Tier Campus Design
- Access Switches
- PCやサーバといった末端機器が接続されるやつ
- Distribution Switches
Topology Terminology Seen Within a Two-Tier Design
- Two-Tier Designはそれ全体としてHybrid topology
- Access層: Star topology
- Distribution層: Partial Mesh topology
Three-Tier Campus Design (Core)
- 3つの建物それぞれでTwo-Tier Designでネットワーク構築することを考える
- 3つのネットワークをつなぎたい
- Distribution層どうしをフルメッシュで接続すると接続数が甚大になる
- Distribution層のスイッチ数をNとすると
N(N-1)/2
- Distribution層のスイッチ数をNとすると
- 建物間の接続は高くつきがちなので減らしたい
Distribution層どうしの接続はCore層を通すことで接続数を減らせる
- 図の例だと15 -> 12
Core層のスイッチは3つの建物のどれかに押し込むことが多い
Small Office/Home Office
- AP,Switch,Router,Firewall,Cable Modemもろもろ全部入りの機器を使ったりする
Power over Ethernet (PoE)
PoE Basics
- PSE: Power Source Equipment
- Switchとか
- PD: Powered Device
- IP電話とかAPとか
- メリット
- 電源のない場所に機器をおくときに有用
- ケーブルたくさん要らない
- DCを供給するので、PD側でAC/DC変換いらない
PoE Operation
- trunkなどよろしくautonegotiationがある
Name | Standard | Watts | Powererd Wire Pairs |
---|---|---|---|
Cisco Inline Power | Cisco | 7 | 2 |
PoE | 802.3af | 15 | 2 |
PoE+ | 802.3af | 30 | 2 |
UPoE | 802.3bt | 60 | 4 |
UPoE+ | 802.3bt | 100 | 4 |
PoE and LAN Design
- LANを構築する際、PoE込みでプランニングする必要がある
英語
- proximity
- 近接
- sift
- ふるいにかける
CCNA試験対策 下巻ch18: Understanding REST and JSON
https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com
REST-Based APIs
- REpresentational State Transfer
REST-Based (RESTful) APIs
- 6つの性質
- クライアント-サーバモデル
- ステートレス
- キャッシュ可能/不可能の明確な記述
- 統一的なインタフェース
- 階層構造
- Code-on-demand
- とくに最初の3つ
- HTTPは必須でないことに注意
REST APIs and HTTP
- HTTPは必須でないが、多くのRESTful APIはHTTP上で定義される
- なぜならばHTTPは…
- クライアント-サーバモデル
- 本質的にステートレス
- キャッシュ可能/不可能をHTTPヘッダで表現できる
Software CRUD Actions and HTTP Verbs
- 統一的なインタフェース
- HTTP各メソッドが対応しているという話
Using URIs with HTTP to Specify the Resource
- 階層構造
- URIのパス部分でリソースを表現することで実現できる
Data Serialization and JSON
The Need for a Data Model with APIs
- サーバとクライアントとで変数の内部表現が違うので必要
Data Serialization Languages
JSON
- JavaScript Object Notation
- 【補】JSON5なんてのが出てきていたりする
XML
YAML
CCNA試験対策 下巻ch4: Security Architectures
https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com
- Security Terminology
- Common Security Threats
- Controlling and Monitoring User Access
- Developing a Security Program to Educate Users
- 英語
Security Terminology
- セキュリティの必要性
- 閉じている系でさえ問題がおきる
- 機密を盗んだり
- 開いている系ではなおさら
- ワイヤレスAP
- 物理出社
- インターネット接続
- ビジネスパートナーのネットワーク接続
- 閉じている系でさえ問題がおきる
- 言葉の定義
- vulnerability
- 例: ドア
- たとえ鍵がかかっていても
- 例: ドア
- exploit
- 例: 鍵以外の、不正にドアを開ける道具 -- ピッキング道具など
- 特定のvulnerability以外には有効でないことが多い
- 例: 鍵以外の、不正にドアを開ける道具 -- ピッキング道具など
- threat
- 例: ピッキング道具を持った人
- mitigation techniques
- 例: ドアを頑丈にする、侵入検知アラームをつけるなど
- vulnerability
Common Security Threats
Attacks That Spoof Addresses
Denial-of-Service Attacks
- SYN-flood attackが有名
Reflection and Amplification Attacks
- 送信元アドレスを攻撃対象のものにspoofして間接的にパケットを送りつけるやつ
- amplification attack
Man-in-the-Middle Attacks
Reconnaissance Attacks
Buffer Overflow Attacks
- 任意のコードが実行されたりしてこわいやつ
Malware
Trojan Horse | Virus | Worm | |
---|---|---|---|
他のソフトウェアにこっそり同梱される | yes | no | no |
寄生する | no | yes | no |
増殖する | no | yes | yes |
Human Vulnerabilities
- social engineering
- phishing
- 政府などの大物狙いはwhalingとも
- pharming
- watering hole attack
Password Vulnerabilities
Password Alternatives
- パスワードはSYK (Something You Know)
- 多要素認証 -- SYH (Something You Have) や SYA (Something You Are)と組み合わせる
- SYHの例
- 短時間しか使えないトークン
- 証明書
- 期限がある
- revokeできる
- SYAの例
- 指紋
- 虹彩
Controlling and Monitoring User Access
- AAA
- Authentication
- 誰?
- Authorization
- 誰かはわかった。何を許可する?
- Accounting
- 何をした?
- Authentication
- 小規模ならばネットワーク機器自体に認証機能がある
- スケールするにはAAAサーバーを立てる
- AAAクライアントロールのSwitchはNAD(Network Access Device)またはNAS(Network Access Server)とよばれる
Developing a Security Program to Educate Users
- 盛り込むべき要素
- user awareness
- user training
- 定期的に実施すべき
- したがって企業のセキュリティポリシー自体定期的に見直すべき
- physical access control
- アクセスバッジはスケーラブルで、記録が残るので監査でも役立つ
英語
- pester
- 困らせる
- eavesdrop
- 盗聴する
- unwitting accomplice
- 無自覚の共犯者
- リフレクターとして加害者になってしまう側を指している
- 無自覚の共犯者
- reconnaissance
- 偵察
- disguised
- 偽装された
- watering hole
CCNA試験対策 下巻ch3: Advanced IPv4 Access Control Lists
https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com
- ACLは4つに大別される:
Numbered | Named | |
---|---|---|
Standard | ||
Extended |
- 本章ではStandard Numbered以外の3つを学ぶ
Extended Numbered IP Access Control Lists
- Standard Numbered ACLではsource IP addressしかマッチングに使えなかった
- Extendedではいろいろなフィールドを使える
Matching the Protocol, Source IP, and Destination IP
Matching TCP and UDP Port Numbers
Router(config)#access-list 101 permit ? ahp Authentication Header Protocol eigrp Cisco's EIGRP routing protocol esp Encapsulation Security Payload gre Cisco's GRE tunneling icmp Internet Control Message Protocol ip Any Internet Protocol ospf OSPF routing protocol tcp Transmission Control Protocol udp User Datagram Protocol Router(config)#access-list 101 permit tcp ? A.B.C.D Source address any Any source host host A single source host Router(config)#access-list 101 permit tcp host 1.1.1.1 ? A.B.C.D Destination address any Any destination host eq Match only packets on a given port number gt Match only packets with a greater port number host A single destination host lt Match only packets with a lower port number neq Match only packets not on a given port number range Match only packets in the range of port numbers Router(config)#access-list 101 permit tcp host 1.1.1.1 eq ? <0-65535> Port number ftp File Transfer Protocol (21) pop3 Post Office Protocol v3 (110) smtp Simple Mail Transport Protocol (25) telnet Telnet (23) www World Wide Web (HTTP, 80)
R2>telnet 10.1.1.254 Trying 10.1.1.254 ...Open Router>exit [Connection to 10.1.1.254 closed by foreign host]
- 任意のホストのEphemeral Portsから10.1.1.254の23番ポートへのinboundパケットをdenyする
- Ephemeral Portsの範囲は49251(0xBFFF)-65535
Router(config)#access-list 101 deny tcp any gt 49151 10.1.1.254 0.0.0.0 eq telnet Router(config)#int g0/0/0 Router(config-if)#ip access-group 101 in
- 繋がらなくなる
R2>telnet 10.1.1.254 Trying 10.1.1.254 ... % Connection timed out; remote host not responding
Extended IP ACL Configurations
- なるべくパケット送信元の近くでfilteringする
- 帯域節約のため
- 指定した条件すべてを満たすパケットだけがマッチする
- 100-199, 2000-2699番を使う
Extended IP Access Lists: Example 1
Router(config)#no access-list 101 Router(config)#access-list 101 deny tcp any gt 49151 10.1.1.254 0.0.0.0 eq 23 Router(config)#end Router#show running-config | section access-list access-list 101 deny tcp any gt 49151 host 10.1.1.254 eq telnet
- ポート番号を数値で指定してもconfig上ではテキスト版になる
23
->telnet
Extended IP Access Lists: Example 2
略
Practice Building access-list Commands
略
Named ACLs and ACL Editing
- ACLは書いた順番のfirst-matchなので行削除とかしたくなる
Named IP Access Lists
- 名前をつけてStandard/Extended ACLを作成できる
Router(config)#ip access-list ? extended Extended Access List standard Standard Access List Router(config)#ip access-list extended no-telnet
- 設定項目は
access-list
コマンドとおなじ
Router(config-ext-nacl)#deny tcp any ? A.B.C.D Destination address any Any destination host eq Match only packets on a given port number gt Match only packets with a greater port number host A single destination host lt Match only packets with a lower port number neq Match only packets not on a given port number range Match only packets in the range of port numbers Router(config-ext-nacl)#deny tcp any 10.0.0.254 0.0.0.0 eq telnet
Router(config)#interface g0/0/0 Router(config-if)#no ip access-group 101 in Router(config-if)#ip access-group ? <1-199> IP access list (standard or extended) WORD Access-list name Router(config-if)#ip access-group no-telnet ? in inbound packets out outbound packets Router(config-if)#ip access-group no-telnet in
Router#show running-config | section access-list access-list 101 deny tcp any gt 49151 host 10.1.1.254 eq telnet ip access-list extended no-telnet deny tcp any host 10.0.0.254 eq telnet
Editing ACLs Using Sequence Numbers
Router#show running-config | section access-list access-list 101 deny tcp any gt 49151 host 10.1.1.254 eq telnet ip access-list extended no-telnet deny tcp any host 10.0.0.254 eq telnet deny tcp any host 10.1.1.254 eq telnet
- 間違えてしまった1行目
deny tcp any host 10.0.0.254 eq telnet
を消したい
Router(config)#ip access-list extended no-telnet Router(config-ext-nacl)#do show ip access-lists no-telnet Extended IP access list no-telnet deny tcp any host 10.0.0.254 eq telnet deny tcp any host 10.1.1.254 eq telnet (12 match(es))
- 教科書的にはデフォルト10刻みの行番号が出てくるはずなのだが…Packet Tracerだからか出てこなかった
- 見えないが、行番号10で行を指定して消せる
Router(config-ext-nacl)#no 10 Router(config-ext-nacl)#do show ip access-lists no-telnet Extended IP access list no-telnet deny tcp any host 10.1.1.254 eq telnet (12 match(es))
- 行の内容の否定でも消せる
Router(config-ext-nacl)#permit ip any any Router(config-ext-nacl)#do show ip access-lists no-telnet Extended IP access list no-telnet deny tcp any host 10.1.1.254 eq telnet (12 match(es)) permit ip any any Router(config-ext-nacl)#no permit ip any any Router(config-ext-nacl)#do show ip access-lists no-telnet Extended IP access list no-telnet deny tcp any host 10.1.1.254 eq telnet (12 match(es))
- 行番号を指定して割り込むこともできる
Router(config-ext-nacl)#5 permit ip any any Router(config-ext-nacl)#do show ip access-lists no-telnet Extended IP access list no-telnet permit ip any any deny tcp any host 10.1.1.254 eq telnet (12 match(es)) Router(config-ext-nacl)#no 5 Router(config-ext-nacl)#do show ip access-lists no-telnet Extended IP access list no-telnet deny tcp any host 10.1.1.254 eq telnet (12 match(es))
Numbered ACL Configuration Versus Named ACL Configuration
Router(config)#ip access-list standard 1 Router(config-std-nacl)#permit any Router(config-std-nacl)#do show ip access-lists 1 Standard IP access list 1 permit any
Router#show running-config | section access-list access-list 101 deny tcp any gt 49151 host 10.1.1.254 eq telnet ip access-list extended no-telnet deny tcp any host 10.1.1.254 eq telnet access-list 1 permit any
- numbered ACLもnamed ACLと同様にaccess-listコンフィグモードで設定できる
- が、configファイル上ではグローバルコンフィグのaccess-listコマンドの形で保存される
ACL Implementation Considerations
- extended ACLはなるべくパケット送信元の近くに配置する
- パケットを早期に廃棄できるよう
- standard ACLはなるべくパケット宛先の近くに配置する
- 意図せず、廃棄する必要のないパケットまで廃棄してしまうミスを防止するため
- source IP addressしか設定できないので起こりやすい
- 意図せず、廃棄する必要のないパケットまで廃棄してしまうミスを防止するため
- 条件の狭いものから順に書く
- ACLに変更を加える前に、interfaceコンフィグモードの
no ip access-group
コマンドで当該ACLを無効化する
Router(config-std-nacl)#do show running-config | section interface GigabitEthernet0/0/0 interface GigabitEthernet0/0/0 ip address 10.1.1.254 255.255.255.0 ip access-group hoge in duplex auto speed auto Router(config-std-nacl)#do show ip access-list hoge Standard IP access list hoge
R2>ping 10.1.1.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.254, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
- 何かルールを追加した瞬間に、暗黙のdeny anyでpingが通らなくなる
Router(config-std-nacl)#permit 1.1.1.1
R2>ping 10.1.1.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.254, timeout is 2 seconds: UUUUU Success rate is 0 percent (0/5)