アーカイブ

2011年11月

カテゴリ:

IOSで定期的にコマンドを実行するにはkronコマンドを利用します。UNIX/Linuxではcronですので注意して下さい。

まず実行するコマンドを定義します。kron policy-listコマンドに続いて登録するポリシー名を指定します。ここではF0/0_statusとしました。

R1(config)#kron policy-list F0/0_status

cliコマンドに続いて、実行したいコマンドを定義します。一度実行したものをコピーして使うと設定しやすいでしょう。ここで実行しているのはインターフェースF0/0の設定です。リダイレクトを使い、flashに保存しています。

R1(config-kron-policy)# cli show running-config interface f0/0 | redirect flash:f0status

このコマンドを直接実行すると下記のように表示されます。

R1(config)#do sh run int f0/0
Building configuration...

Current configuration : 94 bytes
!
interface FastEthernet0/0
ip address 12.12.12.1 255.255.255.0
speed 100
full-duplex
end

続いて、いつ実行するかを指定します。kron occurrenceコマンドに続き、登録名を指定します。先ほどのポリシー名とは別ですので注意が必要です。ここではMYKRONとしました。

時刻で指定する場合はatを利用します。hh:mmの形式で指定します。

R1(config)#kron occurrence MYKRON at ?
  hh:mm  Time of day for occurrence (hh:min eg. 14:30)

その後に月日や曜日が選べますが、毎日の実行であればここでrecurringを指定します。

R1(config)#kron occurrence MYKRON at 20:32 ?
  <1-31>     Day of month
  DAY        Day of Week eg mon, tue, etc
  MONTH      Month of year eg jan, feb, etc
  oneshot    Schedule kron occurrence exactly once
  recurring  Schedule kron occurrence repeatedly
  <cr>

R1(config)#kron occurrence MYKRON at 20:32 recurring

続いて実行するコマンドをポリシー名で指定します。

R1(config-kron-occurrence)# policy-list F0/0_status

設定の確認はsh kron scheduleを利用します。

R1#sh kron schedule
Kron Occurrence Schedule
MYKRON inactive, will run again in 0 days 00:03:45 at 20:32 on

指定時刻を過ぎてflashの中を確認するとファイルが確認できます。

R1(config)#do sh flash

System CompactFlash directory:
File  Length   Name/status
  1   142      f0status
[2028 bytes used, 16775184 available, 16777212 total]
16384K bytes of ATA System CompactFlash (Read/Write)

確かに自動的に実行されたようです。

R1(config)#do more flash:f0status
Building configuration...

Current configuration : 94 bytes
!
interface FastEthernet0/0
ip address 12.12.12.1 255.255.255.0
speed 100
full-duplex
end

HSRPとVRRPに続きGLBP(Gateway Load Balancing Protocol)の設定を確認します。先の二つではアクティブなルータのみが利用されますが、GLBPでは複数をバランスを取って利用することが可能で負荷を分散させることが可能です。ルータ4台の設定は前回と同じです。

R1(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.1   YES manual up                    up
Serial1/2                  13.13.13.1      YES manual up                    up
Loopback0                  17.17.1.1       YES NVRAM  up                    up

R2(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.2   YES manual up                    up
Serial1/2                  23.23.23.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

R3(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
Serial1/2                  13.13.13.3      YES manual up                    up
Serial1/3                  23.23.23.3      YES manual up                    up
Loopback0                  17.17.3.3       YES NVRAM  up                    up

R4(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.4   YES manual up                    up
Loopback0                  17.17.4.4       YES NVRAM  up                    up

R1, R2, R3では全てのインターフェースでEIGRPを有効にします。

R3(config)#router ei 100
R3(config-router)#no au
R3(config-router)#net 0.0.0.0
R3(config)#do sh ip rou ei
     17.0.0.0/24 is subnetted, 3 subnets
D       17.17.1.0 [90/2297856] via 13.13.13.1, 00:07:11, Serial1/2
D       17.17.2.0 [90/2297856] via 23.23.23.2, 00:07:11, Serial1/3
     124.0.0.0/24 is subnetted, 1 subnets
D       124.124.124.0 [90/2172416] via 23.23.23.2, 00:07:11, Serial1/3
                      [90/2172416] via 13.13.13.1, 00:07:11, Serial1/2

R1とR2のF0/0にGLBPを設定します。まずR1でF0/0を指定し、glbpコマンドでグループ124を指定しました。その後、IPアドレスを124.124.124.254とし、R1を優先的に利用するためプライオリティを110としました(指定しない場合は100)。最後にweightingを使って利用配分を指定します。ここではR1とR2を1:1で利用すべく10で指定しました。

R1(config-router)#int f0/0
R1(config-if)#glbp ?
  <0-1023>  Group number

R1(config-if)#glbp 124 ?
  authentication  Authentication method
  client-cache    Client cache
  forwarder       Forwarder configuration
  ip              Enable group and set virtual IP address
  ipv6            Enable group for IPv6 and set the virtual IPv6 address
  load-balancing  Load balancing method
  name            Redundancy name
  preempt         Overthrow lower priority designated routers
  priority        Priority level
  timers          Adjust GLBP timers
  weighting       Gateway weighting and tracking

R1(config-if)#glbp 124 ip 124.124.124.254
R1(config-if)#glbp 124 priority 110
R1(config-if)#glbp 124 weighting 10

続いてR2を設定します。R1と同じようにweightingは10としました。

R2(config-router)#int f0/0
R2(config-if)#glbp 124 ip 124.124.124.254
R2(config-if)#glbp 124 weighting 10

ここまでで設定を確認します。

R1(config-if)#do sh glbp
FastEthernet0/0 - Group 124
  State is Active
    2 state changes, last state change 00:04:08
  Virtual IP address is 124.124.124.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.136 secs
  Redirect time 600 sec, forwarder timeout 14400 sec
  Preemption disabled
  Active is local
  Standby is 124.124.124.2, priority 100 (expires in 8.296 sec)
  Priority 110 (configured)
  Weighting 10 (configured 10), thresholds: lower 1, upper 10
  Load balancing: round-robin
  Group members:
    c200.1189.0000 (124.124.124.1) local
    c201.1189.0000 (124.124.124.2)
  There are 2 forwarders (1 active)
  Forwarder 1
    State is Active
      1 state change, last state change 00:03:58
    MAC address is 0007.b400.7c01 (default)
    Owner ID is c200.1189.0000
    Redirection enabled
    Preemption enabled, min delay 30 sec
    Active is local, weighting 10
  Forwarder 2
    State is Listen
    MAC address is 0007.b400.7c02 (learnt)
    Owner ID is c201.1189.0000
    Redirection enabled, 599.044 sec remaining (maximum 600 sec)
    Time to live: 14399.044 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 124.124.124.2 (primary), weighting 10 (expires in 9.044 sec)

R2(config-if)#do sh glbp
FastEthernet0/0 - Group 124
  State is Standby
    1 state change, last state change 00:22:41
  Virtual IP address is 124.124.124.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.276 secs
  Redirect time 600 sec, forwarder timeout 14400 sec
  Preemption disabled
  Active is 124.124.124.1, priority 110 (expires in 9.176 sec)
  Standby is local
  Priority 100 (default)
  Weighting 10 (configured 10), thresholds: lower 1, upper 10
  Load balancing: round-robin
  Group members:
    c200.1189.0000 (124.124.124.1)
    c201.1189.0000 (124.124.124.2) local
  There are 2 forwarders (1 active)
  Forwarder 1
    State is Listen
    MAC address is 0007.b400.7c01 (learnt)
    Owner ID is c200.1189.0000
    Time to live: 14399.172 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 124.124.124.1 (primary), weighting 10 (expires in 8.388 sec)
  Forwarder 2
    State is Active
      1 state change, last state change 00:22:49
    MAC address is 0007.b400.7c02 (default)
    Owner ID is c201.1189.0000
    Preemption enabled, min delay 30 sec
    Active is local, weighting 10

R4にデフォルトゲートウェイを124.124.124.254で設定します。

R4(config-if)#ip route 0.0.0.0 0.0.0.0 124.124.124.254
R4(config)#do sh ip rou st
S*   0.0.0.0/0 [1/0] via 124.124.124.254

設定後、R3へのLo0へpingが実行できることが分かり、tracerouteコマンドでR1を経由していることも確認できます。

R4(config)#do trace 17.17.3.3

Type escape sequence to abort.
Tracing the route to 17.17.3.3

  1 124.124.124.1 16 msec 8 msec 8 msec
  2 13.13.13.3 40 msec *  12 msec

1:1の配分を確認するためにarp-cacheをクリアしています。すると、今度はR2が利用されていることが分かります。

R4(config)#do sh arp 124.124.124.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  124.124.124.254         0   0007.b400.7c01  ARPA   FastEthernet0/0
R4(config)#do clear arp-cache
R4(config)#do trace 17.17.3.3

Type escape sequence to abort.
Tracing the route to 17.17.3.3

  1 124.124.124.2 8 msec 4 msec 8 msec
  2 23.23.23.3 8 msec *  12 msec
R4(config)#do sh arp 124.124.124.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  124.124.124.254         0   0007.b400.7c02  ARPA   FastEthernet0/0

CCIE Nightに参加

カテゴリ:

Img_2906今夜、初めてCCIE Nightに参加しました。久しぶりの方や、ブログやTwitterで知っている方に直接会って話しが出来て大変有意義な時間でした。

驚いたのは何人もの人にブログ読んでます、と言われたこと。嬉しいやらこっ恥ずかしいやら。顔写真を出しているといいこともありますね。

ちなみに若い女性のCCIEホルダーもいることが分かり、驚きました…。

カテゴリ:

前回のHSRPを続いてVRRP(Virtual Router Redundancy Protocol)の設定を行います。R1, R2, R4はそれぞれF0/0で124.124.124.0/24のネットワークで接続されています。R1はR3にシリアルケーブルで直結(13.13.13.0/24)、R2もR3にシリアルケーブルで直結(23.23.23.0/24)しています。

R1(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.1   YES manual up                    up
Serial1/2                  13.13.13.1      YES manual up                    up
Loopback0                  17.17.1.1       YES NVRAM  up                    up

R2(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.2   YES manual up                    up
Serial1/2                  23.23.23.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

R3(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
Serial1/2                  13.13.13.3      YES manual up                    up
Serial1/3                  23.23.23.3      YES manual up                    up
Loopback0                  17.17.3.3       YES NVRAM  up                    up

R4(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.4   YES manual up                    up
Loopback0                  17.17.4.4       YES NVRAM  up                    up

R1, R2, R3では全てのインターフェースでEIGRPを有効にします。

R3(config)#router ei 100
R3(config-router)#no au
R3(config-router)#net 0.0.0.0
R3(config)#do sh ip rou ei
     17.0.0.0/24 is subnetted, 3 subnets
D       17.17.1.0 [90/2297856] via 13.13.13.1, 00:07:11, Serial1/2
D       17.17.2.0 [90/2297856] via 23.23.23.2, 00:07:11, Serial1/3
     124.0.0.0/24 is subnetted, 1 subnets
D       124.124.124.0 [90/2172416] via 23.23.23.2, 00:07:11, Serial1/3
                      [90/2172416] via 13.13.13.1, 00:07:11, Serial1/2

R1とR2のF0/0にVRRPを設定します。vrrpコマンドを利用して設定しますが、ここではグループ番号を124としています。また割り当てる仮想のIPアドレスは124.124.124.254とします。R1を優先的に利用するためプライオリティを110としました(指定しない場合は100)。

R1(config-router)#int f0/0
R1(config-if)#vrrp ?
  <1-255>  Group number

R1(config-if)#vrrp 124 ?
  authentication  Authentication
  description     Group specific description
  ip              Enable Virtual Router Redundancy Protocol (VRRP) for IP
  preempt         Enable preemption of lower priority Master
  priority        Priority of this VRRP group
  shutdown        Disable VRRP Configuration
  timers          Set the VRRP timers
  track           Event Tracking

R1(config-if)#vrrp 124 ip 124.124.124.254
R1(config-if)#vrrp 124 priority 110
R1(config-if)#do sh vrrp

R2(config-router)#int f0/0
R2(config-if)#vrr
R2(config-if)#vrrp 124 ip 124.124.124.254

設定を確認します。R1がMasterとなり、有効であることが分かります。

FastEthernet0/0 - Group 124
  State is Master 
  Virtual IP address is 124.124.124.254
  Virtual MAC address is 0000.5e00.017c
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 110
  Master Router is 124.124.124.1 (local), priority is 110
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.570 sec

R2(config-if)#do sh vrrp
FastEthernet0/0 - Group 124
  State is Backup 
  Virtual IP address is 124.124.124.254
  Virtual MAC address is 0000.5e00.017c
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 100
  Master Router is 124.124.124.1, priority is 110
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.609 sec (expires in 2.905 sec)

R4より124.124.124.254へのpingが実行できることを確認しています。

R4(config)#do pin 124.124.124.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 124.124.124.254, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 4/13/36 ms
R4(config)#do sh ip arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  124.124.124.254         0   0000.5e00.017c  ARPA   FastEthernet0/0

R4にデフォルトゲートウェイを124.124.124.254で設定します。

R4(config)#ip route 0.0.0.0 0.0.0.0 124.124.124.254
R4(config)#do sh ip rou sta
S*   0.0.0.0/0 [1/0] via 124.124.124.254

設定後、R3へのLo0へpingが実行できることが分かり、tracerouteコマンドでR1を経由していることも確認できます。

R4(config)#do trace 17.17.3.3

Type escape sequence to abort.
Tracing the route to 17.17.3.3

  1 124.124.124.1 4 msec 8 msec 8 msec
  2 13.13.13.3 16 msec *  24 msec

ここでR2でデバグを有効し、R1のF0/0をシャットします。

R2(config)#do deb vrrp
VRRP debugging is on

Nov 15 06:10:37.339: VRRP: Grp 124 Advertisement priority 0, ipaddr 124.124.124.1
Nov 15 06:10:37.343: VRRP: Grp 124 Event - Advert priority 0
Nov 15 06:10:37.959: VRRP: Grp 124 Event - Master down timer expired
Nov 15 06:10:37.963: %VRRP-6-STATECHANGE: Fa0/0 Grp 124 state Backup -> Master

R1のF0/0が使用不可能になると自動的にR2のF0/0を経由することがtracerouteコマンドで確認出来ます。

R4(config)#do trace 17.17.3.3

Type escape sequence to abort.
Tracing the route to 17.17.3.3

  1 124.124.124.2 8 msec 12 msec 4 msec
  2 23.23.23.3 8 msec *  16 msec

カテゴリ:

今回はHSRP(Hot Standby Routing Protocol)の設定を行います。R1, R2, R4はそれぞれF0/0で124.124.124.0/24のネットワークで接続されています。R1はR3にシリアルケーブルで直結(13.13.13.0/24)、R2もR3にシリアルケーブルで直結(23.23.23.0/24)しています。

R1(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.1   YES manual up                    up
Serial1/2                  13.13.13.1      YES manual up                    up
Loopback0                  17.17.1.1       YES NVRAM  up                    up

R2(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.2   YES manual up                    up
Serial1/2                  23.23.23.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

R3(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
Serial1/2                  13.13.13.3      YES manual up                    up
Serial1/3                  23.23.23.3      YES manual up                    up
Loopback0                  17.17.3.3       YES NVRAM  up                    up

R4(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.4   YES manual up                    up
Loopback0                  17.17.4.4       YES NVRAM  up                    up

R1, R2, R3では全てのインターフェースでEIGRPを有効にします。

R3(config)#router ei 100
R3(config-router)#no au
R3(config-router)#net 0.0.0.0
R3(config)#do sh ip rou ei
     17.0.0.0/24 is subnetted, 3 subnets
D       17.17.1.0 [90/2297856] via 13.13.13.1, 00:07:11, Serial1/2
D       17.17.2.0 [90/2297856] via 23.23.23.2, 00:07:11, Serial1/3
     124.0.0.0/24 is subnetted, 1 subnets
D       124.124.124.0 [90/2172416] via 23.23.23.2, 00:07:11, Serial1/3
                      [90/2172416] via 13.13.13.1, 00:07:11, Serial1/2

まずR4からpingコマンドを実行して、接続を確認します。

R4(config)#do pin 124.124.124.1
R4(config)#do pin 124.124.124.2

ではR1とR2のF0/0にHSRPを設定します。standbyコマンドを利用して設定しますが、ここではグループ番号を124としています。また割り当てる仮想のIPアドレスは124.124.124.254とします。R1を優先的に利用するためプライオリティを110としました(指定しない場合は100)。

R1(config)#int f0/0
R1(config-if)#standby 124 ip 124.124.124.254
R1(config-if)#standby 124 priority 110

R2(config)#int f0/0
R2(config-if)#standby 124 ip 124.124.124.254

設定を確認します。R1がActiveとなり、有効であることが分かります。

R1(config-if)#do sh standby
FastEthernet0/0 - Group 124
  State is Active
    2 state changes, last state change 00:07:41
  Virtual IP address is 124.124.124.254
  Active virtual MAC address is 0000.0c07.ac7c
    Local virtual MAC address is 0000.0c07.ac7c (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.756 secs
  Preemption disabled
  Active router is local
  Standby router is 124.124.124.2, priority 100 (expires in 9.640 sec)
  Priority 110 (configured 110)
  Group name is "hsrp-Fa0/0-124" (default)

R2(config-if)#do sh standby
FastEthernet0/0 - Group 124
  State is Listen
  Virtual IP address is 124.124.124.254
  Active virtual MAC address is 0000.0c07.ac7c
    Local virtual MAC address is 0000.0c07.ac7c (v1 default)
  Hello time 3 sec, hold time 10 sec
  Preemption disabled
  Active router is 124.124.124.1, priority 110 (expires in 7.148 sec)
  Standby router is unknown
  Priority 100 (default 100)
  Group name is "hsrp-Fa0/0-124" (default)

R4より124.124.124.254へのpingが実行できることを確認しています。

R4(config)#do pin 124.124.124.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 124.124.124.254, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 4/7/8 ms
R4(config)#do sh ip arp 124.124.124.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  124.124.124.254         0   0000.0c07.ac7c  ARPA   FastEthernet0/0

R4にデフォルトゲートウェイを124.124.124.254で設定します。

R4(config)#ip route 0.0.0.0 0.0.0.0 124.124.124.254
R4(config)#do sh ip rou sta
S*   0.0.0.0/0 [1/0] via 124.124.124.254

設定後、R3へのLo0へpingが実行できることが分かり、tracerouteコマンドでR1を経由していることも確認できます。

R4(config)#do pin 17.17.3.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 17.17.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/12/16 ms
R4(config)#do trace 17.17.3.3

Type escape sequence to abort.
Tracing the route to 17.17.3.3

  1 124.124.124.1 8 msec 8 msec 8 msec
  2 13.13.13.3 8 msec *  32 msec

ここでR2でデバグを有効し、R1のF0/0をシャットします。

R2(config)#do deb standby
HSRP debugging is on

R1(config-if)#sh
Nov  7 06:19:25.235: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 124 state Active -> Init

Nov  7 06:19:22.715: HSRP: Fa0/0 Grp 124 Active router is local, was 124.124.124.1
Nov  7 06:19:22.719: HSRP: Fa0/0 Nbr 124.124.124.1 no longer active for group 124 (Standby)
Nov  7 06:19:22.723: HSRP: Fa0/0 Nbr 124.124.124.1 Was active or standby - start passive holddown
Nov  7 06:19:22.723: HSRP: Fa0/0 Grp 124 Standby router is unknown, was local
Nov  7 06:19:22.727: HSRP: Fa0/0 Grp 124 Standby -> Active
Nov  7 06:19:22.731: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 124 state Standby -> Active

R1のF0/0が使用不可能になると自動的にR2のF0/0を経由することがtracerouteコマンドで確認出来ます。

R4(config)#do trace 17.17.3.3

Type escape sequence to abort.
Tracing the route to 17.17.3.3

  1 124.124.124.2 8 msec 8 msec 8 msec
  2 23.23.23.3 12 msec *  8 msec

カテゴリ:

今回はDHCPサーバを異なるネットワークに置いた場合の設定を確認します。ip helper-addressコマンドを使いますが、どこにコマンドを適用するのか、慣れないと迷います。

R2はR1(F0/0)とR3(S1/3)にそれぞれ直結しています。ここではR3をDHCPサーバとし、R1のインターフェースをDHCPクライアントとします。

R2(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.2      YES manual up                    up
Serial1/2                  23.23.23.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

R3(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
Serial1/3                  23.23.23.3      YES manual up                    up
Loopback0                  17.17.3.3       YES NVRAM  up                    up

まず前回を参考にR3にDHCPサーバの設定を行います。

R3(config)#ip dhcp pool MYDHCP

R3(dhcp-config)#network 12.12.12.0 /24
R3(dhcp-config)#exit
R3(config)#ip dhcp excluded-address 12.12.12.0 12.12.12.99
R3(config)#do deb ip dhcp server event
R3(config)#do sh ip dhcp pool MYDHCP

Pool MYDHCP :
Utilization mark (high/low)    : 100 / 0
Subnet size (first/next)       : 0 / 0
Total addresses                : 254
Leased addresses               : 0
Pending event                  : none
1 subnet is currently in the pool :
Current index        IP address range                    Leased addresses
12.12.12.1           12.12.12.1       - 12.12.12.254      0

ここでR1のF0/0でDHCPを有効にします。

R1(config)#int f0/0
R1(config-if)#ip address dhcp
R1(config-if)#no sh

有効にしてもDHCPによるIPアドレスの割り当ては行われません。これは23.23.23.0/24にあるDHCPサーバまでBOOTPパケットが転送されないからです。

R1(config-if)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES DHCP   up                    up

BOOTPパケットの転送を行うためにip helper-addressコマンドを利用しますが、設定するのはBOOTPパケットを受け取るインターフェースになります(この場合、R1のF0/0に直結しているR2のF0/0)。

R2(config)#int f0/0
R2(config-if)#ip helper-address 23.23.23.3
R2(config-if)#do sh ip int f0/0 | i Help
  Helper address is 23.23.23.3

設定後、しばらくするとR3に反応が出ます。

Oct 30 06:21:54.383: DHCPD: Adding binding to radix tree (12.12.12.100)
Oct 30 06:21:54.383: DHCPD: Adding binding to hash tree
Oct 30 06:21:54.387: DHCPD: assigned IP address 12.12.12.100 to client 0063.6973.636f.2d63.3230.302e.3165.3633.2e30.3030.302d.4661.302f.30.
Oct 30 06:21:54.427: DHCPD: Sending notification of ASSIGNMENT:
Oct 30 06:21:54.427:  DHCPD: address 12.12.12.100 mask 255.255.255.0

R3(config)#do sh ip dhcp bind
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
12.12.12.100        0063.6973.636f.2d63.    Oct 31 2011 03:21 PM    Automatic
                    3230.302e.3165.3633.
                    2e30.3030.302d.4661.
                    302f.30

R1で正しくIPアドレスが割り当てられたことが分かります。

R1(config-if)#
Oct 30 06:21:51.911: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 12.12.12.100, mask 255.255.255.0, hostname R1

R1(config-if)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.100    YES DHCP   up                    up

このページのトップヘ

見出し画像
×