vxlanでgceとec2の上に仮想ネットワークを作ってみる
OSはubuntu:14.04を使ってみます。
準備
まずはbridge-utils
をインストールします。
apt-get install bridge-utils
あとは、FWの設定で8472/udp
を開けておきましょう。
node1(EC2)
- global ip: 123.10.20.34 (例)
- local ip: 10.1.2.3
ip li add vxlan0 type vxlan id 10 dev eth0
ip a add 192.168.1.1/24 broadcast 192.168.1.255 dev vxlan0
ip li set vxlan0 up
bridge fdb append 00:00:00:00:00:00 dev vxlan0 dst 210.12.34.56
node2(GCE)
- global ip: 210.12.34.56 (例)
- local ip: 10.200.100.5
ip li add vxlan0 type vxlan id 10 dev eth0
ip a add 192.168.1.2/24 broadcast 192.168.1.255 dev vxlan0
ip li set vxlan0 up
bridge fdb append 00:00:00:00:00:00 dev vxlan0 dst 123.10.20.34
これで ec2とgceにまたがる仮想ネットワークifvxlan0
の準備ができました。相互にping
も通りますし、nc
コマンドでチャットをしてみましょう。
node1
nc -l 192.168.1.1 -p 1234
hello
node2
nc 192.168.1.1 1234
hello
ip li add
で指定したid
は VNI(VXLAN Network Identifier)です。同じ数字を指定すればok。
Author And Source
この問題について(vxlanでgceとec2の上に仮想ネットワークを作ってみる), 我々は、より多くの情報をここで見つけました https://qiita.com/takiuchi/items/2e27a4777d88987cae38著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .