LoginSignup
2
0

More than 5 years have passed since last update.

OpenR (Open Routing) ことはじめ

Last updated at Posted at 2018-02-17

lxcで、擬似ノードを作成し、それらをopen/rでつないでみます。

想定する構成
A<=>FをAct/Stbyで接続することを想定しています。
書いてみたら、リング構成になってしまいました。

    +-<lk1>-(2)[B](1)-<lk2>-(2)[C](1)-<lk3>-+
   (1)                                     (2)
   [A]                                     [F]
   (2)                                     (1)
    +-<lk4>-(1)[D](2)-<lk5>-(1)[E](2)-<lk6>-+

[A]から[F]まで、ルートを通します。
lxc0 : メンテ用 (各lxcのeth0をつなぐ)
lk1-6: D-Plane

[x]...ノード (openr01..openr06)
(y)...ポート (port1, port2)
<z>...リンク (ブリッジで代用)


(90度右回転で書いています)

           [A]
           eth0: 10.0.3.0/24
           eth1: 192.168.111.1
           port1:192.168.221.1
           port2:192.168.224.2

[D]                     [B]
eth0: 10.0.3.0/24       eth0: 10.0.3.0/24 
eth1: 192.168.114.1     eth1: 192.168.112.1
port1:192.168.224.1     port1:192.168.222.1
port2:192.168.225.2     port2:192.168.221.2

[E]                     [C]
eth0: 10.0.3.0/24       eth0: 10.0.3.0/24 
eth1: 192.168.115.1     eth1: 192.168.113.1
port1:192.168.225.1     port1:192.168.223.1
port2:192.168.226.2     port2:192.168.222.2

           [F]
           eth0: 10.0.3.0/24
           eth1: 192.168.116.1
           port1:192.168.226.1
           port2:192.168.223.2

各eth1の下に、clientがぶら下がりますが、この図からは省略

目次

  • lxcのインストール
  • マスターイメージの作成
    • open/rインストール
    • インターフェースの追加
  • 展開
    • コンテナの複製
    • 相互接続
  • openrをいじる
    • 起動
    • 設定
    • 確認
  • ネットワークとしていじる
    • 確認

lxcのインストール

ますは、ノードを作っていきます。
lxcに詳しい方は、読み飛ばしても、構いません。

https://linuxcontainers.org/ja/lxc/getting-started/ に従って、lxcをインストールします。

$ sudo apt-get install lxc
$ sudo lxc-create -t download -n openr00 (ubuntu xenial amd64 を選択)
$ sudo lxc-start -n openr00

これで、コンテナが走り出します。

$ sudo lxc-ls -f
NAME    STATE   AUTOSTART GROUPS IPV4       IPV6 
openr00 RUNNING 0         -      10.0.3.243 -

マスターイメージの作成

コンテナに入ります

$ sudo lxc-attach -n openr00

open/rインストール

gitがいるので、ダウンロードします。

# apt-get install -y git

そして、open/rをgit cloneします。

# git clone https://github.com/facebook/openr
Cloning into 'openr'...
fatal: unable to access 'https://github.com/facebook/openr/': Problem with the SSL CA cert (path? access rights?)

と、思ったら、証明書エラーが出たので、しかたナシに、証明書の無効化。

# git config --global http.sslVerify false

無事に、cloneできたら、ビルドの開始。

(本家より抜粋)
// Step into `build` directory
cd build

// Install dependencies and openr
sudo bash ./build_openr.sh

// Run tests (some tests requires sudo privileges)
sudo make test

本家に書かれているとおり、たくさん、apt-getされます。しばし、待ちです。(40分かかりました)

# time bash ./build_openr.sh

          (略)

+ echo 'OpenR built and installed successfully'
OpenR built and installed successfully
+ exit 0

real    39m26.508s
user    24m22.076s
sys 2m25.412s

テストをしろ、というので、テストします。

# time make test
Running tests...
Total Test time (real) = 281.36 sec

real    4m41.376s
user    2m27.004s
sys 0m51.888s

そして、インストール

make install
# cd
# cd openr/openr/py
# python setup.py build
# python setup.py install

本家によると、これで、インストールは完了。breezeがインストールされた、とのことです。

# which breeze
/usr/local/bin/breeze

インターフェースの追加

再び、lxcの操作に戻ります。知っている人は、読み飛ばしてください。

bridgeの追加

母艦にリンクとなるブリッジを追加します。

$ sudo brctl addbr link1
$ sudo brctl addbr link2
$ sudo brctl addbr link3
$ sudo brctl addbr link4
$ sudo brctl addbr link5
$ sudo brctl addbr link6
$ brctl show
bridge name bridge id       STP enabled interfaces
link1       8000.000000000000   no      
link2       8000.000000000000   no      
link3       8000.000000000000   no      
link4       8000.000000000000   no      
link5       8000.000000000000   no      
link6       8000.000000000000   no      
lxcbr0      8000.00163e000000   no      vethOIK6AP

インターフェースを追加

インターフェースの追加は、次をいじります。

$ sudo vi /var/lib/lxc/openr00/config

Network Configurationの下に、interfaceを追加していきます。
のちのち、prefixで広告するifnameを決めるので、ethやensはやめて、ここではportにしました。(上の図でもport)

lxc.network.type = veth
lxc.network.link = link1
lxc.network.ipv4 = 192.168.221.1/24
lxc.network.name = port1
lxc.network.flags = up

lxc.network.type = veth
lxc.network.link = link4
lxc.network.ipv4 = 192.168.224.2/24
lxc.network.name = port2
lxc.network.flags = up

乗り込んで、確認してみます。ノードAを想定した設定にしています。

root@openr00:~# ifconfig port1
port1     Link encap:Ethernet  HWaddr 00:16:3e:6c:07:90  
          inet addr:192.168.221.1  Bcast:192.168.221.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fe6c:790/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2685 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2575 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:418649 (418.6 KB)  TX bytes:419565 (419.5 KB)
root@openr00:~# ifconfig port2
port2     Link encap:Ethernet  HWaddr 00:16:3e:d3:a4:9b  
          inet addr:192.168.224.2  Bcast:192.168.224.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fed3:a49b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2602 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5433 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:370841 (370.8 KB)  TX bytes:845069 (845.0 KB)

想定どおりに進んだので、これをマスターに、ノードを作成していきます。

展開

試験環境の展開、ということで、展開を進めます。

コンテナの複製

ノードA, B, C, D, E, Fを作っていきます。

$ sudo lxc-clone -o openr00 -n openr-a
lxc-clone is deprecated in favor of lxc-copy.
Created container openr-a as copy of openr00

$ sudo lxc-clone -o openr00 -n openr-b
lxc-clone is deprecated in favor of lxc-copy.
Created container openr-b as copy of openr00

$ sudo lxc-clone -o openr00 -n openr-c
lxc-clone is deprecated in favor of lxc-copy.
Created container openr-c as copy of openr00

$ sudo lxc-clone -o openr00 -n openr-d
lxc-clone is deprecated in favor of lxc-copy.
Created container openr-d as copy of openr00

$ sudo lxc-clone -o openr00 -n openr-e
lxc-clone is deprecated in favor of lxc-copy.
Created container openr-e as copy of openr00

$ sudo lxc-clone -o openr00 -n openr-f
lxc-clone is deprecated in favor of lxc-copy.
Created container openr-f as copy of openr00

$ sudo lxc-ls -f
NAME    STATE   AUTOSTART GROUPS IPV4       IPV6 
openr-a STOPPED 0         -      -          -    
openr-b STOPPED 0         -      -          -    
openr-c STOPPED 0         -      -          -    
openr-d STOPPED 0         -      -          -    
openr-e STOPPED 0         -      -          -    
openr-f STOPPED 0         -      -          -    
openr00 STOPPED 0         -      -          -

先ほど作ったinterfaceの情報を更新します。

$ sudo vi /var/lib/lxc/openr-a/config
$ sudo vi /var/lib/lxc/openr-b/config
$ sudo vi /var/lib/lxc/openr-c/config
$ sudo vi /var/lib/lxc/openr-d/config
$ sudo vi /var/lib/lxc/openr-e/config
$ sudo vi /var/lib/lxc/openr-f/config

続いて、コンテナを起動

$ sudo lxc-start -n openr-a
$ sudo lxc-start -n openr-b
$ sudo lxc-start -n openr-c
$ sudo lxc-start -n openr-d
$ sudo lxc-start -n openr-e
$ sudo lxc-start -n openr-f
$ sudo lxc-ls -f
NAME    STATE   AUTOSTART GROUPS IPV4                                     IPV6 
openr-a RUNNING 0         -      10.0.3.243, 192.168.111.1, 192.168.221.1, 192.168.224.2 -                        
openr-b RUNNING 0         -      10.0.3.19, 192.168.112.1, 192.168.221.2, 192.168.222.1  -                        
openr-c RUNNING 0         -      10.0.3.98, 192.168.113.1, 192.168.222.2, 192.168.223.1  -                        
openr-d RUNNING 0         -      10.0.3.252, 192.168.114.1, 192.168.224.1, 192.168.225.2 -                        
openr-e RUNNING 0         -      10.0.3.109, 192.168.115.1, 192.168.225.1, 192.168.226.2 -                        
openr-f RUNNING 0         -      10.0.3.57, 192.168.116.1, 192.168.223.2, 192.168.226.1  -                        
openr00 STOPPED 0         -      -                                                       -                        

これで、ノードの設定は完了です。

相互接続

続いて、ブリッジを起動して、それぞれのコンテナが期待通り接続されているか、確認します。

$ sudo ifconfig link1 up
$ sudo ifconfig link2 up
$ sudo ifconfig link3 up
$ sudo ifconfig link4 up
$ sudo ifconfig link5 up
$ sudo ifconfig link6 up
$ sudo lxc-attach -n openr-a
# ping 192.168.221.2
PING 192.168.221.2 (192.168.221.2) 56(84) bytes of data.
64 bytes from 192.168.221.2: icmp_seq=1 ttl=64 time=0.087 ms
64 bytes from 192.168.221.2: icmp_seq=2 ttl=64 time=0.071 ms
# ping 192.168.224.1
PING 192.168.224.1 (192.168.224.1) 56(84) bytes of data.
64 bytes from 192.168.224.1: icmp_seq=1 ttl=64 time=0.073 ms
64 bytes from 192.168.224.1: icmp_seq=2 ttl=64 time=0.054 ms
$ sudo lxc-attach -n openr-b
# ping 192.168.222.2
PING 192.168.222.2 (192.168.222.2) 56(84) bytes of data.
64 bytes from 192.168.222.2: icmp_seq=1 ttl=64 time=0.083 ms
64 bytes from 192.168.222.2: icmp_seq=2 ttl=64 time=0.070 ms
# ping 192.168.221.1
PING 192.168.221.1 (192.168.221.1) 56(84) bytes of data.
64 bytes from 192.168.221.1: icmp_seq=1 ttl=64 time=0.086 ms
64 bytes from 192.168.221.1: icmp_seq=2 ttl=64 time=0.070 ms
$ sudo lxc-attach -n openr-c
# ping 192.168.222.1
PING 192.168.222.1 (192.168.222.1) 56(84) bytes of data.
64 bytes from 192.168.222.1: icmp_seq=1 ttl=64 time=0.075 ms
64 bytes from 192.168.222.1: icmp_seq=2 ttl=64 time=0.063 ms
# ping 192.168.223.2
PING 192.168.223.2 (192.168.223.2) 56(84) bytes of data.
64 bytes from 192.168.223.2: icmp_seq=1 ttl=64 time=0.084 ms
64 bytes from 192.168.223.2: icmp_seq=2 ttl=64 time=0.071 ms
$ sudo lxc-attach -n openr-d
# ping 192.168.224.2
PING 192.168.224.2 (192.168.224.2) 56(84) bytes of data.
64 bytes from 192.168.224.2: icmp_seq=1 ttl=64 time=0.089 ms
64 bytes from 192.168.224.2: icmp_seq=2 ttl=64 time=0.068 ms
# ping 192.168.225.1
PING 192.168.225.1 (192.168.225.1) 56(84) bytes of data.
64 bytes from 192.168.225.1: icmp_seq=1 ttl=64 time=0.080 ms
64 bytes from 192.168.225.1: icmp_seq=2 ttl=64 time=0.066 ms
$ sudo lxc-attach -n openr-e
# ping 192.168.225.2
PING 192.168.225.2 (192.168.225.2) 56(84) bytes of data.
64 bytes from 192.168.225.2: icmp_seq=1 ttl=64 time=0.094 ms
64 bytes from 192.168.225.2: icmp_seq=2 ttl=64 time=0.066 ms
# ping 192.168.226.1
PING 192.168.226.1 (192.168.226.1) 56(84) bytes of data.
64 bytes from 192.168.226.1: icmp_seq=1 ttl=64 time=0.083 ms
64 bytes from 192.168.226.1: icmp_seq=2 ttl=64 time=0.063 ms
$ sudo lxc-attach -n openr-f
# ping 192.168.226.2
PING 192.168.226.2 (192.168.226.2) 56(84) bytes of data.
64 bytes from 192.168.226.2: icmp_seq=1 ttl=64 time=0.079 ms
64 bytes from 192.168.226.2: icmp_seq=2 ttl=64 time=0.063 ms
# ping 192.168.223.1
PING 192.168.223.1 (192.168.223.1) 56(84) bytes of data.
64 bytes from 192.168.223.1: icmp_seq=1 ttl=64 time=0.094 ms
64 bytes from 192.168.223.1: icmp_seq=2 ttl=64 time=0.071 ms

隣接関係の確認ができたので、OKとします。

openrをいじる

2018/2月時点では、まだ、あまり情報がないみたい。
githubの情報がほぼ全ての様子。
あとは、Facebookよろしく、Facebookのコミュニティがあります。Facebook好きなひとは、こちらも、どうぞ。

Qiitaでみると、次の先輩の姿があります。
Facebook Open/Rの概要&インストール方法の紹介
VagrantによるOpen/Rの簡易環境構築

起動

動かす手順をRunbook.mdを参考に、やってみます。

この手順は、Daemonで動かす方法も出ていますが、ここでは、コマンドラインで、起動します。そのため、1ノードあたり、2画面必要になります。

ノードAのコンソール1

root@openr-a:~# openr --ifname_prefix=port --node_name=node-a --enable_netlink_fib_handler=true --enable_v4=true --dryrun=false --domain=openr
openr[393]: Starting OpenR daemon.

ノードAのコンソール2

root@openr-a:~# breeze lm links --all

== Node Overload: NO  ==

Interface    Status    Overloaded    Metric Override    ifIndex    Addresses
-----------  --------  ------------  -----------------  ---------  ------------------------
port1        Up                                         24         192.168.221.1
                                                                   fe80::216:3eff:fe6c:790
port2        Up                                         26         192.168.224.2
                                                                   fe80::216:3eff:fed3:a49b

ノードBのコンソール1

root@openr-b:~# openr --ifname_prefix=port --node_name=node-b --enable_netlink_fib_handler=true --enable_v4=true --dryrun=false --domain=openr
openr[341]: Starting OpenR daemon.

ノードBのコンソール2

root@openr-b:~# breeze lm links --all

== Node Overload: NO  ==

Interface    Status    Overloaded    Metric Override    ifIndex    Addresses
-----------  --------  ------------  -----------------  ---------  ------------------------
port1        Up                                         32         192.168.222.1
                                                                   fe80::216:3eff:feec:5c65
port2        Up                                         34         192.168.221.2
                                                                   fe80::216:3eff:fef0:d60b

設定

確認の前に、各ノードのprefixを広告します。
ここでは、次のネットワークを仮定します。
- node-A(192.168.111.1)の配下に192.168.111.0/24が存在する
- node-B(192.168.112.1)の配下に192.168.112.0/24が存在する
- node-F(192.168.116.6)の配下に192.168.116.0/24が存在する

これを、各ノードのprefixに設定します

openr-a# breeze prefixmgr advertise 192.168.111.0/24
openr-b# breeze prefixmgr advertise 192.168.112.0/24
openr-f# breeze prefixmgr advertise 192.168.116.0/24

この設定を確認します

# breeze kvstore prefixes --nodes=openr-a,openr-b,openr-f

> openr-a's prefixes
Prefix            Type
----------------  --------
192.168.111.0/24  LOOPBACK

> openr-b's prefixes
Prefix            Type
----------------  --------
192.168.112.0/24  LOOPBACK

> openr-f's prefixes
Prefix            Type
----------------  --------
192.168.116.0/24  LOOPBACK

確認

この設定のもと、どのようにルートが割当たっているのか、routesコマンドで、確認できます。

# breeze decision routes --nodes=all

== Routes for openr-f  ==

> 192.168.111.0/24
via 192.168.223.1@port2 metric 9
via 192.168.226.2@port1 metric 6

> 192.168.112.0/24
via 192.168.223.1@port2 metric 6
via 192.168.226.2@port1 metric 9



== Routes for openr-d  ==

> 192.168.111.0/24
via 192.168.224.2@port1 metric 2

> 192.168.112.0/24
via 192.168.224.2@port1 metric 5

> 192.168.116.0/24
via 192.168.225.1@port2 metric 4



== Routes for openr-e  ==

> 192.168.111.0/24
via 192.168.225.2@port1 metric 4

> 192.168.112.0/24
via 192.168.225.2@port1 metric 7
via 192.168.226.1@port2 metric 8

> 192.168.116.0/24
via 192.168.226.1@port2 metric 2



== Routes for openr-b  ==

> 192.168.111.0/24
via 192.168.221.1@port2 metric 3

> 192.168.116.0/24
via 192.168.221.1@port2 metric 9
via 192.168.222.2@port1 metric 6



== Routes for openr-c  ==

> 192.168.111.0/24
via 192.168.222.1@port2 metric 6
via 192.168.223.2@port1 metric 9

> 192.168.112.0/24
via 192.168.222.1@port2 metric 3

> 192.168.116.0/24
via 192.168.223.2@port1 metric 3



== Routes for openr-a  ==

> 192.168.112.0/24
via 192.168.221.2@port1 metric 3

> 192.168.116.0/24
via 192.168.221.2@port1 metric 9
via 192.168.224.1@port2 metric 6

これは、すべてのリンクが上がっている状態です。
試しに、link3を切ってみます。すると、metricが変わって、ルートが変更されたことが分かります。切り替え時間(正しくは障害検出確定期間)は、デフォルトでは30秒のようです。

$ sudo ifconfig link3 down
# breeze decision routes --nodes=all

== Routes for openr-f  ==

> 192.168.111.0/24
via 192.168.226.2@port1 metric 6

> 192.168.112.0/24
via 192.168.226.2@port1 metric 9



== Routes for openr-d  ==

> 192.168.111.0/24
via 192.168.224.2@port1 metric 2

> 192.168.112.0/24
via 192.168.224.2@port1 metric 5

> 192.168.116.0/24
via 192.168.225.1@port2 metric 5



