Skip to content

Instantly share code, notes, and snippets.

@sugyo
Last active January 3, 2016 11:19
Show Gist options
  • Save sugyo/8455518 to your computer and use it in GitHub Desktop.
Save sugyo/8455518 to your computer and use it in GitHub Desktop.
ubuntu 12.04.3 serverでvxlanを動かすメモ

ubuntu 12.04.3 serverのカーネルとvxlanモジュールについて

Ubuntu 12.04.3のカーネルは、3.8系のカーネルなので全部最新にしてiproute2も最新にしたらubuntu 12.04でカーネルモジュールのvxlanが動きました

iproute2の取得とコンパイル

sudo apt-get install bison flex gcc git iptables-dev libdb-dev make
git clone git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
cd iproute2
./configure
make

または、Ubuntu 13.04のiprouteでもいいかもしれない

[[http://mirrors.kernel.org/ubuntu/pool/main/i/iproute/iproute_20121211-2ubuntu1_amd64.deb]]

vxlan モジュールの読み込み

vxlanで使用するudpのポート番号をここで設定する (デフォルトは、 8472となっている)

modprobe vxlan udp_port=4789

vxlanインターフェースの作成とアドレスの設定

./ip/ip link add vxlan10 type vxlan id 10 group 239.0.0.1 dstport 0 dev eth0
./ip/ip addr 192.168.0.1/24 broadcast 192.168.0.255 dev vxlan10
./ip/ip link set dev vxlan10 up

ubuntu12.04.3のカーネルだと、dstport で指定したポート番号は無視された dstportは、省略できなかったので、デフォルトのポート番号を利用することを意味する0を指定している

設定した情報の確認

./ip/ip -d link show vxlan10

-dを指定しないと設定した情報が表示されない。-d は、-detailsと同じ

fdbの参照

./bridge/bridge fdb show dev vxlan10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment