Docker网络模式与设置Docker自界说网络(bridge模式(4)

查察容器的状态,进入容器查察ip地点

[root@localhost ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 683ad76f7789 centos:7 "/bin/bash" 23 seconds ago Up 22 seconds test2 [root@localhost ~]# docker exec -it 683ad76f7789 /bin/bash [root@683ad76f7789 /]# yum install -y net-tools Loaded plugins: fastestmirror, ovl ... [root@683ad76f7789 /]# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.18.0.10 netmask 255.255.255.0 broadcast 172.18.0.255 ether 02:42:ac:12:00:0a txqueuelen 0 (Ethernet) RX packets 2302 bytes 15050471 (14.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2049 bytes 113777 (111.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 1000 (Local Loopback) RX packets 62 bytes 7019 (6.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 62 bytes 7019 (6.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

此时发明自界说的网络配置容器ip地点乐成了。

四、总结

​ 本文通过对VMware软件中的三种网络模式事情的道理,层层递进深入讲授docker的各类网络模式,而且通过案例团结排障思路具体先容了有关docker网桥模式是如何设置容器ip地点的,有默认模式以及自界说模式。

​最后,需要留意的是呼吁照旧需要多记多敲多练,感谢阅读!

Linux公社的RSS地点https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wsdjzj.html