質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
ネットワーク

ネットワークとは、複数のコンピューター間を接続する技術です。インターネットが最も主流なネットワークの形態で、TCP/IP・HTTP・DNSなどの様々なプロトコルや、ルータやサーバーなどの様々な機器の上に成り立っています。

CCNA

Cisco Certified Network Associate (CCNA)

CCNP

Cisco Certified Network Professional(CCNP)

ネットワークスペシャリスト

ネットワークスペシャリスト試験 (NW)は、IPA 独立行政法人 情報処理推進機構の実施している国家資格です。

Q&A

解決済

4回答

6998閲覧

サブインターフェースのvlan間通信ができない

narururu

総合スコア172

ネットワーク

ネットワークとは、複数のコンピューター間を接続する技術です。インターネットが最も主流なネットワークの形態で、TCP/IP・HTTP・DNSなどの様々なプロトコルや、ルータやサーバーなどの様々な機器の上に成り立っています。

CCNA

Cisco Certified Network Associate (CCNA)

CCNP

Cisco Certified Network Professional(CCNP)

ネットワークスペシャリスト

ネットワークスペシャリスト試験 (NW)は、IPA 独立行政法人 情報処理推進機構の実施している国家資格です。

0グッド

0クリップ

投稿2019/07/03 15:19

編集2019/07/10 12:33

###実現したいこと
サブインターフェースを使ったvlan間ルーティングで通信したい。

###構成図
※GNS3
イメージ説明

###ステータス
R1のサブインターフェースの物理、論理ともにdownになっている。
R1とL2SWでno shutの設定しインターフェースを開放済みなので、原因不明。

R1#show ip int b Interface IP-Address OK? Method Status Protocol FastEthernet0/0 unassigned YES unset administratively down down FastEthernet0/0.1 192.168.1.254 YES manual administratively down down FastEthernet0/0.2 192.168.2.254 YES manual administratively down down FastEthernet0/0.3 192.168.3.254 YES manual administratively down down Serial0/0 unassigned YES unset administratively down down FastEthernet0/1 unassigned YES unset administratively down down Serial0/1 unassigned YES unset administratively down down Serial0/2 unassigned YES unset administratively down down FastEthernet1/0 unassigned YES unset up down FastEthernet1/1 unassigned YES unset up down FastEthernet1/2 unassigned YES unset up down FastEthernet1/3 unassigned YES unset up down FastEthernet1/4 unassigned YES unset up down FastEthernet1/5 unassigned YES unset up down FastEthernet1/6 unassigned YES unset up down FastEthernet1/7 unassigned YES unset up down FastEthernet1/8 unassigned YES unset up down FastEthernet1/9 unassigned YES unset up down FastEthernet1/10 unassigned YES unset up down FastEthernet1/11 unassigned YES unset up down FastEthernet1/12 unassigned YES unset up down FastEthernet1/13 unassigned YES unset up down FastEthernet1/14 unassigned YES unset up down FastEthernet1/15 unassigned YES unset up down Vlan1 unassigned YES unset up down

###設定内容
◆R1

R1#show run Building configuration... Current configuration : 1862 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 no ip icmp rate-limit unreachable ip cef ! ! ! ! no ip domain lookup ip auth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ip tcp synwait-time 5 ! ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface FastEthernet0/0.1 encapsulation dot1Q 1 native ip address 192.168.1.254 255.255.255.0 ! interface FastEthernet0/0.2 encapsulation dot1Q 2 ip address 192.168.2.254 255.255.255.0 ! interface FastEthernet0/0.3 encapsulation dot1Q 3 ip address 192.168.3.254 255.255.255.0 ! interface Serial0/0 no ip address shutdown clock rate 2000000 ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface Serial0/1 no ip address shutdown clock rate 2000000 ! interface Serial0/2 no ip address shutdown clock rate 2000000 ! interface FastEthernet1/0 shutdown ! interface FastEthernet1/1 ! interface FastEthernet1/2 ! interface FastEthernet1/3 ! interface FastEthernet1/4 ! interface FastEthernet1/5 ! interface FastEthernet1/6 ! interface FastEthernet1/7 ! interface FastEthernet1/8 ! interface FastEthernet1/9 ! interface FastEthernet1/10 ! interface FastEthernet1/11 ! interface FastEthernet1/12 ! interface FastEthernet1/13 ! interface FastEthernet1/14 ! interface FastEthernet1/15 ! interface Vlan1 no ip address ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ! no cdp log mismatch duplex ! ! ! control-plane ! ! ! ! ! ! ! ! ! ! line con 0 exec-timeout 0 0 privilege level 15 logging synchronous line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous line vty 0 4 login ! ! end

