Created
July 29, 2014 10:43
-
-
Save PharaohKJ/3d59ae939b3ee9c40ccf to your computer and use it in GitHub Desktop.
GREやってみよう ref: http://qiita.com/PharaohKJ/items/1540fe6e33d6a46ec26d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# addgreether REMOTE_IP LOCAL_IP GRE_KEY LOCAL_SLICE_IP | |
ip link add gre1 type gretap remote ${1} local ${2} key ${3} | |
ip addr add ${4} dev gre1 | |
ip link set gre1 up | |
ip link set gre1 mtu 1450 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# addgreip REMOTE_IP LOCAL_IP GRE_KEY LOCAL_SLICE_IP | |
ip tunnel add gre0 mode gre remote ${1} local ${2} key ${3} | |
ip addr add ${4} dev gre0 | |
ip link set gre0 up | |
ip link set gre0 mtu 1460 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir -p ~/vagrant_work/alpha | |
$ cd ~/vagrant_work/alpha | |
$ vagrant init ubuntu14.04 https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box | |
$ vagrant up | |
$ vagrant ssh | |
vagrant@vagrant-ubuntu-trusty-64:~$ cat /etc/issue | |
Ubuntu 14.04.1 LTS \n \l | |
vagrant@vagrant-ubuntu-trusty-64:~$ ip addr | |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default | |
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | |
inet 127.0.0.1/8 scope host lo | |
valid_lft forever preferred_lft forever | |
inet6 ::1/128 scope host | |
valid_lft forever preferred_lft forever | |
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 | |
link/ether 08:00:27:db:07:90 brd ff:ff:ff:ff:ff:ff | |
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 | |
valid_lft forever preferred_lft forever | |
inet6 fe80::a00:27ff:fedb:790/64 scope link | |
valid_lft forever preferred_lft forever | |
vagrant@vagrant-ubuntu-trusty-64:~$ wget google.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir -p ~/vagrant_work/beta | |
$ cd ~/vagrant_work/beta | |
$ vagrant init ubuntu14.04 https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box | |
$ vagrant up | |
$ vagrant ssh | |
vagrant@vagrant-ubuntu-trusty-64:~$ cat /etc/issue | |
Ubuntu 14.04.1 LTS \n \l | |
vagrant@vagrant-ubuntu-trusty-64:~$ ip address | |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default | |
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | |
inet 127.0.0.1/8 scope host lo | |
valid_lft forever preferred_lft forever | |
inet6 ::1/128 scope host | |
valid_lft forever preferred_lft forever | |
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 | |
link/ether 08:00:27:db:07:90 brd ff:ff:ff:ff:ff:ff | |
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 | |
valid_lft forever preferred_lft forever | |
inet6 fe80::a00:27ff:fedb:790/64 scope link | |
valid_lft forever preferred_lft forever | |
vagrant@vagrant-ubuntu-trusty-64:~$ wget google.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@vagrant-ubuntu-trusty-64:~$ sudo ip tunnel add gree0 mode gre remote 10.0.2.5 local 10.0.2.6 key 1 | |
vagrant@vagrant-ubuntu-trusty-64:~$ sudo ip link set gree0 up | |
vagrant@vagrant-ubuntu-trusty-64:~$ sudo ip addr add 192.168.1.1/24 dev gree0 | |
vagrant@vagrant-ubuntu-trusty-64:~$ ifconfig | |
eth0 Link encap:Ethernet HWaddr 08:00:27:db:07:90 | |
inet addr:192.168.255.15 Bcast:192.168.255.255 Mask:255.255.255.0 | |
inet6 addr: fe80::a00:27ff:fedb:790/64 Scope:Link | |
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 | |
RX packets:1548 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:1022 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:1000 | |
RX bytes:119782 (119.7 KB) TX bytes:91629 (91.6 KB) | |
eth1 Link encap:Ethernet HWaddr 08:00:27:54:05:c5 | |
inet addr:10.0.2.6 Bcast:10.0.2.255 Mask:255.255.255.0 | |
inet6 addr: fe80::a00:27ff:fe54:5c5/64 Scope:Link | |
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 | |
RX packets:77 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:79 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:1000 | |
RX bytes:19851 (19.8 KB) TX bytes:10911 (10.9 KB) | |
gree0 Link encap:UNSPEC HWaddr 0A-00-02-06-00-00-00-00-00-00-00-00-00-00-00-00 | |
inet addr:192.168.1.1 P-t-P:192.168.1.1 Mask:255.255.255.0 | |
inet6 addr: fe80::5efe:a00:206/64 Scope:Link | |
UP POINTOPOINT RUNNING NOARP MTU:1472 Metric:1 | |
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:0 | |
RX bytes:0 (0.0 B) TX bytes:192 (192.0 B) | |
lo Link encap:Local Loopback | |
inet addr:127.0.0.1 Mask:255.0.0.0 | |
inet6 addr: ::1/128 Scope:Host | |
UP LOOPBACK RUNNING MTU:65536 Metric:1 | |
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:0 | |
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | |
vagrant@vagrant-ubuntu-trusty-64:~$ ip route show | |
default via 10.0.2.1 dev eth1 | |
10.0.2.0/24 dev eth1 proto kernel scope link src 10.0.2.6 | |
192.168.1.0/24 dev gree0 proto kernel scope link src 192.168.1.1 | |
192.168.255.0/24 dev eth0 proto kernel scope link src 192.168.255.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@vagrant-ubuntu-trusty-64:~$ sudo ip link set gree0 up | |
vagrant@vagrant-ubuntu-trusty-64:~$ sudo ip addr add 192.168.1.2/24 dev gree0 | |
vagrant@vagrant-ubuntu-trusty-64:~$ ifconfig | |
eth0 Link encap:Ethernet HWaddr 08:00:27:db:07:90 | |
inet addr:192.168.255.15 Bcast:192.168.255.255 Mask:255.255.255.0 | |
inet6 addr: fe80::a00:27ff:fedb:790/64 Scope:Link | |
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 | |
RX packets:2371 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:1601 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:1000 | |
RX bytes:199693 (199.6 KB) TX bytes:138770 (138.7 KB) | |
eth1 Link encap:Ethernet HWaddr 08:00:27:2a:5e:f5 | |
inet addr:10.0.2.5 Bcast:10.0.2.255 Mask:255.255.255.0 | |
inet6 addr: fe80::a00:27ff:fe2a:5ef5/64 Scope:Link | |
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 | |
RX packets:1086 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:1381 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:1000 | |
RX bytes:1313637 (1.3 MB) TX bytes:157002 (157.0 KB) | |
gree0 Link encap:UNSPEC HWaddr 0A-00-02-05-00-00-00-00-00-00-00-00-00-00-00-00 | |
inet addr:192.168.1.2 P-t-P:192.168.1.2 Mask:255.255.255.0 | |
inet6 addr: fe80::5efe:a00:205/64 Scope:Link | |
UP POINTOPOINT RUNNING NOARP MTU:1472 Metric:1 | |
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:0 | |
RX bytes:0 (0.0 B) TX bytes:192 (192.0 B) | |
lo Link encap:Local Loopback | |
inet addr:127.0.0.1 Mask:255.0.0.0 | |
inet6 addr: ::1/128 Scope:Host | |
UP LOOPBACK RUNNING MTU:65536 Metric:1 | |
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | |
collisions:0 txqueuelen:0 | |
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | |
vagrant@vagrant-ubuntu-trusty-64:~$ ip route show | |
default via 10.0.2.1 dev eth1 | |
10.0.2.0/24 dev eth1 proto kernel scope link src 10.0.2.5 | |
192.168.1.0/24 dev gree0 proto kernel scope link src 192.168.1.2 | |
192.168.255.0/24 dev eth0 proto kernel scope link src 192.168.255.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ip link set gree0 down | |
sudo ip tunnel del gree0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install docker.io | |
$ sudo docker.io pull ubuntu:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.vm.provider "virtualbox" do |vb| | |
vb.customize ["modifyvm", :id, "--nic2","natnetwork"] | |
vb.customize ["modifyvm", :id, "--nictype2","82540EM"] | |
vb.customize ["modifyvm", :id, "--nicpromisc2","allow-all"] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@vagrant-ubuntu-trusty-64:/etc/network/interfaces.d# sed -e "s/eth0/eth1/g" eth0.cfg > eth1.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@vagrant-ubuntu-trusty-64:~$ ip address | |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default | |
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | |
inet 127.0.0.1/8 scope host lo | |
valid_lft forever preferred_lft forever | |
inet6 ::1/128 scope host | |
valid_lft forever preferred_lft forever | |
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 | |
link/ether 08:00:27:db:07:90 brd ff:ff:ff:ff:ff:ff | |
inet 192.168.255.15/24 brd 192.168.255.255 scope global eth0 | |
valid_lft forever preferred_lft forever | |
inet6 fe80::a00:27ff:fedb:790/64 scope link | |
valid_lft forever preferred_lft forever | |
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 | |
link/ether 08:00:27:54:05:c5 brd ff:ff:ff:ff:ff:ff | |
inet 10.0.2.6/24 brd 10.0.2.255 scope global eth1 | |
valid_lft forever preferred_lft forever | |
inet6 fe80::a00:27ff:fe54:5c5/64 scope link | |
valid_lft forever preferred_lft forever |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@vagrant-ubuntu-trusty-64:~$ ip address | |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default | |
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | |
inet 127.0.0.1/8 scope host lo | |
valid_lft forever preferred_lft forever | |
inet6 ::1/128 scope host | |
valid_lft forever preferred_lft forever | |
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 | |
link/ether 08:00:27:db:07:90 brd ff:ff:ff:ff:ff:ff | |
inet 192.168.255.15/24 brd 192.168.255.255 scope global eth0 | |
valid_lft forever preferred_lft forever | |
inet6 fe80::a00:27ff:fedb:790/64 scope link | |
valid_lft forever preferred_lft forever | |
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 | |
link/ether 08:00:27:2a:5e:f5 brd ff:ff:ff:ff:ff:ff | |
inet 10.0.2.5/24 brd 10.0.2.255 scope global eth1 | |
valid_lft forever preferred_lft forever | |
inet6 fe80::a00:27ff:fe2a:5ef5/64 scope link | |
valid_lft forever preferred_lft forever |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@vagrant-ubuntu-trusty-64:~$ sudo lsmod |grep gre | |
ip_gre 18245 0 | |
gre 13796 1 ip_gre | |
ip_tunnel 23768 1 ip_gre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@vagrant-ubuntu-trusty-64:~$ sudo ip tunnel add gre0 mode gre remote 10.0.2.5 local 10.0.2.6 ttl 255 | |
add tunnel "gre0" failed: No buffer space available |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment