VLAN+GREなパケットを作ってみる

目的

VLANとGREが併存できるかどうかみたかった。レイヤー違うし出来るはずと思いつつキャプチャしてみたかった。

テスト環境

パソコンが2台もないので、KVM上に仮想PC、仮想ネットワークを用意する。

仮想PC eth0 IPアドレス tunnel IPアドレス
vm0 192.168.100.3 10.0.0.3
vm1 192.168.100.10 10.0.0.10

GRE設定

vm0側

# modprobe ip_gre
# ip tunnel add gretun0 mode gre remote 192.168.100.10 local 192.168.100.3
# ifconfig gretun0 10.0.0.3 netmask 255.255.255.0 up

vm1側

# modprobe ip_gre
# ip tunnel add gretun0 mode gre remote 192.168.100.3 local 192.168.100.10
# ifconfig gretun0 10.0.0.10 netmask 255.255.255.0 up

VLAN設定

vm0側

# modprobe 8021q
# vconfig add eth0 100
# ifconfig eth0.100 10.0.0.3 netmask 255.255.255.0 up

vm1側

# modprobe 8021q
# vconfig add eth0 100
# ifconfig eth0.100 10.0.0.10 netmask 255.255.255.0 up

疎通確認(ping)

ping 10.0.0.10

f:id:netsounds:20130717005345p:plain