◆L2SW

L2SW#show run Building configuration... Current configuration : 1743 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname L2SW ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 no ip icmp rate-limit unreachable ip cef ! ! ! ! no ip domain lookup ip auth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ip tcp synwait-time 5 ! ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface Serial0/0 no ip address shutdown clock rate 2000000 ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface Serial0/1 no ip address shutdown clock rate 2000000 ! interface Serial0/2 no ip address shutdown clock rate 2000000 ! interface FastEthernet1/0 no switchport no ip address shutdown ! interface FastEthernet1/1 switchport access vlan 10 ! interface FastEthernet1/2 switchport access vlan 20 ! interface FastEthernet1/3 switchport access vlan 30 ! interface FastEthernet1/4 ! interface FastEthernet1/5 ! interface FastEthernet1/6 ! interface FastEthernet1/7 ! interface FastEthernet1/8 ! interface FastEthernet1/9 ! interface FastEthernet1/10 switchport trunk allowed vlan 1,2,10,20,30,1002-1005 ! interface FastEthernet1/11 ! interface FastEthernet1/12 ! interface FastEthernet1/13 ! interface FastEthernet1/14 ! interface FastEthernet1/15 ! interface Vlan1 no ip address ! ip forward-protocol nd ! ! no ip http server no ip http secure-server ! no cdp log mismatch duplex ! ! ! control-plane ! ! ! ! ! ! ! ! ! ! line con 0 exec-timeout 0 0 privilege level 15 logging synchronous line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous line vty 0 4 login ! ! end

◆PC-1
イメージ説明
◆PC-2
イメージ説明
◆PC-3
イメージ説明

なぜIFがダウンになっているのか、原因が分かりません。
どなたか、私にアドバイスしていただけませんでしょうか(>_<)

以上、よろしくお願いいたします。

###追記
物理IFのダウンの原因は大元のfa0/0がshutdownになっていたままだからでした。
開放後、ステータスは以下の通り、想定通りの結果になりました。
イメージ説明
ところがどっこい、vlan間通信はおろか、PCからR1へも通信がまだできない状態です。

###追記2

L2SW#show int status Port Name Status Vlan Duplex Speed Type Fa1/0 disabled routed auto auto 10/100BaseTX Fa1/1 connected 10 a-full a-100 10/100BaseTX Fa1/2 connected 20 a-full a-100 10/100BaseTX Fa1/3 connected 30 a-full a-100 10/100BaseTX Fa1/4 notconnect 1 auto auto 10/100BaseTX Fa1/5 notconnect 1 auto auto 10/100BaseTX Fa1/6 notconnect 1 auto auto 10/100BaseTX Fa1/7 notconnect 1 auto auto 10/100BaseTX Fa1/8 notconnect 1 auto auto 10/100BaseTX Fa1/9 notconnect 1 auto auto 10/100BaseTX Fa1/10 connected 1 a-full a-100 10/100BaseTX Fa1/11 notconnect 1 auto auto 10/100BaseTX Fa1/12 notconnect 1 auto auto 10/100BaseTX Fa1/13 notconnect 1 auto auto 10/100BaseTX Fa1/14 notconnect 1 auto auto 10/100BaseTX Fa1/15 notconnect 1 auto auto 10/100BaseTX

###追記3
イメージ説明

###追記
イメージ説明

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答4

0

案1)vlanインタフェースを作成する
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 192.168.1.254 255.255.255.0
!

interface Vlan10
ip address 192.168.1.254 255.255.255.0
!

案2)fa0/0は機器間接続のみとし、fa0/1をサブインタフェースにしてみる
interface FastEthernet0/0
encapsulation dot1Q 10,20,30
!

interface FastEthernet0/1.1
switchport access vlan 10
!

interface Vlan10
ip address 192.168.1.254 255.255.255.0
!

投稿2019/07/04 05:30

yukky1201

総合スコア2751

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

narururu

2019/07/04 12:02

