0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Robot Framework を使うために、Docker環境を整える

Last updated at Posted at 2019-09-10

#環境を拡張する
Robot Framework 使ってみる①
現在の環境はこんな感じ
VPS001.png
#やること
①検証用に仮想サーバを追加
②172.17.0.xはマネジメントセグにして別の通信試験セグを作成
###仮想サーバ追加
centosのコンテナを2つ作成しただけ。
###セグメント追加
docker network コマンドでネットワークの作成とコンテナへの接続ができるみたい。
Dockerで自由なネットワーク構成を組む を参考にさせていただいた。

docker network
# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
f21796bdf622        bridge              bridge              local
853e2c382475        host                host                local
39a262b4b23b        none                null                local
#
# docker network create -d bridge --subnet=192.168.100.0/24 test_nw1
4ffad7c169cb24f4e38b459c0eb391bc2f770d025e40983261cd702a00e60324
# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
f21796bdf622        bridge              bridge              local
853e2c382475        host                host                local
39a262b4b23b        none                null                local
4ffad7c169cb        test_nw1            bridge              local
#
# docker network connect test_nw1 vyos
# docker network connect test_nw1 vyos2
# docker network connect test_nw1 VM1
# docker network connect test_nw1 VM2
#

できた!

[root@VM1 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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
84: eth0@if85: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:ac:11:00:05 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.17.0.5/16 brd 172.17.255.255 scope global eth0
       valid_lft forever preferred_lft forever
93: eth1@if94: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:c0:a8:64:04 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.168.100.4/24 brd 192.168.100.255 scope global eth1
       valid_lft forever preferred_lft forever
[root@VM1 ~]#

[root@VM2 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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
86: eth0@if87: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:ac:11:00:06 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.17.0.6/16 brd 172.17.255.255 scope global eth0
       valid_lft forever preferred_lft forever
95: eth1@if96: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:c0:a8:64:05 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.168.100.5/24 brd 192.168.100.255 scope global eth1
       valid_lft forever preferred_lft forever
[root@VM2 ~]# ping 192.168.100.4
PING 192.168.100.4 (192.168.100.4) 56(84) bytes of data.
64 bytes from 192.168.100.4: icmp_seq=1 ttl=64 time=0.131 ms
64 bytes from 192.168.100.4: icmp_seq=2 ttl=64 time=0.098 ms
^C
--- 192.168.100.4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.098/0.114/0.131/0.019 ms
[root@VM2 ~]#

疎通もOK。
現在の構成はこんな感じ。
VPS001_02.png

#さらに拡張(2019.09.11)
VPS001_03.png

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?