勉強日記

チラ裏

CCNA試験対策 下巻ch8: DHCP Snooping and ARP Inspection (1/2)

https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com


DHCP Snooping

DHCP Snooping Concepts

  • L2ポート上で動作するACLFirewallのような機能
    • DHCP自体はL3で動作することに注意
  • DHCP Snoopingではポートを2つに分類する
    • trusted
      • switch,router,DHCPサーバなどが繋がっているポート
    • untrusted
      • PC、APなどが繋がっているポート
  • DHCP Snooping概略
    • untrustedポートに、通常DHCPサーバから送られるメッセージが入ってきたら破棄する
      • DHCPOFFER, DHCPACKなど
    • untrustedポートに、通常DHCPクライアントから送られるメッセージが入ってきたら、攻撃の疑いのある場合破棄する
      • DHCPDISCOVERなど
    • trustedポートは素通り

A Sample Attack: A Spurious DHCP Server

f:id:wand_ta:20200623084040p:plain

DHCP Snooping Logic

f:id:wand_ta:20200623084231p:plain

  • untrustedポートに入ってくるフレームを検査する
    • 通常サーバーから送られるメッセージ: 破棄
      • OFFER, ACK
    • 通常クライアントから送られるメッセージ:
      • DISDOVER,REQUESTはMACアドレスをチェックする
      • RELEASE,DECLINEはinterface,IPアドレスDHCP Snooping binding tableとを突き合わせる
        • 悪いclientによって勝手にIPアドレスが返却されないよう
        • DHCP Snooping binding tableはleaseのたびに更新

Filtering DISCOVER Messages Based on MAC Address

  • 攻撃
    • IPアドレスプール枯渇攻撃
      • 悪いclientがCHADDR(client hardware address)フィールドを詐称して大量のREQUESTを送りつけ、IPアドレスをすべてleaseしてしまう
  • 対策
      • DISDOVER,REQUESTについてはIEEE802.3 Frameのsource MACフィールドと照合して、攻撃の疑いのあるフレームを破棄する

Filtering Messages that Release IP Addresses

  • 攻撃
  • 対策
    • RELEASE,DECLINEについてはDHCP Snooping binding tableとの照合を行う
    • DHCP Snooping binding table
      • どのMAC,VLAN,interfaceのデバイスにどのIPアドレスをリースしました、というテーブル
      • 異なるinterfaceからのRELEASE等については破棄する

DHCP Snooping Configuration

Configuring DHCP Snooping on a Layer 2 Switch

f:id:wand_ta:20200626044702p:plain

  • 設定
Switch(config)#ip dhcp snooping vlan 1
Switch(config)#no ip dhcp snooping information option
Switch(config)#interface g0/1
Switch(config-if)#ip dhcp snooping trust
  • DHCP Snoopingの状態確認
Switch#show ip dhcp snooping
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs:
1
Insertion of option 82 is disabled
Option 82 on untrusted port is not allowed
Verification of hwaddr field is enabled
Interface                  Trusted    Rate limit (pps)
-----------------------    -------    ----------------
GigabitEthernet0/1         yes        unlimited       
FastEthernet0/1            no         unlimited       
FastEthernet0/2            no         unlimited       
  • Option 82 on untrusted port is not allowed
    • no ip dhcp snooping information option が反映されている
  • 何これ
    • DHCP relay agentがbroadcastをunicastに詰め替えるときに付与されるフィールド
      • RFC3046
    • L3SWのときに有効にすべき設定
    • 今回はL2SWなので切る
  • DHCP Spoofingして動作検証してみる

f:id:wand_ta:20200626044716p:plain

  • DHCP Snoopingを設定していないとき

from PC0

C:\>ipconfig /renew

   IP Address......................: 10.0.1.53
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 10.0.1.49
   DNS Server......................: 255.255.255.252
C:\>ipconfig /renew

   IP Address......................: 10.0.1.53
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 10.0.1.1
   DNS Server......................: 255.255.255.252

Limiting DHCP Message Rates

  • DHCP snoopingは汎用CPUを食うのでそれ自体が攻撃対象になりうる
  • この対策として、DHCPのレートリミット機能がある
    • switch-port securityよろしく、portをerr-disabledにする
Switch(config-if)#ip dhcp snooping limit rate 10
Switch(config-if)#int f0/1
Switch(config-if)#ip dhcp snooping limit rate 2
Switch(config-if)#int f0/2
Switch(config-if)#ip dhcp snooping limit rate 2
Switch#show ip dhcp snooping
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs:
1
Insertion of option 82 is disabled
Option 82 on untrusted port is not allowed
Verification of hwaddr field is enabled
Interface                  Trusted    Rate limit (pps)
-----------------------    -------    ----------------
FastEthernet0/2            no         2               
FastEthernet0/1            no         2               
GigabitEthernet0/1         yes        10              
  • errdisable recovery global configコマンドで自動復旧も設定できるらしいがPacket Tracerでは動作しなかった

英語

  • backdrop
    • 背景
  • spurious
    • 偽の
      • legitimate(正当な)の対義のように用いられている

CCNA試験対策 下巻ch6: Implementing Switch Port Security

https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com


Port Security Concepts and Configuration

  • switchのポートごとに、Ehternetフレームのsource MAC addressに基づいて機器の接続を制限する

Configuring Port Security

f:id:wand_ta:20200622080653p:plain

static

SW1(config)#interface f0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security mac-address 0200.1111.1111
SW1(config-if)#description static

sticky

  • staticでは大量の機器を登録するのが大変なときに使う
SW1(config-if)#interface f0/2
SW1(config-if)#switchport mode access
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security mac-address sticky
SW1(config-if)#description sticky
  • switchport port-security mac-address sticky設定直後
SW1#show running-config 
...
interface FastEthernet0/2
 description sticky
 switchport mode access
 switchport port-security
 switchport port-security mac-address sticky 
!
...
  SW1#show running-config 
  ...
  interface FastEthernet0/2
   description sticky
   switchport mode access
   switchport port-security
   switchport port-security mac-address sticky 
+  switchport port-security mac-address sticky 0200.2222.2222
  !
  ...
  • startup-configには反映されないので適宜copy running-config startup-configする必要がある

dynamic

SW1(config-if)#interface f0/3
SW1(config-if)#switchport mode access
SW1(config-if)#switchport port-security
SW1(config-if)#description dynamic

SW1(config-if)#interface f0/4
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security maximum 8
SW1(config-if)#description maximum 8
  • 最大接続可能台数で縛る
    • デフォルト1
    • 接続可能な機器は動的にきまる
  • VoIPの場合は2を設定する
    • 電話で1 (voice)、その先のPCで1 (access)
  • EtherChannelの場合は、物理interfaceではなくport channelに対してmaximumを設定する

Verifying Port Security

SW1#show port-security interface f0/1
Port Security              : Enabled
Port Status                : Secure-up
Violation Mode             : Shutdown
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 1
Total MAC Addresses        : 1
Configured MAC Addresses   : 1
Sticky MAC Addresses       : 0
Last Source Address:Vlan   : 0200.1111.1111:1
Security Violation Count   : 0
  • stickyの場合、stickyで設定されたMACアドレス数が集計される
SW1#show port-security interface f0/2
Port Security              : Enabled
Port Status                : Secure-up
Violation Mode             : Shutdown
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 1
Total MAC Addresses        : 1
Configured MAC Addresses   : 0
Sticky MAC Addresses       : 1
Last Source Address:Vlan   : 0200.2222.2222:1
Security Violation Count   : 0
  • dynamicの場合
SW1#show port-security interface f0/4
Port Security              : Enabled
Port Status                : Secure-up
Violation Mode             : Shutdown
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 8
Total MAC Addresses        : 5
Configured MAC Addresses   : 0
Sticky MAC Addresses       : 0
Last Source Address:Vlan   : 00E0.B05A.6D01:1
Security Violation Count   : 0

Total MAC Addresses : 5

  • 【疑問点】PCは4台しか繋いでいないのだが…
    • CDPか何かでのトラフィックでswitchのぶんも数えられている?詳細不明

Port Security MAC Addresses

Switch#show mac address-table 
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----

   1    0030.a3a5.4904    DYNAMIC     Fa0/1
  • TypeはDYNAMICとなる
  • 対して、port securityを設定した場合:
SW1#show mac address-table 
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----

   1    0001.438c.c589    STATIC      Fa0/4
   1    0002.1730.086b    STATIC      Fa0/4
   1    0003.e45c.894a    STATIC      Fa0/4
   1    0030.a3a0.a16b    STATIC      Fa0/4
   1    00e0.b05a.6d01    STATIC      Fa0/4
   1    0200.1111.1111    STATIC      Fa0/1
   1    0200.2222.2222    STATIC      Fa0/2
   1    0200.3333.3333    STATIC      Fa0/3
SW1#show mac address-table dynamic 
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
  • MACアドレステーブルは全部STATICになる
    • たとえstickyやdynamicを設定したとしても

Port Security Violation Modes

  • port securityのルールが破られたときにどうするか設定できる
Protect Restrict Shutdown(デフォルト)
トラフィックを破棄 o o o
ログとSNMPメッセージ送出 x o o
当該interfaceをshutdown x x o

Port Security Shutdown Mode

  • f0/3 (dynamic, maximum 1) のところに2台繋いでみる

f:id:wand_ta:20200622081142p:plain

%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to administratively down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
  • f0/3がdown downになる
SW1#show ip interface brief 
Interface              IP-Address      OK? Method Status                Protocol 
FastEthernet0/1        unassigned      YES manual up                    up 
FastEthernet0/2        unassigned      YES manual up                    up 
FastEthernet0/3        unassigned      YES manual down                  down 
FastEthernet0/4        unassigned      YES manual up                    up 
FastEthernet0/5        unassigned      YES manual down                  down 
...
  • ステータスはerr-disabled
SW1#show interfaces f0/3 status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/3                        err-disabled 1          auto    auto  10/100BaseTX
  • port-securityルール違反の統計情報も見られる
SW1#show port-security 
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
               (Count)       (Count)        (Count)
--------------------------------------------------------------------
        Fa0/1        1          1                 0         Shutdown
        Fa0/2        1          1                 0         Shutdown
        Fa0/3        1          0                 1         Shutdown
        Fa0/4        8          1                 0         Shutdown
----------------------------------------------------------------------
SW1#show port-security interface f0/3
Port Security              : Enabled
Port Status                : Secure-shutdown
Violation Mode             : Shutdown
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 1
Total MAC Addresses        : 0
Configured MAC Addresses   : 0
Sticky MAC Addresses       : 0
Last Source Address:Vlan   : 000A.418E.D86B:1
Security Violation Count   : 1
  • err-disabled状態から復旧するには当該interfaceで shutdown/no shutdown

Port Security Protect and Restrict Modes

SW1(config)#int f0/1
SW1(config-if)#
SW1(config-if)#switchport port-security violation protect
  • f0/1に、許可されているMACアドレス以外の機器を繋いでみる

f:id:wand_ta:20200622081346p:plain

  • protectモードを設定したので、port-securityルール違反のトラフィックは破棄しつつ、interfaceはup-upのままとなる
  • PC5 (172.16.1.51)からPC0(172.16.1.3)へpingを試みる
Pinging 172.16.1.3 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 172.16.1.3:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
  • Switch0 f0/0でブロックされるので到達しない
  • Server0 (172.16.1.1)からPC0(172.16.1.3)にpingは通る
C:\>ping 172.16.1.3

Pinging 172.16.1.3 with 32 bytes of data:

Reply from 172.16.1.3: bytes=32 time=1ms TTL=128
Reply from 172.16.1.3: bytes=32 time<1ms TTL=128
Reply from 172.16.1.3: bytes=32 time<1ms TTL=128
Reply from 172.16.1.3: bytes=32 time<1ms TTL=128

Ping statistics for 172.16.1.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms
  • Switch0を経由しないPC5 -> Server0は通る
C:\>ping 172.16.1.1

Pinging 172.16.1.1 with 32 bytes of data:

Reply from 172.16.1.1: bytes=32 time<1ms TTL=128
Reply from 172.16.1.1: bytes=32 time<1ms TTL=128
Reply from 172.16.1.1: bytes=32 time=3ms TTL=128
Reply from 172.16.1.1: bytes=32 time<1ms TTL=128

Ping statistics for 172.16.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 3ms, Average = 0ms

CCNA試験対策 下巻ch5: Securing Network Devices

https://www.ciscopress.com/store/ccna-200-301-official-cert-guide-volume-2-9781587147135www.ciscopress.com


Securing IOS Passwords

  • AAAサーバがあればそれを使いましょう
  • 以下、ない場合の話

note

  • transport input sshtelnet禁止、sshのみ許可することを検討しよう
    • デフォルトall
    • telnetは平文のパスワードが流れてしまう

Encrypting Older IOS Passwords with service password-encryption

  • passwordで設定したパスワードはconfig内に平文で保存される
sw2#show running-config | section line vty 0
line vty 0
 password Cisco
 login
  • service password-encryption でconfig内のパスワードを暗号化できる
sw2(config)#service password-encryption
sw2(config)#end

%SYS-5-CONFIG_I: Configured from console by console

sw2#show running-config | section line vty 0
line vty 0
 password 7 0822455D0A16
 login
sw1>telnet 10.0.0.2
Trying 10.0.0.2 ...Open


User Access Verification

Password: (cisco)
sw2>
  • ただし、簡単に復号できてしまい、強度はよろしくない

Encoding the Enable Passwords with Hashes

  • enable passwordの代わりにenable secret使え

Interactions Between Enable Password and Enable Secret

  • enable passwordenable secret両方設定した場合、enable secretが勝つ
sw2(config)#enable password hoge
sw2(config)#enable secret piyo
sw2(config)#^Z
sw2#
%SYS-5-CONFIG_I: Configured from console by console

sw2#
sw2#show running-config | section enable
enable secret 5 $1$mERr$8uVJh5HjzLjx/K599zVX00
enable password 7 082943490C
sw2#exit

sw2>enable
Password: (piyo)
sw2#

Making the Enable Secret Truly Secret with a Hash

Improved Hashes for Cisco's Enable Secret

sw2(config)#enable secret ?
  0      Specifies an UNENCRYPTED password will follow
  5      Specifies an ENCRYPTED secret will follow
  LINE   The UNENCRYPTED (cleartext) 'enable' secret
  level  Set exec level password
enable secret <type> piyo
enable algorithm-type <algorithm-type> secret piyo
  • 【補】PacketTracerでは後者の書き方はできなかった
  • 指定しない場合デフォルトMD5
<algorithm-type> <type> Algorithm
0 平文
md5 5 MD5
sha256 8 SHA-256
scrypt 9 SHA-256

Encoding the Passwords for Local Usernames

sw2(config)#username foo secret bar
sw2(config)#line vty 0
sw2(config-line)#login local
  • enable同様

Controlling Password Attacks with ACLs

  • access-classACLを設定できる
sw2(config)#line vty 0
sw2(config-line)#access-class 1 in

sw2(config)#access-list 1 permit 10.0.0.1 0.0.0.0
  • SW1 (10.0.0.1)からはtelnet接続可能
sw1#telnet 10.0.0.2
Trying 10.0.0.2 ...Open


User Access Verification

Username: foo
Password: (bar)
sw2>exit
  • SW3 (10.0.0.3)からはtelnet接続不可能
sw3#ping 10.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms

sw3#telnet 10.0.0.2
Trying 10.0.0.2 ...Open

[Connection to 10.0.0.2 closed by foreign host]
sw3#
  • access-classコマンドでoutを指定すると、telnet/ssh接続先に基づいてマッチングが行われることに注意

Firewalls and Intrusion Prevention Systems

Traditional Firewalls

  • ACLと似ているところ
  • ACLと異なるところ
  • アプリケーション層の知識ももつ
  • ステートフル
    • 履歴情報に基づいて、「少数のクライアントから大量のTCP接続要求が来ているのでDoSだな」といったことがわかる

Security Zones

  • 「社内から外側へTCPコネクションを張る(initiate)のは許可する」(outbound)
  • 「外側から社内へ張るのは禁止する」(inbound)
  • といったときの「内側」をZone Inside、「外側」をZone Outside という
  • Webブラウザのようなinboundアクセスを許可しなければならないものは Zone DMZ: Demilitarized Zoneに置く
    • DMZから社内へのコネクションは禁止する

Intrusion Prevention Systems (IPS)

  • ACLFirewallとはパケットのフィルタリングロジックが異なる
  • exploit signaturesデータベースに照らして、ロギング、パケットの破棄、追調査などを行う
  • アンチウイルスソフトと似ているが、ネットワーク上でパケットの破棄を行うので、より迅速に新型の脅威に対応できうる

Cisco Next-Generation Firewalls

  • AVC: Application Visibility and Control
    • well-knownポートをふさぐだけでは、攻撃者はポートスキャンを仕掛けて侵入を試みてくる
    • NGFWではポート番号ではなくアプリケーション層のデータに基づいて判断するように
  • Advanced Malware Protection
  • URL Filtering
  • NGIPS (Next-Generation IPS)
    • NGIPS連携

Cisco next-generation IPS

  • AVC
  • Contextual Awareness
    • 従来のIPSではセキュリティイベント通知が膨大すぎて、読むのが困難だった
    • NGFWからホストの情報を受け取り、その情報に基づいて実際に問題となる脆弱性に絞ることで、通知を大幅に減らせるように
  • Reputation-Based Filtering
  • Event Impact Level

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)をやりとりする
    • Discover
      • client -> server
      • DHCPサーバを探す
    • Offer
      • server -> client
      • ぼくDHCPサーバです
    • Request
      • client -> server
      • (OfferでリストされているIPv4アドレスの中から)IPv4アドレスをください
    • Acknowledgment
      • server -> client
      • アドレス、マスク、デフォルトルータ、DNSサーバのIPアドレスを教える
  • IPアドレス未設定なのにIPパケットでメッセージをやり取りしなければならないという矛盾
  • 下記アドレスを利用する:
    • 0.0.0.0
    • 255.255.255.255
      • 今いるデータリンクでのブロードキャスト
        • ルータは越えない

Supporting DHCP for Remote Subnets with DHCP Relay

  • DHCPをどこで動かす
    • ルータ
    • サーバに一元化
      • Ciscoのドキュメント的にはこちらがベストプラクティス
  • 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で返すための情報を設定しておく必要がある
    • Subnet ID and mask
    • Reserved (excluded) addresses
    • Default router(s)
    • DNS IP address(es)
  • DHCPのIP割り当てモードは3種
    • Dynamic
      • いなくなったら回収する
    • Automatic
      • 配ったら回収せず永久にそのまま
    • Static
  • TFTPの設定とかも提供できる

Configuring DHCP Features on Routers and Switches

f:id:wand_ta:20200622022310p:plain

f:id:wand_ta:20200622022320p:plain

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
  • DHCP relay設定部分
    • ブロードキャストをDHCPサーバへのユニキャストに詰め替える
Router(config-if)#ip helper-address 172.16.2.11

Configuring a Switch as DHCP Client

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実装のひとつ
    • データを暗号化するタイプのVPNもある
    • 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は何でも良いことになる

MPLS and Quality of Service

  • DSCP: Differentiated Services Code Point
    • IPヘッダのToSフィールドに設定するQoS用の値(6bit)
    • VoIPならEF: Expedited Forwardingを設定する
  • MPLS VPN上でも使えるよという話

Layer 3 with MPLS VPN

  • MetroEはL2なので顧客のroutingのことなどは知ったこっちゃない
  • MPLS VPNは真逆 -- CEルータ間のルーティング情報の学習の世話をする

f:id:wand_ta:20200621032650p:plain

  • CE間はneighborではないのでPEがルーティング情報をadvertiseする(CE2-PE2-CE3)
  • CE-PE間のBGPとPE-PE間のBGPが異なるのでルートの再配布(redistribution)が行われる(CE1-PE1-PE2-CE2,CE3)
    • MPBGP: Multiprotocol BGP