ご回答ありがとうございます!yukky1201さん☺ 案1について質問がございます! サブインターフェースの通信ではルータにはSVIを作成しないものだと認識しておりましたが、 私の勘違いなのでしょうか。 サブインターフェースの設定はイメージとしてはルーテッドポートの設定に近いと考えてました。 しかし実は、トランクリンクの設定だろうがサブインターフェースの設定だろうが、どちらもSVIを作成し、通信経路を1本のケーブル内でタグ付けしたパケットを通すか(トランクリンク)、論理的に複数に経路を分割してタグ付けしたパケットを通すか(サブインターフェース)の違いって理解で正しいでしょうか。
narururu

2019/07/04 12:18 編集

ありま、先ほど案1を試してみたのですが、fa0/0.1で192.168.1.254/24の設定をした状態だと、SVIは作成できないようです。「追記3」で画像を貼っておきます。 GNS3の仕様なのかな。。。
narururu

2019/07/04 12:35

また、案2も試そうとしたのですが、ご提示いただきました設定は反映できませんでした(>_<) 「?」で一覧を見るとコマンドが表示されませんでした(>_<)
yukky1201

2019/07/05 01:40

https://www.infraexpert.com/study/vlanz9.html を見ると もともとのnarururuさんのコンフィグで疎通できそうですね。失礼しました。 ちなみにR1自身でpingは応答ありますか R1#ping 192.168.1.254 R1#ping 192.168.2.254 R1#ping 192.168.3.254
narururu

2019/07/10 12:14

ご連絡が遅くなり大変申し訳ございません。 R1自身でのpingは応答あります。
guest

0

ベストアンサー

改めて質問内容を見返したところ一部設定が誤っているのではと感じました。
sh int status(追記2)のfa1/0が "routed"(ルーテッドポート) になっているのが原因
なのではないでしょうか?

↓参考までに私の環境のせときます。

config

1SW#sh int status 2 3Port Name Status Vlan Duplex Speed Type 4Fa0/0 connected trunk <<★ a-full a-100 10/100BaseTX 5Fa0/1 connected 10 a-full a-100 10/100BaseTX 6Fa0/2 connected 20 a-full a-100 10/100BaseTX 7Fa0/3 connected 30 a-full a-100 10/100BaseTX

L3SWのルーテッドポートはルータのIFとは違い、サブIFが作れない&VLANが1つしか通せないため
今回の環境には適していないかと思います。
参考URL:ネットワークエンジニアとして

なのでSWのRT向けのポートをL2スイッチポートに変更しトランクポートの設定を再度実施すればよいかと思います。

設定変更後はsh int status & sh int trunkコマンドで確認してみてください!

config

1SW#sh int trunk 2 3Port Mode Encapsulation Status Native vlan 4Fa0/0 on 802.1q trunking 1 5 6Port Vlans allowed on trunk 7Fa0/0 1-1005 8 9Port Vlans allowed and active in management domain 10Fa0/0 1,10,20,30 <<★ 11 12Port Vlans in spanning tree forwarding state and not pruned 13Fa0/0 1,10,20,30

↑ Fa0/0がトランクになっているか、各VLANがアクティブになっているか(<<★部分)


余談かもしれませんが私の環境は質問者様と異なった環境だったかもしれないと思い
もう一度検証してみました。
というのも私の以前の環境ではSWについてはIOUで設定していました。
(設定方法:メニューのEdit→Preferences→IOS on UNIX→IOU Devices)

質問者様の過去の質問をサラッと見てみたところ、RTのSlots設定をNM-16ESWに変更して
実装しているのかと思い、その構成でも試してみました。

同じ設定で行けるかと思いきや一部コマンド体系が変わることがわかりました。

<構成>

構成
SW設定

<設定したコンフィグ>

[RT]
前回の回答と同様
[各PC]
前回の回答と同様

[SW]
前回のものを流用しようとしたところ一部コマンドがはじかれたので修正してます
[SW f0/0(RT向け)]

error

1SW(config-if)# switchport trunk allowed vlan 1,10,20,30 2Command rejected: Bad VLAN allowed list. You have to include all default vlans, e.g. 1-2,1002-1005.

default vlanである1-2,1002-1005も指定しないとだめなようです。以下のように修正。

config

1SW(config-if)# switchport trunk allowed vlan add 1,10,20,30

[SW f0/1~3(PC向け)]

error

1SW(config-if)# switchport access vlan 10 2%Access VLAN 10 does not exist. Please add it to vlan database

先にvlan datavaseモードでvlanを作成しないとだめなようです。以下のように修正。

config

1※特権モードで設定 2SW#vlan database 3SW(vlan)#vlan 10 4SW(vlan)#vlan 20 5SW(vlan)#vlan 30 6! 7conf t 8int fa0/0 9 switchport trunk encapsulation dot1q 10 switchport trunk allowed vlan add 1,10,20,30 11 switchport mode trunk 12! 13int fa0/1 14 switchport access vlan 10 15 switchport mode access 16! 17int fa0/2 18 switchport access vlan 20 19 switchport mode access 20! 21int fa0/3 22 switchport access vlan 30 23 switchport mode access

<設定確認>

config

1SW#sh run 2! 3interface FastEthernet0/0 4 switchport mode trunk 5! 6interface FastEthernet0/1 7 switchport access vlan 10 8! 9interface FastEthernet0/2 10 switchport access vlan 20 11! 12interface FastEthernet0/3 13 switchport access vlan 30 14! 15interface FastEthernet0/4 16 switchport access vlan 40 17!

↑ 設定が入っていることを確認(一部configはrunning-configは反映されません。)

config

1SW#sh vlan-switch brief 2 3VLAN Name Status Ports 4---- -------------------------------- --------- ------------------------------- 51 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8 6 Fa0/9, Fa0/10, Fa0/11, Fa0/12 7 Fa0/13, Fa0/14, Fa0/15 810 VLAN0010 active Fa0/1 920 VLAN0020 active Fa0/2 1030 VLAN0030 active Fa0/3 111002 fddi-default active 121003 token-ring-default active 131004 fddinet-default active 141005 trnet-default active

↑ fa0/1-3が各VLANに割り当てられているか確認

config

1SW#sh int trunk 2 3Port Mode Encapsulation Status Native vlan 4Fa0/0 on 802.1q trunking 1 5 6Port Vlans allowed on trunk 7Fa0/0 1-1005 8 9Port Vlans allowed and active in management domain 10Fa0/0 1,10,20,30 <<★ 11 12Port Vlans in spanning tree forwarding state and not pruned 13Fa0/0 1,10,20,30

↑ Fa0/0がトランクになっているか、各VLANがアクティブになっているか(<<★部分)

<備考>

ARPの出力について

config

1SW#sh ip arp 2SW# 3R1#sh ip arp 4Protocol Address Age (min) Hardware Addr Type Interface 5Internet 192.168.1.1 60 0050.7966.6800 ARPA FastEthernet0/0.1 6Internet 192.168.3.1 19 0050.7966.6802 ARPA FastEthernet0/0.3 7Internet 192.168.2.1 19 0050.7966.6801 ARPA FastEthernet0/0.2 8Internet 192.168.2.254 - cc01.41d0.0000 ARPA FastEthernet0/0.2 9Internet 192.168.3.254 - cc01.41d0.0000 ARPA FastEthernet0/0.3 10Internet 192.168.1.254 - cc01.41d0.0000 ARPA FastEthernet0/0.1

↑ SWでは確かにarpの出力なしですがRTではPCのアドレスを学習していました。

投稿2019/07/11 03:05

kuroro1991

総合スコア23

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

narururu

2019/07/11 12:50

ご丁寧にありがとうございます!kuroro1991さん☺ 原因が判明しました。 なぜか、L2SWのfa1/10ですが、switchport mode trunk が正しく適用されていませんでした。 ご提示いただいたshow int trunkで何も表示されなかったので、試しに上記コマンドを入力したところ、ステータスが表示され、vlan間ルーティングもできるようになりました。 show runの結果だけでは確認できないこともあることを今回の事象で思い知りました。 show int trunkなんて初めて打ちました。 勉強になりました('ω') 本当にありがとうございました!
guest

0

気になったのでGNS3で質問者様の構成をまねて動作確認してみました。
以下の設定で私の環境ではPC間のping試験まで正常にできましたよ。

結論としてはすでにある回答でよいかと思います。
RTはサブIFの作成とVLAN番号とマッピングの設定をする
SWはPC向けのポートをアクセスにRT向けをトランクにする
(allowed vlanはなくてもOK)
PCはIPとデフォルトGWの設定をする

GNS3はじっと違いちょっとしたところで躓いたりするのでいろいろと試す必要があるかもしれません。
(個人的にはスペースとお金はかからない分時間がかかってる気がします)

<環境>

OS:Windows10
GNS3 2.1.11
VM:VirtualBox 5.2.20r125813

<構成>

SWのIFは適宜読み替えてください。
イメージ説明