== Routes for openr-e  ==

> 192.168.111.0/24
via 192.168.225.2@port1 metric 4

> 192.168.112.0/24
via 192.168.225.2@port1 metric 7

> 192.168.116.0/24
via 192.168.226.1@port2 metric 3



== Routes for openr-b  ==

> 192.168.111.0/24
via 192.168.221.1@port2 metric 3

> 192.168.116.0/24
via 192.168.221.1@port2 metric 10



== Routes for openr-c  ==

> 192.168.111.0/24
via 192.168.222.1@port2 metric 6

> 192.168.112.0/24
via 192.168.222.1@port2 metric 3

> 192.168.116.0/24
via 192.168.222.1@port2 metric 13



== Routes for openr-a  ==

> 192.168.112.0/24
via 192.168.221.2@port1 metric 3

> 192.168.116.0/24
via 192.168.224.1@port2 metric 7

障害を復旧 (ifconfig link3 up) すると、もとに戻ります。
切り戻りは、即動のようです。

ネットワークとしていじる

せっかくですので、node-A, node-B, node-Fにクライアントをぶら下げてみます。
先の手順同様、lxc-cloneで、母体を作って、展開します。

client1 (Under node-A)
  eth1: 192.168.111.11 (connect to node-A eth1, 192.168.111.1)

client2 (Under node-B)
  eth1: 192.168.112.22 (connect to node-B eth1, 192.168.112.1)

client6 (Under node-F)
  eth1: 192.168.116.66 (connect to node-F eth1, 192.168.116.1)

各eth1間は、先と同様、bridge接続しています。

確認

手始めに、pingしてみます。

root@client1:~# ping -c 3 192.168.112.22
PING 192.168.112.22 (192.168.112.22) 56(84) bytes of data.
64 bytes from 192.168.112.22: icmp_seq=1 ttl=62 time=0.153 ms
64 bytes from 192.168.112.22: icmp_seq=2 ttl=62 time=0.115 ms
64 bytes from 192.168.112.22: icmp_seq=3 ttl=62 time=0.117 ms

--- 192.168.112.22 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.115/0.128/0.153/0.019 ms
root@client1:~# ping -c 3 192.168.116.66
PING 192.168.116.66 (192.168.116.66) 56(84) bytes of data.
64 bytes from 192.168.116.66: icmp_seq=1 ttl=60 time=0.189 ms
64 bytes from 192.168.116.66: icmp_seq=2 ttl=60 time=0.143 ms
64 bytes from 192.168.116.66: icmp_seq=3 ttl=60 time=0.147 ms

--- 192.168.116.66 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.143/0.159/0.189/0.025 ms

client1から、client2とclient6にpingが届いている状態です。
先のroute情報 (breeze decision routes) から、次の事が分かっています。
- client1->client2は、port1を使う (metric 3)
- client1->client6は、port2を使う (metric 6)

試しに、client2にpingを打っている途中で、link1をdownさせてみます。
期待は、port2経由になるので、rttが遅くなることです。

root@client1:~# ping -c 10 192.168.112.22
PING 192.168.112.22 (192.168.112.22) 56(84) bytes of data.
64 bytes from 192.168.112.22: icmp_seq=1 ttl=62 time=0.164 ms
64 bytes from 192.168.112.22: icmp_seq=2 ttl=62 time=0.115 ms
64 bytes from 192.168.112.22: icmp_seq=3 ttl=62 time=0.112 ms
64 bytes from 192.168.112.22: icmp_seq=4 ttl=62 time=0.113 ms
64 bytes from 192.168.112.22: icmp_seq=5 ttl=62 time=0.118 ms
64 bytes from 192.168.112.22: icmp_seq=6 ttl=62 time=0.122 ms
64 bytes from 192.168.112.22: icmp_seq=7 ttl=62 time=0.114 ms
64 bytes from 192.168.112.22: icmp_seq=8 ttl=62 time=0.118 ms
64 bytes from 192.168.112.22: icmp_seq=9 ttl=62 time=0.115 ms
64 bytes from 192.168.112.22: icmp_seq=10 ttl=62 time=0.117 ms

