【Cisco】#12 NAT@秋葉原UDX
2020/xx/xx()9時00分から
FORSE 1
【Cisco】#12
FORSE
アジェンダ
1200~1210 今日やる事の説明
1210~1230 物理結線
1230~1300 スタティックNAT作成
1300~1330 DHCPとPAT
持ち物:サーバ×1、スイッチ×4、PC×6、ルータ×4、LAN線×16、
シリアルケーブル×4、
前提
NAT(Network Address Translation)とは
今日、出来るようになる事
スタティックNATで宛先変更が出来る事
PATを使ってインターネットに接続出来る事
座席表
2
PC1
RT-1
PC3
RT-3
PC2
RT-2
PC4
RT-4
【Cisco】スタティックNAT、ダイナミックNAT、NAPTとは
FORSE
NAT(Network Address Translation)とは
・IPヘッダ内のIPアドレスを変換する技術
・元々、IPv4アドレスの枯渇問題対策として考え出された
<参考>IPv4→2の32乗(約43億個) IPv6→2の126乗(約340澗個)
・NATとは、インターネット接続する際に、プライベートIPアドレスをグローバルIPアドレスに変換する技術
参考 https://www.infraexpert.com/study/ip10.html
3
名前 どんな時に使う?どんなイメージ?
スタティックNAT
インターネットから社内にあるFTPサーバを利用する時
新潟新幹線 新潟行きが青森行きに変換されるイメージ
ダイナミックNAT
企業が合併した時に同じアドレスを利用していた場合に、重複して利用
を続ける場合
NAPT
IPマスカレード
PATはCisco用語。グローバルアドレス節約
グローバルアドレス1つ、会社PC100個で利用
名前 cisco 内容
内部ローカル
アドレス
inside local
内部(会社)ネットワークのIPアドレス
例)会社PCのプライベートIPアドレス
192.168.10.10
内部グローバル
アドレス
inside global
外部(インターネット)が会社へ通信を行う
為(主に戻す為)に利用するアドレス
例)当社で保有しているグローバルアドレス
forse.tokyo(163.44.187.152)
外部ローカル
アドレス
outside local
内部(会社)から見た、グローバルアドレス
例)yahoo.co.jp(183.79.135.206)
外部グローバル
アドレス
outside global
外部(インターネット)のグローバルIPアド
レス
例)yahoo.co.jp(183.79.135.206)
FOR SE
【Cisco】#12 今日の構成 スタティックNAT
4
新NTPサーバ
シナリオ:あなたは、情報シ
ステム部のインフラ担当です
NTPサーバ(時刻同期用)の
サーバがOSサポート切れ
(CentOS6)に伴いのIPアド
レスが変更になりました。
ドメインに参加しているPCは
一括で変更しましたが、ドメ
イン未参加の特殊PC、複合機
の設定が変更出来ていません
また、複合機は総務部が管理
していた歴史もあり全容把握
は出来ません。
PC、複合機 の間にある「ル
ーターで」旧NTPサーバで通
信に来たものを、新NTPサー
バへNATする事にしました。
RT-1
PC1
192.168.10.10
旧NTPサーバ
RT-2
PC2
192.168.20.10
RT-3
PC3
192.168.30.10
RT-4
PC4
192.168.40.10
192.168.210.192
192.168.220.192
192.168.230.192
192.168.240.192
192.168.210.191
192.168.220.191
192.168.230.191
192.168.240.191
送信元:192.168.10.10
宛先 :192.168.210.191
送信元:192.168.10.10
宛先 :192.168.210.192
送信元:192.168.210.191
宛先 :192.168.10.10
送信元:192.168.210.192
宛先 :192.168.10.10
←古い設定が残っているPC
VLAN10
#Gi7
.1
.1
#Gi8
【Cisco】#12 PCの設定
FORSE
手順1
PCのIPアドレスを変更
して下さい
5
PCのアドレス設定する
「Windowsキー」+「R」→「ncpa.cpl」と入力
・「イーサネット」右クリック、プロパティ
・インターネットプロトコルバージョン4、プロパティ
PC1
IPアドレス :192.168.10.10
サブネットマスク :255.255.255.0
デフォルトゲートウェイ:192.168.10.1
PC2
IPアドレス :192.168.20.10
サブネットマスク :255.255.255.0
デフォルトゲートウェイ:192.168.20.1
PC3
IPアドレス :192.168.30.10
サブネットマスク :255.255.255.0
デフォルトゲートウェイ:192.168.30.1
PC4
IPアドレス :192.168.40.10
サブネットマスク :255.255.255.0
デフォルトゲートウェイ:192.168.40.1
【Cisco】#12初期設定 ルータの設定1(共通)
FORSE
電源を投入して下さい
電源入った事をLED(ランプ)で確認してください
① PCから「tera term」を起動
② 「シリアル」を選択
③ Portから、USBを選択
手順2 ルータ設定
6
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]:no
Press RETURN to get started!
Router>enable
Router #
Router #configure terminal
Router (config)#
Router (config)#hostname RT-1
RT-1(cnofig)#
RT-1#configure terminal
RT-1(config)#no ip domain lookup
RT-1(config)#line console 0
RT-1(config-line)#logging synchronous
RT-1(config-line)#exec-timeout 60 0
RT-1(config-line)#end
【Cisco】#12 スタティックNATの設定1 RT-1
FORSE
手順3 ルータのインターフェースにIPアドレスを指定します
手順4 IPアドレスが正しくアサインできているか確認します。
手順5物理結線を実施
手順6物理結線が完了しているか確認
手順7 状況の確認
PCから旧NTPサーバにping → OKになる
PCから新NTPサーバにping → OKになる
RT-1#configure terminal
RT-1(config)#interface GigabitEthernet 8
RT-1(config-if)#ip address 192.168.210.1 255.255.255.0
RT-1(config-if)#no shutdown
RT-1(config-if)#exit
RT-1(config)#vlan 10←スペースあり(VLAN作成)
RT-1(config-vlan)#exit
RT-1(config)#interface vlan10 ←スペースなし(仮想インターフェース作成)
RT-1(config-if)#ip address 192.168.10.1 255.255.255.0
RT-1(config-if)#no shutdown
RT-1(config-if)#end
RT-1(config)#interface range gigabitEthernet 0-7
RT-1(config-if)#switchport access vlan 10
RT-1(config-if)#end
7
RT-1#show ip interface Vlan10 | include Internet
Internet address is 192.168.10.1/24
RT-1#
RT-1#show ip interface gigabitEthernet8 | include Internet
Internet address is 192.168.210.1/24
RT-1#
RT-1#show ip interface brief
GigabitEthernet7 unassigned YES unset up up
GigabitEthernet8 192.168.210.1 YES manual up up
Vlan1 unassigned YES unset down down
Vlan10 192.168.10.1 YES manual up up
【Cisco】#12 スタティックNATの設定2 RT-1
FORSE
手順8 講師が旧NTPサーバをシャットダウンします
手順9
状況の確認
PCから旧NTPサーバにping → NGになる
PCから新NTPサーバにping → OKになる
手順10
ルータにNAT設定(内部/外部)を実施する
手順11 NAT用のルーティングテーブルを確認
inside → outside ルーティングしてからNAT
ouside → inside NATしてからルーティング
手順11 NAT結果を確認する
NATが行われていることを確認、設定したアドレスを確認します
手順12 アドレス変換後の統計情報を確認します
8
RT-1(config)#interface vlan10
RT-1(config-if)#ip nat inside ←vlan10を内部インターフェースに
RT-1(config-if)#exit
RT-1(config)#interface GigabitEthernet 8
RT-1(config-if)#ip nat outside ←Gi8を外部インターフェースに
RT-1(config-if)#exit
RT-1(config)#ip nat outside source static 192.168.210.192 192.168.210.191 add-route
RT-1(config)#end
RT-1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
-- ---- ---- 192.168.210.191 192.168.210.192
RT-1#show ip nat statistics
Total active translations: 1 (1 static, 0 dynamic; 0 extended)
Peak translations: 3, occurred 00:07:50 ago
Outside interfaces:
GigabitEthernet8
Inside interfaces:
Vlan30
Hits: 16 Misses: 0 ←ヒットカウントはping毎に「8」ずつ増える
CEF Translated packets: 9, CEF Punted packets: 0
Expired translations: 2
Dynamic mappings:
Total doors: 0
Appl doors: 0
Normal doors: 0
Queued Packets: 0
RT-1#
RT-1#show ip route
【Cisco】#12 スタティックNATの設定3 RT-1
FORSE
手順13
コマンドプロンプトで疎通確認をします
PCから旧NTPサーバにping → OKになる
PCから新NTPサーバにping → OKになる
手順14
キャプチャして確認します。
9
送信元:192.168.10.10
宛先 :192.168.210.191
送信元:192.168.10.10
宛先 :192.168.210.192
送信元:192.168.210.191
宛先 :192.168.10.10
送信元:192.168.210.192
宛先 :192.168.10.10
PC1
【Cisco】12
FORSE
ここからは、DHCP と NAPT、PAT、IPマスカレード
10
FOR SE
【Cisco】ラボ#12 今日の構成 PATの設定
11
RT-1
PC1
192.168.10.2
RT-2
PC2
192.168.20.10
RT-3
PC3
192.168.30.10
RT-4
PC4
192.168.40.10
シナリオ:インターネットに接続する
要求
・レンタルオフィスの無線は混んでいるので、有線
にする
・ルータの1~8ポートがある。どこに接続しても、
有線でインターネットをみられること
・参加者毎にVLANセグメントが違う事。
前提
・ONU(回線終端装置)から、直接接続し
検証テストは1人ずつ
・ルータのIPアドレスはDHCPで受け取る
・PCへのアドレス配布はDHCPも自動で行う
ゴール:
有線でYahooで明日の天気予報をみられること
インターネット
#Gi0/8
HUB(勉強会用で便宜的に分けてます)
.1
レンタルオフィス設備
DHCPで受け取る
DHCPで払い出す
【Cisco#12】PATの準備
FORSE
手順1 PCのアドレス設定する
「Windowsキー」+「R」→「ncpa.cpl」と入力
・「イーサネット」右クリック、プロパティ
・インターネットプロトコルバージョン4、プロパティ
・IPアドレスを自動的に取得する
・DNSサーバーのアドレスを自動的に取得する
に設定してください。
手順2
IPアドレスを初期値に戻します、戻す前の確認
手順3
IPアドレスを初期値に戻します
手順4
戻った事を確認します
12
RT-1#show ip interface Vlan10 | include Internet
Internet address is 192.168.10.1/24
RT-1#
RT-1#show ip interface gigabitEthernet8 | include Internet
Internet address is 192.168.210.1/24
RT-1#
RT-1#configure terminal
RT-1(config)#default interface gigabitEthernet8
RT-1(config)#default interface vlan10
RT-1#show ip interface Vlan10 | include Internet
Internet protocol processing disabled
RT-1#
RT-1#show ip interface gigabitEthernet8 | include Internet
Internet protocol processing disabled
RT-1#
【Cisco】#12 PATの設定1
FORSE
手順5 DHCPクライアントとしてISP(インターネットサービスプロバイダ)からア
ドレスを受取る設定を追加します
手順6 DHCPクライアントとして割り当てられたIPアドレス情報を確認します
手順7 デフォルトルートが自動挿入された事を確認します
DHCPクライアントの設定
13
RT-1#configure terminal
RT-1(config)#interface GigabitEthernet 8
RT-1(config-if)#ip address dhcp
RT-1(config-if)#no shutdown
RT-1(config-if)#end
RT-1#show dhcp lease
Temp IP addr: 192.168.105.51 for peer on Interface: GigabitEthernet8
Temp sub net mask: 255.255.255.0
DHCP Lease server: 192.168.105.1, state: 5 Bound
DHCP transaction id: 1673
Lease: 43200 secs, Renewal: 21600 secs, Rebind: 37800 secs
Temp default-gateway addr: 192.168.105.1
Next timer fires after: 02:04:31
Retry count: 0 Client-ID: cisco-d46d.50b3.cdb3-Gi8
Client-ID hex dump: 636973636F2D643436642E353062332E
636462332D476938
Hostname: Router
RT-1#show ip route static
Gateway of last resort is 192.168.105.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.168.105.1
こっちの設定
【Cisco】#12 PATの設定2
FORSE
手順8 DHCPサーバとしてIPを払い出す設定を追加します
pool-10(pool-20,pool-30、pool-40)という名前を付けます
ネットワークアドレスを指定します
(192.168.10.0/24、192.168.20.0/24、192.168.30.0/24、192.168.40.0/24)
手順9 デフォルトゲートウェイを指定します。
(192.168.10.1、192.168.20.1、192.168.30.1、192.168.40.1)
DNSサーバを指定します。
手順10 DHCPサーバから除外するIPアドレスを設定します
(192.168.10.1、192.168.20.1、192.168.30.1、192.168.40.1)
DHCPサーバの設定
14
RT-1#configure terminal
RT-1(dhcp-config)#ip dhcp pool pool-10 (pool-20、pool-30、pool-40)
RT-1(dhcp-config)#network 192.168.10.0 /24
RT-1(dhcp-config)#default-router 192.168.10.1
RT-1(dhcp-config)#dns-server 8.8.8.8
RT-1(dhcp-config)#exit
RT-1(config)#ip dhcp excluded-address 192.168.10.1
こっちの設定
【Cisco】#12 PATの設定3
FORSE
手順11 作成済みのインターフェース(vlan10、vlan20、vlan30、
vlan40)にIPアドレスの設定をします。
手順12 PAT変換対象となるネットワークアドレスを指定する、ACL
(Access Control List)を名前(acl-10、acl-20、acl-30、acl-40)を付
け作成します
手順13 インターフェースにNATの内部/外部を設定します
手順14
NAPT、PAT、IPマスカレードの設定します。
外部インターフェース(Gi#8)に割り当てられたIPアドレスを利用します
外部(インターネット)に向かって送付する通信の送信元IPアドレスを
内部ネットワーク(192.168.10.0/24)から外部インターフェースに採番され
た(192.168.105.51/24)13ページの例ならば
#一般的には会社で保有しているグローバルアドレス
15
RT-1#configure terminal
RT-1(config)#interface vlan10 ←スペースなし(仮想インターフェース作成)
RT-1(config-if)#ip address 192.168.10.1 255.255.255.0
RT-1(config-if)#no shutdown
RT-1(config-if)#exit
RT-1(config)#interface range gigabitEthernet 0-7
RT-1(config-if)#switchport access vlan 10
RT-1(config-if)#exit
RT-1(config)#ip access-list standard acl-10
RT-1(config-std-nacl)#permit 192.168.10.0 0.0.0.255
RT-1(config-std-nacl)#exit
RT-1(config)#
RT-1(config)#interface vlan10
RT-1(config-if)#ip nat inside ←vlan10を内部インターフェースに
RT-1(config-if)#exit
RT-1(config)#interface GigabitEthernet 8
RT-1(config-if)#ip nat outside ←Gi8を外部インターフェースに
RT-1(config-if)#exit
RT-1(config)#ip nat inside source list acl-10 interface GigabitEthernet8
overload
【Cisco】#12 PATの設定4
FORSE
手順15 DHCPプールの検証
手順16
DHCP設定の確認
手順17 アクセスリストの確認
手順18 インターフェースの確認
16
RT-1#show ip dhcp pool
Pool pool-10 :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 254
Leased addresses : 1
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased addresses
192.168.10.3 192.168.10.1 - 192.168.10.254 1
RT-1#show run | section ip dhcp
ip dhcp excluded-address 192.168.10.1 ←除外しているアドレス
ip dhcp pool pool-10
network 192.168.10.0 255.255.255.0 ←ネットワークアドレス
default-router 192.168.10.1
dns-server 8.8.8.8
RT-3#
RT-3#show access-lists
Standard IP access list acl-30
10 permit 192.168.30.0, wildcard bits 0.0.0.255 (249 matches)
RT-3#
RT-3#show run | section interface Vlan30
interface Vlan30
ip address 192.168.30.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
RT-3#show run | section interface GigabitEthernet8
interface GigabitEthernet8
ip address dhcp
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
ip nat inside source list acl-30 interface GigabitEthernet8 overload
RT-3#
次の採番 IP範囲 払い出した数
ヒットカウント
名前確認
名前確認
【Cisco】#12 PATの設定5
FORSE
手順19 コマンドプロンプトで「ipconfig -all」
DHCPクライアントとして、IPアドレスが取得出来ているか
手順20
ブラウザから天気を確認
おしまい。
17
C:¥Users¥t_suz>ipconfig -all
イーサネット アダプター イーサネット:
接続固有の DNS サフィックス . . . . .:
説明. . . . . . . . . . . . . . . . .: Intel(R) Ethernet Connection (6) I219-LM
物理アドレス. . . . . . . . . . . . .: BC-C3-42-CA-BA-01
DHCP 有効 . . . . . . . . . . . . . .: はい
自動構成有効. . . . . . . . . . . . .: はい
IPv4 アドレス . . . . . . . . . . . .: 192.168.30.2(優先)
サブネット マスク . . . . . . . . . .: 255.255.255.0
リース取得. . . . . . . . . . . . . .: 2021年3月18日 20:10:03
リースの有効期限. . . . . . . . . . .: 2021年3月19日 20:10:03
デフォルト ゲートウェイ . . . . . . .: 192.168.30.1
DHCP サーバー . . . . . . . . . . . .: 192.168.30.1
DNS サーバー. . . . . . . . . . . . .: 8.8.8.8
NetBIOS over TCP/IP . . . . . . . . .: 有効

Cisco labo12

  • 1.
  • 2.
    【Cisco】#12 FORSE アジェンダ 1200~1210 今日やる事の説明 1210~1230 物理結線 1230~1300スタティックNAT作成 1300~1330 DHCPとPAT 持ち物:サーバ×1、スイッチ×4、PC×6、ルータ×4、LAN線×16、 シリアルケーブル×4、 前提 NAT(Network Address Translation)とは 今日、出来るようになる事 スタティックNATで宛先変更が出来る事 PATを使ってインターネットに接続出来る事 座席表 2 PC1 RT-1 PC3 RT-3 PC2 RT-2 PC4 RT-4
  • 3.
    【Cisco】スタティックNAT、ダイナミックNAT、NAPTとは FORSE NAT(Network Address Translation)とは ・IPヘッダ内のIPアドレスを変換する技術 ・元々、IPv4アドレスの枯渇問題対策として考え出された <参考>IPv4→2の32乗(約43億個)IPv6→2の126乗(約340澗個) ・NATとは、インターネット接続する際に、プライベートIPアドレスをグローバルIPアドレスに変換する技術 参考 https://www.infraexpert.com/study/ip10.html 3 名前 どんな時に使う?どんなイメージ? スタティックNAT インターネットから社内にあるFTPサーバを利用する時 新潟新幹線 新潟行きが青森行きに変換されるイメージ ダイナミックNAT 企業が合併した時に同じアドレスを利用していた場合に、重複して利用 を続ける場合 NAPT IPマスカレード PATはCisco用語。グローバルアドレス節約 グローバルアドレス1つ、会社PC100個で利用 名前 cisco 内容 内部ローカル アドレス inside local 内部(会社)ネットワークのIPアドレス 例)会社PCのプライベートIPアドレス 192.168.10.10 内部グローバル アドレス inside global 外部(インターネット)が会社へ通信を行う 為(主に戻す為)に利用するアドレス 例)当社で保有しているグローバルアドレス forse.tokyo(163.44.187.152) 外部ローカル アドレス outside local 内部(会社)から見た、グローバルアドレス 例)yahoo.co.jp(183.79.135.206) 外部グローバル アドレス outside global 外部(インターネット)のグローバルIPアド レス 例)yahoo.co.jp(183.79.135.206)
  • 4.
    FOR SE 【Cisco】#12 今日の構成スタティックNAT 4 新NTPサーバ シナリオ:あなたは、情報シ ステム部のインフラ担当です NTPサーバ(時刻同期用)の サーバがOSサポート切れ (CentOS6)に伴いのIPアド レスが変更になりました。 ドメインに参加しているPCは 一括で変更しましたが、ドメ イン未参加の特殊PC、複合機 の設定が変更出来ていません また、複合機は総務部が管理 していた歴史もあり全容把握 は出来ません。 PC、複合機 の間にある「ル ーターで」旧NTPサーバで通 信に来たものを、新NTPサー バへNATする事にしました。 RT-1 PC1 192.168.10.10 旧NTPサーバ RT-2 PC2 192.168.20.10 RT-3 PC3 192.168.30.10 RT-4 PC4 192.168.40.10 192.168.210.192 192.168.220.192 192.168.230.192 192.168.240.192 192.168.210.191 192.168.220.191 192.168.230.191 192.168.240.191 送信元:192.168.10.10 宛先 :192.168.210.191 送信元:192.168.10.10 宛先 :192.168.210.192 送信元:192.168.210.191 宛先 :192.168.10.10 送信元:192.168.210.192 宛先 :192.168.10.10 ←古い設定が残っているPC VLAN10 #Gi7 .1 .1 #Gi8
  • 5.
    【Cisco】#12 PCの設定 FORSE 手順1 PCのIPアドレスを変更 して下さい 5 PCのアドレス設定する 「Windowsキー」+「R」→「ncpa.cpl」と入力 ・「イーサネット」右クリック、プロパティ ・インターネットプロトコルバージョン4、プロパティ PC1 IPアドレス :192.168.10.10 サブネットマスク:255.255.255.0 デフォルトゲートウェイ:192.168.10.1 PC2 IPアドレス :192.168.20.10 サブネットマスク :255.255.255.0 デフォルトゲートウェイ:192.168.20.1 PC3 IPアドレス :192.168.30.10 サブネットマスク :255.255.255.0 デフォルトゲートウェイ:192.168.30.1 PC4 IPアドレス :192.168.40.10 サブネットマスク :255.255.255.0 デフォルトゲートウェイ:192.168.40.1
  • 6.
    【Cisco】#12初期設定 ルータの設定1(共通) FORSE 電源を投入して下さい 電源入った事をLED(ランプ)で確認してください ① PCから「teraterm」を起動 ② 「シリアル」を選択 ③ Portから、USBを選択 手順2 ルータ設定 6 --- System Configuration Dialog --- Would you like to enter the initial configuration dialog? [yes/no]:no Press RETURN to get started! Router>enable Router # Router #configure terminal Router (config)# Router (config)#hostname RT-1 RT-1(cnofig)# RT-1#configure terminal RT-1(config)#no ip domain lookup RT-1(config)#line console 0 RT-1(config-line)#logging synchronous RT-1(config-line)#exec-timeout 60 0 RT-1(config-line)#end
  • 7.
    【Cisco】#12 スタティックNATの設定1 RT-1 FORSE 手順3ルータのインターフェースにIPアドレスを指定します 手順4 IPアドレスが正しくアサインできているか確認します。 手順5物理結線を実施 手順6物理結線が完了しているか確認 手順7 状況の確認 PCから旧NTPサーバにping → OKになる PCから新NTPサーバにping → OKになる RT-1#configure terminal RT-1(config)#interface GigabitEthernet 8 RT-1(config-if)#ip address 192.168.210.1 255.255.255.0 RT-1(config-if)#no shutdown RT-1(config-if)#exit RT-1(config)#vlan 10←スペースあり(VLAN作成) RT-1(config-vlan)#exit RT-1(config)#interface vlan10 ←スペースなし(仮想インターフェース作成) RT-1(config-if)#ip address 192.168.10.1 255.255.255.0 RT-1(config-if)#no shutdown RT-1(config-if)#end RT-1(config)#interface range gigabitEthernet 0-7 RT-1(config-if)#switchport access vlan 10 RT-1(config-if)#end 7 RT-1#show ip interface Vlan10 | include Internet Internet address is 192.168.10.1/24 RT-1# RT-1#show ip interface gigabitEthernet8 | include Internet Internet address is 192.168.210.1/24 RT-1# RT-1#show ip interface brief GigabitEthernet7 unassigned YES unset up up GigabitEthernet8 192.168.210.1 YES manual up up Vlan1 unassigned YES unset down down Vlan10 192.168.10.1 YES manual up up
  • 8.
    【Cisco】#12 スタティックNATの設定2 RT-1 FORSE 手順8講師が旧NTPサーバをシャットダウンします 手順9 状況の確認 PCから旧NTPサーバにping → NGになる PCから新NTPサーバにping → OKになる 手順10 ルータにNAT設定(内部/外部)を実施する 手順11 NAT用のルーティングテーブルを確認 inside → outside ルーティングしてからNAT ouside → inside NATしてからルーティング 手順11 NAT結果を確認する NATが行われていることを確認、設定したアドレスを確認します 手順12 アドレス変換後の統計情報を確認します 8 RT-1(config)#interface vlan10 RT-1(config-if)#ip nat inside ←vlan10を内部インターフェースに RT-1(config-if)#exit RT-1(config)#interface GigabitEthernet 8 RT-1(config-if)#ip nat outside ←Gi8を外部インターフェースに RT-1(config-if)#exit RT-1(config)#ip nat outside source static 192.168.210.192 192.168.210.191 add-route RT-1(config)#end RT-1#show ip nat translations Pro Inside global Inside local Outside local Outside global -- ---- ---- 192.168.210.191 192.168.210.192 RT-1#show ip nat statistics Total active translations: 1 (1 static, 0 dynamic; 0 extended) Peak translations: 3, occurred 00:07:50 ago Outside interfaces: GigabitEthernet8 Inside interfaces: Vlan30 Hits: 16 Misses: 0 ←ヒットカウントはping毎に「8」ずつ増える CEF Translated packets: 9, CEF Punted packets: 0 Expired translations: 2 Dynamic mappings: Total doors: 0 Appl doors: 0 Normal doors: 0 Queued Packets: 0 RT-1# RT-1#show ip route
  • 9.
    【Cisco】#12 スタティックNATの設定3 RT-1 FORSE 手順13 コマンドプロンプトで疎通確認をします PCから旧NTPサーバにping→ OKになる PCから新NTPサーバにping → OKになる 手順14 キャプチャして確認します。 9 送信元:192.168.10.10 宛先 :192.168.210.191 送信元:192.168.10.10 宛先 :192.168.210.192 送信元:192.168.210.191 宛先 :192.168.10.10 送信元:192.168.210.192 宛先 :192.168.10.10 PC1
  • 10.
  • 11.
    FOR SE 【Cisco】ラボ#12 今日の構成PATの設定 11 RT-1 PC1 192.168.10.2 RT-2 PC2 192.168.20.10 RT-3 PC3 192.168.30.10 RT-4 PC4 192.168.40.10 シナリオ:インターネットに接続する 要求 ・レンタルオフィスの無線は混んでいるので、有線 にする ・ルータの1~8ポートがある。どこに接続しても、 有線でインターネットをみられること ・参加者毎にVLANセグメントが違う事。 前提 ・ONU(回線終端装置)から、直接接続し 検証テストは1人ずつ ・ルータのIPアドレスはDHCPで受け取る ・PCへのアドレス配布はDHCPも自動で行う ゴール: 有線でYahooで明日の天気予報をみられること インターネット #Gi0/8 HUB(勉強会用で便宜的に分けてます) .1 レンタルオフィス設備 DHCPで受け取る DHCPで払い出す
  • 12.
    【Cisco#12】PATの準備 FORSE 手順1 PCのアドレス設定する 「Windowsキー」+「R」→「ncpa.cpl」と入力 ・「イーサネット」右クリック、プロパティ ・インターネットプロトコルバージョン4、プロパティ ・IPアドレスを自動的に取得する ・DNSサーバーのアドレスを自動的に取得する に設定してください。 手順2 IPアドレスを初期値に戻します、戻す前の確認 手順3 IPアドレスを初期値に戻します 手順4 戻った事を確認します 12 RT-1#show ipinterface Vlan10 | include Internet Internet address is 192.168.10.1/24 RT-1# RT-1#show ip interface gigabitEthernet8 | include Internet Internet address is 192.168.210.1/24 RT-1# RT-1#configure terminal RT-1(config)#default interface gigabitEthernet8 RT-1(config)#default interface vlan10 RT-1#show ip interface Vlan10 | include Internet Internet protocol processing disabled RT-1# RT-1#show ip interface gigabitEthernet8 | include Internet Internet protocol processing disabled RT-1#
  • 13.
    【Cisco】#12 PATの設定1 FORSE 手順5 DHCPクライアントとしてISP(インターネットサービスプロバイダ)からア ドレスを受取る設定を追加します 手順6DHCPクライアントとして割り当てられたIPアドレス情報を確認します 手順7 デフォルトルートが自動挿入された事を確認します DHCPクライアントの設定 13 RT-1#configure terminal RT-1(config)#interface GigabitEthernet 8 RT-1(config-if)#ip address dhcp RT-1(config-if)#no shutdown RT-1(config-if)#end RT-1#show dhcp lease Temp IP addr: 192.168.105.51 for peer on Interface: GigabitEthernet8 Temp sub net mask: 255.255.255.0 DHCP Lease server: 192.168.105.1, state: 5 Bound DHCP transaction id: 1673 Lease: 43200 secs, Renewal: 21600 secs, Rebind: 37800 secs Temp default-gateway addr: 192.168.105.1 Next timer fires after: 02:04:31 Retry count: 0 Client-ID: cisco-d46d.50b3.cdb3-Gi8 Client-ID hex dump: 636973636F2D643436642E353062332E 636462332D476938 Hostname: Router RT-1#show ip route static Gateway of last resort is 192.168.105.1 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 192.168.105.1 こっちの設定
  • 14.
    【Cisco】#12 PATの設定2 FORSE 手順8 DHCPサーバとしてIPを払い出す設定を追加します pool-10(pool-20,pool-30、pool-40)という名前を付けます ネットワークアドレスを指定します (192.168.10.0/24、192.168.20.0/24、192.168.30.0/24、192.168.40.0/24) 手順9デフォルトゲートウェイを指定します。 (192.168.10.1、192.168.20.1、192.168.30.1、192.168.40.1) DNSサーバを指定します。 手順10 DHCPサーバから除外するIPアドレスを設定します (192.168.10.1、192.168.20.1、192.168.30.1、192.168.40.1) DHCPサーバの設定 14 RT-1#configure terminal RT-1(dhcp-config)#ip dhcp pool pool-10 (pool-20、pool-30、pool-40) RT-1(dhcp-config)#network 192.168.10.0 /24 RT-1(dhcp-config)#default-router 192.168.10.1 RT-1(dhcp-config)#dns-server 8.8.8.8 RT-1(dhcp-config)#exit RT-1(config)#ip dhcp excluded-address 192.168.10.1 こっちの設定
  • 15.
    【Cisco】#12 PATの設定3 FORSE 手順11 作成済みのインターフェース(vlan10、vlan20、vlan30、 vlan40)にIPアドレスの設定をします。 手順12PAT変換対象となるネットワークアドレスを指定する、ACL (Access Control List)を名前(acl-10、acl-20、acl-30、acl-40)を付 け作成します 手順13 インターフェースにNATの内部/外部を設定します 手順14 NAPT、PAT、IPマスカレードの設定します。 外部インターフェース(Gi#8)に割り当てられたIPアドレスを利用します 外部(インターネット)に向かって送付する通信の送信元IPアドレスを 内部ネットワーク(192.168.10.0/24)から外部インターフェースに採番され た(192.168.105.51/24)13ページの例ならば #一般的には会社で保有しているグローバルアドレス 15 RT-1#configure terminal RT-1(config)#interface vlan10 ←スペースなし(仮想インターフェース作成) RT-1(config-if)#ip address 192.168.10.1 255.255.255.0 RT-1(config-if)#no shutdown RT-1(config-if)#exit RT-1(config)#interface range gigabitEthernet 0-7 RT-1(config-if)#switchport access vlan 10 RT-1(config-if)#exit RT-1(config)#ip access-list standard acl-10 RT-1(config-std-nacl)#permit 192.168.10.0 0.0.0.255 RT-1(config-std-nacl)#exit RT-1(config)# RT-1(config)#interface vlan10 RT-1(config-if)#ip nat inside ←vlan10を内部インターフェースに RT-1(config-if)#exit RT-1(config)#interface GigabitEthernet 8 RT-1(config-if)#ip nat outside ←Gi8を外部インターフェースに RT-1(config-if)#exit RT-1(config)#ip nat inside source list acl-10 interface GigabitEthernet8 overload
  • 16.
    【Cisco】#12 PATの設定4 FORSE 手順15 DHCPプールの検証 手順16 DHCP設定の確認 手順17アクセスリストの確認 手順18 インターフェースの確認 16 RT-1#show ip dhcp pool Pool pool-10 : Utilization mark (high/low) : 100 / 0 Subnet size (first/next) : 0 / 0 Total addresses : 254 Leased addresses : 1 Pending event : none 1 subnet is currently in the pool : Current index IP address range Leased addresses 192.168.10.3 192.168.10.1 - 192.168.10.254 1 RT-1#show run | section ip dhcp ip dhcp excluded-address 192.168.10.1 ←除外しているアドレス ip dhcp pool pool-10 network 192.168.10.0 255.255.255.0 ←ネットワークアドレス default-router 192.168.10.1 dns-server 8.8.8.8 RT-3# RT-3#show access-lists Standard IP access list acl-30 10 permit 192.168.30.0, wildcard bits 0.0.0.255 (249 matches) RT-3# RT-3#show run | section interface Vlan30 interface Vlan30 ip address 192.168.30.1 255.255.255.0 ip nat inside ip virtual-reassembly in RT-3#show run | section interface GigabitEthernet8 interface GigabitEthernet8 ip address dhcp ip nat outside ip virtual-reassembly in duplex auto speed auto ip nat inside source list acl-30 interface GigabitEthernet8 overload RT-3# 次の採番 IP範囲 払い出した数 ヒットカウント 名前確認 名前確認
  • 17.
    【Cisco】#12 PATの設定5 FORSE 手順19 コマンドプロンプトで「ipconfig-all」 DHCPクライアントとして、IPアドレスが取得出来ているか 手順20 ブラウザから天気を確認 おしまい。 17 C:¥Users¥t_suz>ipconfig -all イーサネット アダプター イーサネット: 接続固有の DNS サフィックス . . . . .: 説明. . . . . . . . . . . . . . . . .: Intel(R) Ethernet Connection (6) I219-LM 物理アドレス. . . . . . . . . . . . .: BC-C3-42-CA-BA-01 DHCP 有効 . . . . . . . . . . . . . .: はい 自動構成有効. . . . . . . . . . . . .: はい IPv4 アドレス . . . . . . . . . . . .: 192.168.30.2(優先) サブネット マスク . . . . . . . . . .: 255.255.255.0 リース取得. . . . . . . . . . . . . .: 2021年3月18日 20:10:03 リースの有効期限. . . . . . . . . . .: 2021年3月19日 20:10:03 デフォルト ゲートウェイ . . . . . . .: 192.168.30.1 DHCP サーバー . . . . . . . . . . . .: 192.168.30.1 DNS サーバー. . . . . . . . . . . . .: 8.8.8.8 NetBIOS over TCP/IP . . . . . . . . .: 有効