<設定したコンフィグ>

** [R1] **

config

1interface FastEthernet0/0 2 no shutdown 3! 4interface FastEthernet0/0.1 5 encapsulation dot1Q 10 6 ip address 192.168.1.254 255.255.255.0 7 no shutdown 8! 9interface FastEthernet0/0.2 10 encapsulation dot1Q 20 11 ip address 192.168.2.254 255.255.255.0 12 no shutdown 13! 14interface FastEthernet0/0.3 15 encapsulation dot1Q 30 16 ip address 192.168.3.254 255.255.255.0 17 no shutdown

** [Switch1] **

config

1interface Ethernet0/0 2 switchport trunk encapsulation dot1q 3 switchport trunk allowed vlan 1,10,20,30 4 switchport mode trunk 5! 6interface Ethernet0/1 7 switchport access vlan 10 8 switchport mode access 9! 10interface Ethernet0/2 11 switchport access vlan 20 12 switchport mode access 13! 14interface Ethernet0/3 15 switchport access vlan 30 16 switchport mode access

config

1** [PC-1] ** 2ip 192.168.1.1 255.255.255.0 192.168.1.254 3 4** [PC-2] ** 5ip 192.168.2.1 255.255.255.0 192.168.2.254 6 7** [PC-3] ** 8ip 192.168.3.1 255.255.255.0 192.168.3.254

<Ping試験>

一部抜粋

PC-1> ping 192.168.3.1 84 bytes from 192.168.3.1 icmp_seq=1 ttl=63 time=24.409 ms 84 bytes from 192.168.3.1 icmp_seq=2 ttl=63 time=17.573 ms 84 bytes from 192.168.3.1 icmp_seq=3 ttl=63 time=14.645 ms 84 bytes from 192.168.3.1 icmp_seq=4 ttl=63 time=20.502 ms 84 bytes from 192.168.3.1 icmp_seq=5 ttl=63 time=15.621 ms PC-1> ping 192.168.2.1 192.168.2.1 icmp_seq=1 timeout 84 bytes from 192.168.2.1 icmp_seq=2 ttl=63 time=19.526 ms 84 bytes from 192.168.2.1 icmp_seq=3 ttl=63 time=17.575 ms 84 bytes from 192.168.2.1 icmp_seq=4 ttl=63 time=16.597 ms 84 bytes from 192.168.2.1 icmp_seq=5 ttl=63 time=16.597 ms

投稿2019/07/10 09:13

kuroro1991

総合スコア23

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

narururu

2019/07/10 12:34 編集

ご回答ありがとうございます!kuroro1991さん☺ ご提示いただいた設定と同様にも関わらず、疎通できない状態です(>_<)泣 L2SWはarp解決もされていません。 しかし、show ip int bでは双方でup/upなんです。 物理論理接続できているのに、なぜかL2SW←→PC間で疎通できません。 もはやバグとしか思えなくなってきました(゜▽゜) 今までの経験上、最初から作り直したら上手くいくかもしれません。 ※追記4にshow ip int b とshow arpの結果を載せました。
guest

0

Router の encapsulation dot1Q のあとは 10などの対象switchのvlanidが入るのではないでしょうか
Switchにswitchport mode access 、switchport mode trunkも必要かも。

投稿2019/07/03 21:50

scsi

総合スコア2840

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

narururu

2019/07/03 22:42

ご回答ありがとうございます!scaiさん☺ R1のdot1qの設定にvlanIDをそれぞれ10,20,30に変更後、疎通確認しましたが、通信できなかったです。 また、SWにはaccess,trunk設定はしております。
scsi

2019/07/03 22:55

switchport mode の設定入ってますか?入ってないように見えましたが。 Switchのshow int status とか見たいですね。
narururu

2019/07/03 23:15

switchport modeの設定はしております。 GNS3のshow runですと表示されない仕様みたいです。 今日帰ったら(20時30分頃)show int statusします。
scsi

2019/07/03 23:17

なるほど!表示されないようになったのですね。失礼しました。
narururu

2019/07/04 12:08

お待たせしました。 ご依頼のshow int statusの結果を「追記2」に記載しましたので、 もしよろしければご覧ください。
scsi

2019/07/04 12:59

routerのFastEthernet0/0はno shutですか?
narururu

2019/07/10 12:15

ご連絡が遅くなり大変申し訳ございません。 Routerのfa0/0はno shutになっております。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問