2015年11月29日日曜日

.1Qイン.1Q ACLからDHCPまで

いつもお世話になっているイージスさんから。

IEEE802.1q トンネリング
ダブルタグ

なる手法のお話。WANサービスについて部分的に言及なさっているが、キャリアの仕様がユーザに明かされることはないので、詳細は、当該サービスの関係者でないと知りようがない。誤3 blog 程度なここでは無縁の世界。

ただ、毎度毎度の乱筆メモの程度で書くなら。

・IEEE802.1ad
・スタックするので1522オーバーの対応必須
・トンネリングとはいってもカプセル化はしてない
・現在は MAC in MAC のさらに先

メモ錯ではないWebコンテンツはこちら。

IEEE802.1adについて NTTから
http://www.ntt.co.jp/journal/0601/files/jn200601054.pdf

Road to ネットワークスペシャリスト
http://ipnetwork.web.fc2.com/spb/spbm.html


さておきACL。

・試験における格言らしき
標準ACLは宛先に近い場所に設定、拡張ACLは送信元に近い場所に設定するのが推奨

お作法というやつ。

・ワイルドカードの解説は厳密には…

厳密に書こうとしたら恐ろしく面倒、且つ教えた/おぼえたところで全く実践的でないという点でたいへんに共感。

 ・番号付き拡張ACLは100-199と2000-2699

2000番台は書いたことがない、2000-2699か。

 ・gt と lt そして neq と range

gt は何かで書いたおぼえがうっすらと。range は けっこう機会があった。neq は自分が設定どうこう以前に、目にしたことさえただの一度もない。

・established は RSTパケットも対象。

知らんかった。。。


・名前付き拡張ACLのシーケンス番号は10,20…

名前付きを一から書いたことがないので練習。

Router-ACL(config)#ip access-list ?
  extended    Extended Access List
  helper      Access List acts on helper-address
  log-update  Control access list log updates
  logging     Control access list logging
  resequence  Resequence Access List
  standard    Standard Access List

Router-ACL(config)#ip access-list ex
Router-ACL(config)#ip access-list extended tutorial
Router-ACL(config-ext-nacl)#permit tcp 172.16.1.0 0.0.0.255 any neq 445 established log

(略)


番号は accesss-list うんちゃらだが、名前付きは ip access-list extentedである点も知らなかった。

・show プロトコル access-list
・show interfaceから見るACL状況

・拡張アクセスリスト(番号)に挿入可能
・ip access-list extented から no sequence-number で部分削除も可能

・access-class をアウトバウンドで使用すると宛先のチェックになる!!!


自分が浅はか過ぎていろいろヤバイ。。


DHCPについて

Discover
Offer
Request
ACK

クライアントはブロードキャスト、サーバはユニキャスト。当たり前のことだが「えっと」 と間を置かないと出てこない時点でショボイ。


・DHCPはコンフィグに見えないがserviceとして扱われている

L3-PrivateVLAN(config)#no service ?
  compress-config        Compress the configuration file
  config                 TFTP load config files
  dhcp                   Enable DHCP server and relay agent
  disable-ip-fast-frag   Disable IP particle-based fast fragmentation
  exec-callback          Enable exec callback
  exec-wait              Delay EXEC startup on noisy lines
  finger                 Allow responses to finger requests
  hide-telnet-addresses  Hide destination addresses in telnet command
  linenumber             enable line number banner for each exec
  nagle                  Enable Nagle's congestion control algorithm
  old-slip-prompts       Allow old scripts to operate with slip/ppp
  pad                    Enable PAD commands
  password-encryption    Encrypt system passwords
  password-recovery      Disable password recovery
  prompt                 Enable mode specific prompt
  pt-vty-logging         Log significant VTY-Async events
  sequence-numbers       Stamp logger messages with a sequence number
  slave-log              Enable log capability of slave IPs
  tcp-keepalives-in      Generate keepalives on idle incoming network
                         connections
  tcp-keepalives-out     Generate keepalives on idle outgoing network
                         connections
  tcp-small-servers      Enable small TCP servers (e.g., ECHO)
  telnet-zeroidle        Set TCP window 0 when connection is idle
  timestamps             Timestamp debug/log messages
  udp-small-servers      Enable small UDP servers (e.g., ECHO)

L3-PrivateVLAN(config)#no service