--- 192.168.112.22 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8997ms
rtt min/avg/max/mdev = 0.112/0.120/0.164/0.020 ms

切れる前は、大体0.120msで、応答しておりました。

$ sudo ifconfig link1 down

30秒は切れています

--- 192.168.112.22 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8997ms
rtt min/avg/max/mdev = 0.112/0.120/0.164/0.020 ms
root@client1:~# ping -c 10 192.168.112.22
PING 192.168.112.22 (192.168.112.22) 56(84) bytes of data.
From 192.168.111.1 icmp_seq=9 Destination Host Unreachable
From 192.168.111.1 icmp_seq=10 Destination Host Unreachable

--- 192.168.112.22 ping statistics ---
10 packets transmitted, 0 received, +2 errors, 100% packet loss, time 9071ms

切り替わったところで、再度ping

root@client1:~# ping -c 10 192.168.112.22
PING 192.168.112.22 (192.168.112.22) 56(84) bytes of data.
64 bytes from 192.168.112.22: icmp_seq=1 ttl=58 time=0.249 ms
64 bytes from 192.168.112.22: icmp_seq=2 ttl=58 time=0.186 ms
64 bytes from 192.168.112.22: icmp_seq=3 ttl=58 time=0.190 ms
64 bytes from 192.168.112.22: icmp_seq=4 ttl=58 time=0.192 ms
64 bytes from 192.168.112.22: icmp_seq=5 ttl=58 time=0.205 ms
64 bytes from 192.168.112.22: icmp_seq=6 ttl=58 time=0.206 ms
64 bytes from 192.168.112.22: icmp_seq=7 ttl=58 time=0.206 ms
64 bytes from 192.168.112.22: icmp_seq=8 ttl=58 time=0.186 ms
64 bytes from 192.168.112.22: icmp_seq=9 ttl=58 time=0.198 ms
64 bytes from 192.168.112.22: icmp_seq=10 ttl=58 time=0.199 ms

--- 192.168.112.22 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8997ms
rtt min/avg/max/mdev = 0.186/0.201/0.249/0.024 ms

こちらの箱庭環境では、0.201msになりましたので、先の0.120msに比べて、大回りしていると、推測できます。

$ sudo ifconfig link1 up

元に戻すと、前の値(0.120ms)と似た値(0.123ms)に戻ります

root@client1:~# ping -c 10 192.168.112.22
PING 192.168.112.22 (192.168.112.22) 56(84) bytes of data.
64 bytes from 192.168.112.22: icmp_seq=1 ttl=62 time=0.200 ms
64 bytes from 192.168.112.22: icmp_seq=2 ttl=62 time=0.111 ms
64 bytes from 192.168.112.22: icmp_seq=3 ttl=62 time=0.121 ms
64 bytes from 192.168.112.22: icmp_seq=4 ttl=62 time=0.111 ms
64 bytes from 192.168.112.22: icmp_seq=5 ttl=62 time=0.116 ms
64 bytes from 192.168.112.22: icmp_seq=6 ttl=62 time=0.118 ms
64 bytes from 192.168.112.22: icmp_seq=7 ttl=62 time=0.112 ms
64 bytes from 192.168.112.22: icmp_seq=8 ttl=62 time=0.120 ms
64 bytes from 192.168.112.22: icmp_seq=9 ttl=62 time=0.118 ms
64 bytes from 192.168.112.22: icmp_seq=10 ttl=62 time=0.111 ms

--- 192.168.112.22 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8999ms
rtt min/avg/max/mdev = 0.111/0.123/0.200/0.029 ms

ということで、障害があれば、切り替わることもわかりました。
今回のトライは、ここまでです。

おしまい

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0