Internet VPNs

  • 顧客のネットワーク-ISPのネットワーク間、ならびにISPのネットワークどうしが接続されることでWWWを形成する
  • コスト面やどこでも使えることなどから、企業がWANとしてインターネットを使うように

Internet Access

  • L2の接続方式

Digital Subscriber Line

  • 上り/下り帯域幅がAsymmetricなもの=ADSL
  • 敷設済の電話回線で高速なインターネットを提供できるので電話会社は潤った
  • 中央局のDSLAM: DSL access multiplexerでデジタル信号とアナログ音声信号とを分離する

Cable Internet

  • CATV
  • DSLとそっくり

Wireless WAN (3G, 4G, LTE, 5G)

  • 携帯電話とかがこれ
  • 電波塔からルーターを経てMobile ProviderもしくはISP

Fiber (Ethernet) Internet Access

  • ここまでに挙げたもの
    • DSL, CATVは銅線
    • WirelessはWireless
  • 光ファイバーという選択肢
    • 高価かつ敷設に時間がかかるが高速

Internet VPN Fundamentals

  • Private WANのセキュリティ機能
    • Confidentiality (privacy)
      • 盗聴できない
    • Authentication
      • パケットの送信者の正当性
    • Data integrity
      • パケットが改竄されていない
    • Anti-replay
      • 正当なユーザにより送信されたパケットがコピーされ再送されるのを防ぐ
  • 同じものを安価な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などを選択
  • 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

  • MetroEとも
  • 提供するサービス
    • 顧客-ISP間の接続
    • 顧客-顧客間のEthernet Frameの伝送
  • 概念的には巨大なL2スイッチ

Metro Ethernet Physical Design and Topology

  • PoP: Point of Presence (接続点)
    • 顧客の近くの物理的な接続点
  • Access Link
    • 顧客と通信事業者との間の物理的接続
  • UNI: User-Network Interface (ユーザ・網インタフェース)
    • 顧客と通信事業者との間を接続するインタフェース仕様
    • ISDNとかFTTHとかそういうの
  • 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)

f:id:wand_ta:20200621004058p:plain

  • 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)

f:id:wand_ta:20200621004120p:plain

  • full meshを組みたいときに
  • nC2本のE-Lineを契約するのは酷なのでこういうサービスが提供される

Ethernet Tree Service (Hub and Spoke)

f:id:wand_ta:20200621004137p:plain

  • 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

f:id:wand_ta:20200620204745p:plain

  • Access Switches
    • PCやサーバといった末端機器が接続されるやつ
  • Distribution Switches
    • Access Switches間の通信経路の提供
      • Access Switchesどうしは直接接続していない
    • Access Switchesは冗長性のために2つ以上のDistribution SwitchesへのUplinkを形成するのがふつう
    • 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つのネットワークをつなぎたい

f:id:wand_ta:20200620204700p:plain

  • Distribution層どうしをフルメッシュで接続すると接続数が甚大になる
    • Distribution層のスイッチ数をNとすると N(N-1)/2
  • 建物間の接続は高くつきがちなので減らしたい

f:id:wand_ta:20200620204727p:plain

  • 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
  • メリット
    • 電源のない場所に機器をおくときに有用
    • ケーブルたくさん要らない
    • 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込みでプランニングする必要がある
    • PD
      • Power Requirementsを考慮して機器を選定する
    • Power Requirements
      • 各wiring closetで必要な電力は? (power budget)
    • Switch Ports
      • 全ポートがPoE対応とは限らない
    • Switch Power Supplies
      • PoEを使わなければSwitchに供給する電力はそのSwitch自身が消費する分だけ
      • PoEを使う場合、SwitchはPSEになるので、ぶら下がるPDぶんの電力が余分に必要になる
    • PoE Standards versus Actual
      • PoE+対応だが実際には9Wしか使わない、とかがある

英語

  • proximity
    • 近接
  • sift
    • ふるいにかける