Router(config)#no service ?
  alignment              Control alignment correction and logging
  call-home              Enable call-home service
  compress-config        Compress the nvram configuration file
  config                 TFTP load config files
  counters               Control aging of interface counters
  dhcp                   Enable DHCP server and relay agent
  disable-ip-fast-frag   Disable IP particle-based fast fragmentation
  exec-callback          Enable exec callback
  exec-wait              Delay EXEC startup on noisy lines
  finger                 Allow responses to finger requests
  hide-telnet-addresses  Hide destination addresses in telnet command
  linenumber             enable line number banner for each exec
  nagle                  Enable Nagle's congestion control algorithm
  old-slip-prompts       Allow old scripts to operate with slip/ppp
  pad                    Enable PAD commands
  password-encryption    Encrypt system passwords
  prompt                 Enable mode specific prompt
  pt-vty-logging         Log significant VTY-Async events
  sequence-numbers       Stamp logger messages with a sequence number
  slave-log              Enable log capability of slave IPs
  tcp-keepalives-in      Generate keepalives on idle incoming network
                         connections
  tcp-keepalives-out     Generate keepalives on idle outgoing network
                         connections
  tcp-small-servers      Enable small TCP servers (e.g., ECHO)
  telnet-zeroidle        Set TCP window 0 when connection is idle
  timestamps             Timestamp debug/log messages
  udp-small-servers      Enable small UDP servers (e.g., ECHO)

Router(config)#no service


・設定の解説にあたっては除外アドレスから始める


さぞトラブルがあったことだろうとお察しを。


入力のお作法の確認。

L2-QoS(config)#ip dhcp ?
  conflict                   DHCP address conflict parameters
  database                   Configure DHCP database agents
  excluded-address           Prevent DHCP from assigning certain addresses
  limited-broadcast-address  Use all 1's broadcast address
  ping                       Specify ping parameters used by DHCP
  pool                       Configure DHCP address pools
  relay                      DHCP relay agent parameters
  smart-relay                Enable Smart Relay feature
  snooping                   DHCP Snooping

L2-QoS(config)#ip dhcp excluded-address ?
  A.B.C.D  Low IP address

L2-QoS(config)#ip dhcp excluded-address 172.17.1.254 172.18.1.2


ここで、excluded設定についてもお作法を試したところ、running-config にこのような結果が。

!
no aaa new-model
clock timezone JST 9
vtp domain vtptest
vtp mode transparent
ip subnet-zero
ip routing
ip dhcp excluded-address 10.0.0.0 10.255.255.255
ip dhcp excluded-address 10.0.0.1 10.255.255.254
ip dhcp excluded-address 11.0.0.0 11.255.255.255
ip dhcp excluded-address 172.16.0.1 172.31.255.254
ip dhcp excluded-address 192.168.0.1 192.168.1.254
ip dhcp excluded-address 0.0.0.1 127.255.255.254
ip dhcp excluded-address 128.0.0.1 191.255.255.254
ip dhcp excluded-address 192.0.0.1 223.255.255.254
ip dhcp excluded-address 224.0.0.1 239.255.255.254
ip dhcp excluded-address 240.0.0.1 255.255.255.254
ip dhcp excluded-address 127.255.255.254 128.0.0.1
ip dhcp excluded-address 191.255.255.254 192.0.0.1
ip dhcp excluded-address 223.255.255.254 224.0.0.1
ip dhcp excluded-address 239.255.255.254 240.0.0.1
!
!

グローバル/プライベートやクラス境界、特殊なアドレス問わず設定可能。また、

L2-QoS(config)#ip dhcp pool TEST
L2-QoS(dhcp-config)#network 172.16.32.0 255.255.255.0
L2-QoS(dhcp-config)#default-router 172.16.31.1
L2-QoS(dhcp-config)#domain-name test.local
L2-QoS(dhcp-config)#lease 1 12
L2-QoS(dhcp-config)#exit
L2-QoS(config)#
L2-QoS(config)#no ip dhcp conflict logging
L2-QoS(config)#


実在するサブネットは、プライベートVLANの学習の際にテストしたVLAN 31、172.16.31.0/24。一方で設定上は実在しないサブネットでも入るし、もっとあからさまにメチャクチャな値でも入ることは入る。もちろん誤動作はしないので、作業場の間違いが起こりうる、というだけのこと。



次にDHCPデータベースの設定について。

L2-QoS(config)# ip dhcp database?
database

L2-QoS(config)# ip dhcp database ?
  WORD  Uniform Resource Locator (URL)

L2-QoS(config)#ip dhcp database TESTURL ?
  timeout      Set the database transfer timeout
  write-delay  Set the database write delay
  <cr>

L2-QoS(config)#ip dhcp database TESTURL write-delay ?
  <60-4294967295>  Seconds

L2-QoS(config)#

この機能の意義について全くわかっちゃいないので、ここでは、設定上はこんなやわ、という程度で。


ここで、先ほどの設定ミス事例を一部修正。

L2-QoS(config)#ip dhcp pool TEST
L2-QoS(dhcp-config)#
L2-QoS(dhcp-config)#network 172.16.31.0 255.255.255.0
L2-QoS(dhcp-config)#exit
L2-QoS(config)#
L2-QoS(config)#
L2-QoS(config)#ip dhcp excluded-address 172.16.31.1 172.16.31.127
L2-QoS(config)#ip dhcp excluded-address 172.16.31.144 172.16.31.255
L2-QoS(config)#

networkで本来のサブネットを追加した。誤った設定も残したままだが、アドレス授受は完了した。


L2-QoS#show ip dhcp ?
  binding   DHCP address bindings
  conflict  DHCP address conflicts
  database  DHCP database agents
  import    Show Imported Parameters
  relay     Miscellaneous DHCP relay information
  server    Miscellaneous DHCP server information
  snooping  DHCP snooping

L2-QoS#show ip dhcp binding
IP address       Client-ID/              Lease expiration        Type
                 Hardware address
172.16.31.128    (MACアドレス)       Mar 02 1993 11:21 PM    Automatic
L2-QoS#
L2-QoS#
L2-QoS#show ip dhcp conflict
IP address        Detection method   Detection time
L2-QoS#
L2-QoS#show ip dhcp database

L2-QoS#
L2-QoS#show ip dhcp import

L2-QoS#
L2-QoS#show ip dhcp relay
% Incomplete command.

L2-QoS#show ip dhcp relay ?
  information  DHCP relay information option

L2-QoS#show ip dhcp relay information
% Incomplete command.

L2-QoS#show ip dhcp relay information  ?
  trusted-sources  List of trusted sources of relay information option

L2-QoS#show ip dhcp relay information  trusted-sources ?
  |  Output modifiers
  <cr>

L2-QoS#show ip dhcp relay information  trusted-sources
List of trusted sources of relay agent information option:

L2-QoS#show ip dhcp server
% Incomplete command.

L2-QoS#show ip dhcp server ?
  statistics  DHCP server statistics

L2-QoS#show ip dhcp server statistics
Memory usage         5180
Address pools        1
Database agents      0
Automatic bindings   1
Manual bindings      0
Expired bindings     0
Malformed messages   0

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         23
DHCPREQUEST          1
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           0

Message              Sent
BOOTREPLY            0
DHCPOFFER            1
DHCPACK              1
DHCPNAK              0
L2-QoS#
L2-QoS#
L2-QoS#show ip dhcp snooping ?
  binding   DHCP snooping bindings
  database  DHCP snooping database agent
  |         Output modifiers
  <cr>

L2-QoS#show ip dhcp snooping
Switch DHCP snooping is disabled
DHCP snooping is configured on following VLANs:
none
Insertion of option 82 is enabled
Option 82 on untrusted port is not allowed
Verification of hwaddr field is enabled
Interface                    Trusted     Rate limit (pps)
------------------------     -------     ----------------
L2-QoS#


別の機器では、


Router#show dhcp ?
  lease   Show DHCP Addresses leased from a server
  server  Show DHCP Servers we know about


Router#show dhcp lease
Router#
Router#
Router#show dhcp server
   DHCP server: ANY (255.255.255.255)
    Leases:   0
    Offers:   0      Requests: 0     Acks : 0     Naks: 0
    Declines: 0      Releases: 0     Query: 0     Bad: 0
    Forcerenews: 0      Failures: 0

Router#
Router#
Router#show ip dhcp ?
  binding   DHCP address bindings
  conflict  DHCP address conflicts
  database  DHCP database agents
  import    Show Imported Parameters
  pool      DHCP pools information
  relay     Miscellaneous DHCP relay information
  server    Miscellaneous DHCP server information

Router#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
Router#
Router#
Router#show ip dhcp conflict
IP address        Detection method   Detection time          VRF
Router#
Router#
Router#show ip dhcp database
Router#
Router#
Router#show ip dhcp import
Router#
Router#
Router#show ip dhcp pool
Router#
Router#
Router#show ip dhcp relay
% Incomplete command.

Router#show ip dhcp relay ?
  information  DHCP relay information option

Router#show ip dhcp relay information
% Incomplete command.

Router#show ip dhcp relay information  ?
  trusted-sources  List of trusted sources of relay information option

Router#show ip dhcp relay information  trusted-sources
List of trusted sources of relay agent information option:

Router#show ip dhcp server
% Incomplete command.

Router#show ip dhcp server ?
  statistics  DHCP server statistics

Router#show ip dhcp server statistics
Memory usage         0
Address pools        0
Database agents      0
Automatic bindings   0
Manual bindings      0
Expired bindings     0
Malformed messages   0
Secure arp entries   0

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         0
DHCPREQUEST          0
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           0

Message              Sent
BOOTREPLY            0
DHCPOFFER            0
DHCPACK              0
DHCPNAK              0
Router#


0 件のコメント:

コメントを投稿