background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan"

input logo icon
"videoThumbnail 06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan
Table of contents
|

Table of contents

0:00
Основные типы сетей в docker
5:16
Docker bridge network
8:37
Docker host network
9:16
Docker none network
10:09
Docker macvlan
11:44
Docker ipvlan
12:21
Основные команды с докер сетью
16:04
Создание сети в докер
20:00
Запуск контейнеров в сети докер
23:14
Создание сети bridge и запуск контейнеров
25:26
Перемещение контейнеров по сетям
31:31
Тип сети host
33:24
Тип сети none
33:48
Macvlan | ipvlan
Video tags
|

Video tags

docker уроки
docker на русском
docker
devops
docker devops
докер
докер уроки
docker tutorial
docker основы
уроки devops
урок docker
docker обзор
докер обзор
docker курс
докер курс
linux
linux уроки
docker linux
docker windows
docker run
docker pull
создание docker
основы docker
основы докер
docker network
докер сеть
сети в докер
network
docker bridge
docker host
docker none
docker macvlan
docker ipvlan
macvlan
настройка сети в докер
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:02
and we continue now we will look at
00:00:04
one of the most interesting and complex topics
00:00:07
that relate to Docker it will be doca
00:00:10
Network networks in Docker
00:00:13
I thought that this would be a small short
00:00:15
topic but no it turned out to be quite
00:00:18
extensive and interesting in this video there
00:00:22
will not be many slides but there will be a lot
00:00:23
Arrows and rectangles and let's get
00:00:26
started We have a server on which
00:00:29
Docker is running, some kind of Linux is running there
00:00:33
and we have We launched Toker and we
00:00:36
immediately get a new interface I
00:00:38
think you all Znamen when we launched
00:00:40
Docker we get Doc 0 interface
00:00:43
when creating Docker at startup we
00:00:46
get several
00:00:49
types of networks by default, which
00:00:52
Docker already provides to us. This is the
00:00:55
Bridge Host network type
00:00:57
and Non the
00:01:00
Bridge network type - This is the default network type
00:01:04
when running containers in the
00:01:07
usual way, Dr. Ran and in the name of
00:01:09
the image it falls into the Bridge network this
00:01:14
default network It often has a
00:01:16
default network of 182 1700 slash 16
00:01:21
this is worth remembering Because constantly
00:01:24
When you run Docker for a test or
00:01:27
something else, the containers all end up in
00:01:29
this network of the Bridge network, the
00:01:32
container that is located in this network
00:01:34
they have immediate access to the outside that is,
00:01:38
they can be accessed from other servers,
00:01:39
they can connect to the Internet,
00:01:42
there is access, we
00:01:44
can also connect locally with a container, and in order for us to
00:01:48
connect from outside the container, we need to
00:01:51
make a so-called bridge Bridge, that
00:01:54
’s why it’s called Bridge. It
00:01:56
connects the container itself the IP address of the
00:01:58
container with the IP address of the server. In order for
00:02:02
us to connect to a container that
00:02:04
operates on the Bridge network, we need to create
00:02:06
a bridge and this bridge is created using the
00:02:08
minus pi parameter, that is, the mapping port
00:02:11
that we studied before. And what
00:02:13
happens is that we connect
00:02:16
port 80 of the Host to port 80 of the container. But
00:02:21
this is the case. we launch if
00:02:23
another program is launched that
00:02:24
has a graphical shell or something
00:02:26
else, then the desks can change Well, the point is not
00:02:30
that. The point is that we have a terrible so-
00:02:33
called bridge Bridge
00:02:36
and thus we can connect
00:02:38
specifically to our container If we
00:02:41
want to launch the container in the pile in the
00:02:45
Host network, then we need to specify the
00:02:47
Network parameter and Specify the Host network type, then when
00:02:53
containers are created here, they receive the
00:02:56
IP address of the Host. Yes, they differ in
00:03:00
ports and so on, but nevertheless they do not
00:03:02
receive the IP address of the Host.
00:03:05
These containers can also connect to the
00:03:07
outside. externally to the Internet
00:03:10
download something else transfer some
00:03:12
data we can connect to them locally
00:03:15
and in order for us to connect to the container,
00:03:18
let’s
00:03:20
just indicate the IP addresses of the Host itself and
00:03:23
indicate the port or the port is not specified if we are
00:03:26
using a browser, then the browser defaults to
00:03:27
80 or 43 Yes, but if we need some kind of
00:03:31
container with a different port, then we should
00:03:33
specify the IP address of the server itself.
00:03:36
Well, in this way And the next one is if we
00:03:39
want to create containers in some networks, but then
00:03:41
we need to respectively specify the
00:03:43
minus Minus Network parameter and the network type,
00:03:46
but in this case we will not be able
00:03:49
to connect to the container from outside, that is,
00:03:52
well, there is no access, it does not have an IP address, we
00:03:56
will not be able to connect to the container
00:03:57
locally because it also does not have its
00:04:00
own IP address, but we can go to the
00:04:02
container and
00:04:03
connect directly
00:04:06
to the container itself not via IP it’s okay to look at an address not
00:04:09
through a port,
00:04:11
but we can look at Loki and
00:04:14
run some programs, you can be
00:04:16
in the container itself, these are the three main types of
00:04:18
networks that are created automatically with Docker,
00:04:21
that is, not immediately,
00:04:23
we will see this in practice, but it probably
00:04:25
was it would be quite simple if there were
00:04:27
only three types, so let's
00:04:30
add the
00:04:31
next type of network this is Meg Vilan and ipv
00:04:36
led these two types we will look at a little
00:04:38
later I will omit them for now from another there
00:04:42
is the orelay type it is from emptiness when the current
00:04:47
starts in the cluster like
00:04:49
let’s say a cluster is used only by your own,
00:04:52
I won’t consider this type of network
00:04:54
since we won’t consider only
00:04:56
your own and as if this is a little a thing of the
00:04:59
past, but nevertheless it’s worth knowing if
00:05:02
someone wants to very simply use
00:05:03
a cluster only in a cluster, then of course yes
00:05:07
only with you it forgives him many times,
00:05:09
but still, let's look at these three
00:05:11
types of networks Breach host
00:05:14
So let's move on to Bridge, what's
00:05:18
going on here, we have a server where the
00:05:20
toker works and we have, as I
00:05:23
said, by default
00:05:25
one Bridge
00:05:27
default network network by by default, if we
00:05:30
launch containers, as I already said in
00:05:31
the usual way, doca Run and the name of
00:05:34
the image, we create a container, then it ends up
00:05:37
in this network; by default, we create
00:05:40
one container, the second container 10, as I
00:05:43
said, these containers can go
00:05:45
outside, you can connect to them, and so
00:05:47
on create
00:05:49
bridges are like this. In addition, these
00:05:52
containers can communicate with each other.
00:05:54
They receive IP addresses of some kind.
00:05:57
Random IP addresses in this network, they
00:05:59
can communicate exactly by IP addresses with
00:06:01
each other, but they cannot communicate with each
00:06:03
other using their names. That is, it’s
00:06:06
like domain names that they receive they, when
00:06:08
creating a container, our server
00:06:10
can also turn out to be this container and
00:06:12
it’s no big deal, but what should we do
00:06:14
when we kill the container after we create it?
00:06:17
They get some random
00:06:20
IP addresses again, we can get it, it
00:06:22
would be convenient for us to use the domain
00:06:24
names we need create a new network,
00:06:26
let's say we create a network type Bridge This is me
00:06:30
in the following way before connetwork
00:06:31
Create we create a new network, specify
00:06:34
Drive Bridge and indicate the name that we
00:06:37
want to give to our network, if we do not
00:06:40
specify this Drive parameter, then this one
00:06:43
is created automatically as a Bridge type, that
00:06:46
is, this thing can be immediately omit the
00:06:50
network to create a type Bridge Well, let's say
00:06:53
we want to create a name mayonelle We have created a
00:06:56
new network and want to launch a container
00:06:58
to launch the container in this
00:07:00
network not just before the Koran and they will launch
00:07:03
in the default network, namely in our new
00:07:05
network we need to specify the parameter minus
00:07:07
Minus no or minus Minus and specify My
00:07:11
net1 and indicate the name of the image that
00:07:14
we want to run, let’s say it remains
00:07:16
with engineering,
00:07:17
we launched two containers, then in this
00:07:20
network these containers can already
00:07:23
communicate with each other, let’s say this
00:07:25
container of the
00:07:26
Engine X application and the second database, let’s say like
00:07:29
this how a container on this network receives
00:07:31
its IP addresses there 172 17 and so on
00:07:36
they can communicate by addresses and
00:07:40
they can also communicate by DNS names these are the
00:07:43
names that we specify, let’s say in the
00:07:44
minus parameter Minus name and the name of
00:07:47
the container or if we don’t do this
00:07:50
then the docker assigns a name to the
00:07:52
container, that is, we can use
00:07:55
this name to connect to containers and we
00:07:58
can also connect to these
00:07:59
containers locally,
00:08:01
but we can communicate between them, but there are two
00:08:06
networks, the default Network and Our network. They
00:08:09
cannot communicate with each other. Well,
00:08:11
let's let's see if we create
00:08:12
another network, also our default one, call
00:08:15
it mayonnaise 2, create two containers there,
00:08:19
then in this case we will also unfortunately
00:08:22
be able to connect two networks minet one and
00:08:25
mayonnaise 2. This is good because we can
00:08:28
isolate two applications completely and
00:08:31
add some kind of security With this
00:08:33
container we can also locally
00:08:37
to the next network host network it is created and the
00:08:41
Host driver is also indicated on and
00:08:45
the name of the network and what happens here
00:08:46
if we created this network We have a
00:08:50
server with docker we will create two
00:08:52
containers then these containers can
00:08:54
communicate with each other and also gray you can
00:08:56
connect to them directly and
00:08:59
also these containers that are
00:09:00
created here. They receive their own IP addresses,
00:09:02
they use the IP address of the
00:09:04
Host itself, so the host network is called
00:09:07
this. We want to connect to one of the
00:09:10
containers. From the outside, we need to indicate
00:09:13
exactly the IP address of our server
00:09:16
And the next type of network is But this is
00:09:19
quite the simplest Type which, in
00:09:22
principle, is rarely used, it is
00:09:24
created using Drive Now what
00:09:27
is happening is we have a shooting gallery with Docker from
00:09:30
one hundred and two containers, as the pictures
00:09:32
can already understand that these containers are
00:09:34
isolated by themselves Yes we cannot
00:09:37
directly connect to them, that
00:09:39
is, to IP addresses to ports, but we
00:09:42
can run some local commands on them,
00:09:43
and so on.
00:09:45
I think this is more or less clear with a
00:09:48
container, these are the three main types that are
00:09:51
mainly used. Well, probably in 95
00:09:54
cases using the Bridge type, sometimes the
00:09:57
host type is used. Well,
00:10:00
there are also two types that are very
00:10:02
interesting from the network side:
00:10:05
Mag Vilan and ipvr and Let's imagine
00:10:10
We have a Doc server host and like all
00:10:14
servers We have an IP address we have a
00:10:16
network card 0 C such an IP address, if
00:10:21
we are already talking about
00:10:23
IP Van, then it comes to mind that this is something on the
00:10:28
network that is connected specifically with villans; when we
00:10:31
talk about the network, then it is worth displaying the
00:10:33
network equipment, I will display it here
00:10:36
Switch. So it works on Switch with
00:10:39
pitchforks and it is clear that through Switch
00:10:43
is connecting to our server and
00:10:46
let's launch two containers
00:10:47
on the mackvielan network.
00:10:50
What happens in these containers? They
00:10:53
receive their network cards and also
00:10:57
their IP addresses, respectively. So we
00:11:00
can directly connect
00:11:02
immediately by IP address without specifying
00:11:05
ports. Well, or specify ports if
00:11:07
necessary, but nevertheless you can
00:11:09
directly connect to
00:11:11
the containers directly, but when
00:11:14
creating network containers, the
00:11:17
following happens: the server has the power of a
00:11:21
card, a network card has its own
00:11:24
mac address, let’s say the
00:11:27
server has such and
00:11:29
such containers on this network They get
00:11:32
their mac -addresses, which makes it much easier
00:11:35
to route them to the candle; he already knows
00:11:37
directly where it is, what
00:11:39
address is located, and so on, and goes by
00:11:42
connecting directly to the
00:11:44
containers. What happens with the apivion network type,
00:11:47
we also have a server with an IP
00:11:50
address, and the containers in this network
00:11:52
receive their ip- addresses, but the Mag address
00:11:57
remains unchanged, that is, the
00:11:59
containers receive and the container’s network cards
00:12:02
receive the same mac addresses as
00:12:05
our server, so the connection
00:12:08
happens in the
00:12:09
same usual way. This is how we
00:12:12
analyzed all the network types that are
00:12:13
used in Docker and Let’s move on let's
00:12:15
see in practice how it all
00:12:16
works, let's create a couple of networks and what the
00:12:19
container will do, go to the
00:12:21
server, exactly the server. Where the
00:12:24
doctor works. Let's look at the server.
00:12:26
What network interfaces do we have? We write
00:12:29
and see that we have an interface and ns-18
00:12:34
is a virtual network card machines
00:12:36
and with a local IP address and also a
00:12:39
Docker network card as a virtual
00:12:41
card And we also have an API address in Docker
00:12:45
and a network mask is indicated. Okay,
00:12:49
let's see. We have types of networks
00:12:51
in Docker, we write
00:12:56
Network and a
00:12:58
sheet and we see we have three type of
00:13:01
networks this is Bridge Host and but it’s clear These are
00:13:06
standard all the things that are created
00:13:08
when installing Docker let’s create our
00:13:11
own network So we write dock
00:13:16
steel we want to create a network so
00:13:18
Network we write further circles how we
00:13:21
want to do it And Let’s write May
00:13:24
no 01 let’s say Okay let’s see
00:13:29
that we have the
00:13:32
Network dock with and we have our new network
00:13:37
with the Bridge driver, as I
00:13:39
said that the network If you create a network without
00:13:42
any parameters without specifying
00:13:44
the driver, it appears immediately
00:13:46
automatically in the Bridge driver. What
00:13:49
will happen if we create it with the Host driver?
00:13:52
Let's try dock
00:13:55
Network Creed minus Minus
00:14:00
or you can just specify minus Din
00:14:03
then we specify the driver Host and Let's
00:14:07
call it give the name
00:14:10
may no tail and see now what
00:14:16
happens. We cannot create
00:14:19
more than one host type network because
00:14:22
all the containers that are created on the
00:14:24
server in this network are are created
00:14:27
as if you Install the program on the
00:14:30
server itself, that is, this container will
00:14:32
use this interface, that’s why there is
00:14:35
only one possible okay
00:14:38
Let’s move on Now let’s create a
00:14:41
driver
00:14:43
zero, that is, not zero A 0, that is, emptiness
00:14:48
minus Din
00:14:53
and mayonnaise
00:14:56
That’s how we We see that we also cannot
00:15:00
create more than one network of type 0
00:15:03
because all the containers in this network they also do
00:15:05
n’t descend anything, don’t let his card in. They don’t
00:15:08
use it, that is, we are just containers
00:15:10
and are not created without anything empty well.
00:15:13
We created some kind of network. It’s like -it
00:15:16
works well, let’s take a little
00:15:18
look at the server and we have
00:15:20
some kind of network, we don’t know anything, what should we do,
00:15:22
how can we find out the information of
00:15:24
this, we just write
00:15:30
and indicate either the network name or Network
00:15:33
ID, press
00:15:35
Enter and we see here, as it were setting up the
00:15:37
network itself,
00:15:39
how it will be configured 172 19 slash 16
00:15:43
Well, and a little more information about the network
00:15:46
itself, in this way we can
00:15:48
find out whether containers are running or not. What
00:15:51
networks are configured here with what parameters
00:15:54
this is such a little information then
00:15:58
let's start creating
00:16:01
containers and try work somehow,
00:16:03
but before that, let's create
00:16:06
some kind of non-default network, that is, we
00:16:10
created a simple We created a network that is of the
00:16:12
Bridge type, but we want to indicate which
00:16:15
IP address we want to use,
00:16:16
how can this be done? Well, let's
00:16:19
do it, write only how usually Create
00:16:23
we create next we indicate the driver type
00:16:27
Bridge or we can specify nothing,
00:16:28
let’s indicate for Nastya’s leg
00:16:32
further we indicate here
00:16:35
as here in principle subnet here
00:16:37
we had 112 19 but we want to let’s say something
00:16:41
else altogether Let’s take 192 168
00:16:45
Well, I don’t know Let’s let's take
00:16:49
10.0 slash 24 that is, we will take a much
00:16:54
smaller network, then we indicate that is
00:16:59
where our packets will go and
00:17:01
let's say 2,168,101 as if according to the standard and
00:17:06
give the name
00:17:08
May no 192 that's how the name of our
00:17:13
moment is excellent network left, we can
00:17:15
already indicate what we want to
00:17:18
create it perfectly, in general it’s very
00:17:19
convenient to write just
00:17:25
and Let’s analyze it,
00:17:28
Network
00:17:31
inspect and the name of the network and here’s Our network
00:17:36
that is. So we create our
00:17:38
own networks well Let’s say we created a
00:17:40
very large number of these networks,
00:17:43
created containers and so on and we see
00:17:46
that we don’t need these networks at all,
00:17:48
absolutely these local
00:17:50
small networks like us
00:17:53
can just delete them. To do this, you just need to
00:17:57
continue to indicate the name of the network, or there’s also
00:18:03
one of them, they’re all deleted, we do
00:18:07
n’t have that anymore. Everything’s fine. Let’s
00:18:10
now move on to everything. Let's go to
00:18:13
analysis How can we make containers so that
00:18:16
they all work correctly
00:18:17
So for this, let's basically use
00:18:21
specific containers so that we can
00:18:23
analyze
00:18:24
Why we can't take a regular container,
00:18:27
let's say riot or engineering or
00:18:29
some other because the basis of
00:18:31
docker containers is to
00:18:34
have the smallest possible container As
00:18:36
small an image as possible. That is, it already works
00:18:38
with only one program for
00:18:41
which it is intended, and therefore let’s
00:18:42
take a container that is
00:18:44
intended for analyzing networks, that is, it
00:18:47
already has all the utilities that make
00:18:49
this possible and we’ll come to the docks.
00:18:52
I found two containers in which there
00:18:56
are already all the utilities for
00:18:58
network analysis provided, this is not the one
00:19:02
and the second one is netshot Well, let's
00:19:05
use netfood since there's no way here the
00:19:08
most downloads are 50 plus
00:19:10
million And this one has containers 100 thousand
00:19:13
plus Well, both of them are good and
00:19:16
either of them will be enough for us Let's take
00:19:18
letshot and if we look from below how it doesn't
00:19:22
start, then with these commands
00:19:24
we can launch our containers,
00:19:27
so if we do Just Run and
00:19:33
our container now
00:19:36
[music]
00:19:40
and insert our container, let's launch our
00:19:42
container As long as we
00:19:44
can do nothing interesting under it to work it wo
00:19:46
n’t because no program is running in it
00:19:48
Let’s look at it, check it,
00:19:49
nothing works, that is, it will
00:19:52
remain immediately it started and stopped,
00:19:54
we don’t need it Let’s delete it
00:19:59
well and Let’s now
00:20:01
launch it correctly So let’s write
00:20:04
Doc
00:20:06
further We want delete it during installation,
00:20:10
then we have to launch it in introke
00:20:12
Mode so that we can immediately enter it and we can
00:20:15
work in it. Next, we’ll indicate its name
00:20:19
so as not to get confused, let’s say container One.
00:20:24
Well, now we indicate our container, that
00:20:29
is, ours that we
00:20:31
want to launch, and we’ll connect, it
00:20:35
will be
00:20:37
like this
00:20:40
you have to be careful
00:20:43
the video recording was interrupted so let's
00:20:45
look at the container that has already been launched. So we
00:20:47
have launched a container that is used to
00:20:50
analyze our network. We run the
00:20:53
IP command, then we will look at the Petris TIAs that
00:20:56
are already in the container and we see We
00:20:58
have an IP address of 152 1702 You can also
00:21:02
try to make Pink, let's say
00:21:04
google.com and we see that Ping
00:21:07
also works fine for us, but to analyze the
00:21:10
network between containers it would be good for us
00:21:14
to use the second container, so
00:21:16
let's now spread out the screen so that
00:21:18
we can immediately see both containers,
00:21:21
it will be convenient and Let's launch
00:21:23
the second the container will use the
00:21:24
same command as before,
00:21:26
let's copy
00:21:29
paste it and give it a little change that
00:21:32
will be the name container number two
00:21:36
so we launch the second container let's see
00:21:38
what address we have at the end we have
00:21:41
a three here we have a two and Let's
00:21:43
see if we can do this with one
00:21:45
server to the second Let's try
00:21:47
here, write here
00:21:52
and indicate the IP address of our server,
00:21:55
excellent Pink works for us and
00:21:59
DNS can work, that is, Can we
00:22:01
do a Ping not by the IP address, but
00:22:04
connect directly to the
00:22:06
container itself, do a Ping by its name for at
00:22:09
least the container it's called container
00:22:11
2 Let's see we do
00:22:16
No unfortunately we can't do this
00:22:19
at home we can connect between
00:22:21
containers using their addresses that's great
00:22:24
Okay let's also analyze what
00:22:28
network they are on That is, if
00:22:30
you don't know what network a
00:22:31
certain container is on Let's from
00:22:33
one we will go out and see which
00:22:35
containers are working for us. We have one
00:22:38
container, but as we can see, the
00:22:39
IP address is not indicated here anywhere. How should we proceed in
00:22:42
this case? We write to the
00:22:48
inspect dock and already indicate the name of the container
00:22:51
or ID, well, basically the container is good.
00:22:56
We went to the very end. container and Let's
00:22:58
immediately see here that we have the IP address of the
00:23:01
container, its Gateway, and so on. That
00:23:04
is, So we can analyze what
00:23:06
network this or that
00:23:08
container is located on. Well,
00:23:10
we have now found out that DNS binding does not work for us.
00:23:12
What should we do in this case?
00:23:15
we can create our own
00:23:17
network and then add containers there,
00:23:20
or it’s even easier to create a
00:23:24
network initially and then launch containers
00:23:26
in the desired network, let’s make a
00:23:29
dock network
00:23:36
only Network
00:23:40
quid and Let’s call My net 01 well
00:23:45
she created a network you can check there
00:23:48
is no dock lesson with her created the My Network network and
00:23:51
the driver be and Let's launch the same
00:23:54
containers only in this network
00:23:57
Let's
00:23:59
take our container name container
00:24:02
we had one container then indicate minus
00:24:04
no and then indicate
00:24:09
the name of the network where we want to run it all
00:24:12
launch
00:24:14
minus Minus no
00:24:18
excellent with the container is working, let's see here
00:24:21
we no longer have 17 here, but already
00:24:25
20 with 16 and here we will do the same thing,
00:24:28
only container 2, let's call
00:24:35
this one container 2
00:24:40
ready, let's see the action, the address is all there,
00:24:44
we are on the same network, let's try to
00:24:46
do a Ping,
00:24:52
it works, it will also be here the
00:24:56
same thing works,
00:25:02
everything is there and now Can we do a
00:25:04
Ping named
00:25:09
Ping and container 2 and it all works for us too, it’s
00:25:12
so easy to connect
00:25:15
containers that you don’t need to indicate what
00:25:17
IP address now there is a container, you
00:25:19
just launch it without anything
00:25:21
think and everything can be connected to it by name,
00:25:23
everything is fine, it
00:25:26
works great, what if we launched
00:25:29
containers, they are already working, we don’t want to
00:25:31
kill them there somehow, interrupt them, and so
00:25:35
on, how to move them to another
00:25:38
network, well, let’s try to do it
00:25:40
Let’s kill it container and Let's
00:25:43
launch it without specifying any
00:25:46
network, let
00:25:52
's look at the IP address, we have an IP address and
00:25:56
again 172 17 check that we can't
00:26:00
connect to it before you don't have
00:26:03
access to it, but we want to move this container
00:26:05
to the same network Where is it located
00:26:08
this container, what should we do? Let's say
00:26:10
we have a web server, this is a database.
00:26:13
Let's try to do it. We need to
00:26:15
kill now there will be one container.
00:26:17
Well, let's say it will continue to work.
00:26:19
We will remove
00:26:22
the container.
00:26:26
our container
00:26:30
2, which we launched from above, so
00:26:33
then we write only
00:26:35
Network
00:26:37
Connect, that is, we want to connect to
00:26:39
our network, which
00:26:42
we indicated
00:26:45
mayonnaise 01, which was created
00:26:50
and we want to connect container 2, we’ll
00:26:55
see everything.
00:26:57
Doc,
00:26:59
our container also works, let’s
00:27:01
see the IP here as before addresses
00:27:06
and we see what we find now in two
00:27:08
networks
00:27:09
if It’s also not bad, but from old age We
00:27:13
want to disconnect Let’s see if
00:27:15
we do a dock
00:27:18
inspect of our container, then we
00:27:21
will see
00:27:23
Network ID here, this is the new network that we
00:27:26
are located here 172 20 and our old one will be on top
00:27:31
network, that is, we can
00:27:32
use this Network ID
00:27:35
to disconnect from the network. And
00:27:37
here above we see that we have the Bridge type. That
00:27:40
is, we have two networks. Here is the first network of the Bridge type
00:27:43
and here is the second network of the type closer, but its
00:27:46
name is mayonnaise 01 Well, we
00:27:49
will connect from this network,
00:27:51
we need Network ID for this and write
00:27:55
Let’s access again and
00:27:59
only Network
00:28:03
isConnect
00:28:06
we want to disconnect from what we want to
00:28:10
disconnect from, the type of network, or rather IT, in our
00:28:13
case will be Let’s remove
00:28:17
this and the name of the container
00:28:21
is fine, no errors Already Well, let
00:28:24
's see what IP addresses we now
00:28:26
have left and we only have one IP
00:28:29
address. This is how we can move
00:28:31
containers from one network to another and at the
00:28:34
same time they continue to work. Maybe
00:28:36
in one container we can get to
00:28:38
many networks, very many, this is very
00:28:41
it’s convenient when let’s say we have a
00:28:43
proxy server running and we also have many
00:28:46
networks, there are many small containers there, there are
00:28:50
web servers that are located behind the proxy
00:28:53
and we just get a proxy to each of
00:28:56
each network. Where a small
00:28:58
container works, this greatly increases
00:29:01
security; the containers themselves
00:29:03
cannot talk to each other Naturally, they
00:29:05
cannot go through a proxy, however,
00:29:07
they can work directly with each other.
00:29:09
This is much better than they
00:29:12
were just on the same network. I think it
00:29:14
will be clear. Let’s look at
00:29:16
the diagram that we saw. We have it, we
00:29:20
looked at it from and containers in
00:29:22
City by default where we could do
00:29:25
Ping but we didn’t have DNS DNS didn’t
00:29:29
work for us Here we also Created our one
00:29:31
network and let’s now create another
00:29:34
network and see if we can
00:29:35
run all this between ourselves I
00:29:39
think you then what are we doing? we won’t
00:29:41
be able to do it, but we’ll try to give it shadows
00:29:44
Let’s find it again
00:29:48
and make mayonnaise 2, that is, we won’t initially knock down a
00:29:52
certain network, we just
00:29:54
indicate in the command when starting the
00:29:57
container which network we want to place
00:29:58
Our new container will docker create a
00:30:02
new network for us no, alas, that’s not the case it works,
00:30:06
we got an error. Therefore, we will create a
00:30:11
Network Create dock
00:30:15
and create a second network, everything on the network
00:30:18
was created by current Network, let's see
00:30:22
Kinoshiti, we have mayonnaise 01 May
00:30:25
No 02 and also like Bridge Okay, now
00:30:29
Let's take
00:30:32
our command again
00:30:35
and run it,
00:30:38
let's see the IP address we have The IP address is a
00:30:42
completely different container,
00:30:44
so we won’t be able
00:30:46
to do Ping in any way. Well, let’s see if
00:30:49
the routing works Pink
00:30:52
No, it doesn’t work. This proves that it’s
00:30:56
worth running each application
00:30:59
in a separate network for it so that all
00:31:01
applications, all containers work
00:31:03
separately from each other, this is quite- it’s still
00:31:05
important Well, let’s
00:31:08
just launch containers on
00:31:10
different networks now, we now have a host type and a
00:31:15
none type, that is, without a network, let’s see what
00:31:18
happens, we
00:31:20
exit from these containers, they are deleted
00:31:23
immediately Let’s look at the network,
00:31:28
there is no Doc PC and launch the Host type Let’s
00:31:35
use ours with the previous command
00:31:37
minus Minus there is no
00:31:40
host type
00:31:43
Okay, let's see what we have
00:31:47
and I'll now show you what it is. Well,
00:31:50
now we see a lot of
00:31:52
interfaces, we also see the interface of
00:31:53
our Host,
00:31:55
we are now on the Host itself.
00:31:57
Let's see what interfaces
00:31:59
are there and how do we see that we have the same
00:32:02
thing if in a container everything the
00:32:05
same we have exists in containers, but we
00:32:08
also show the network that
00:32:10
we created our
00:32:12
custom networks 102 172 20 where the
00:32:16
containers were created
00:32:18
here 17 by default here No 02 ours,
00:32:23
which we created and we also see in
00:32:26
this container that we launched the
00:32:28
network card of the Host itself.
00:32:30
Let's launch 2 more containers,
00:32:35
also on the host network,
00:32:43
as it were, and Let's see what Pink
00:32:47
we can do because the
00:32:48
container does not have its own IP address. It
00:32:50
works for the hostel, that is, we will
00:32:52
ping Can we make
00:32:55
Pink exactly the name of the container, here is our
00:32:59
name, container 2,
00:33:02
alas, this also does not work well in
00:33:06
principle Hosts, I think it’s clear, this is how
00:33:08
to run it, you just install
00:33:10
the program on the host itself, this principle is great, it
00:33:13
also works, so let’s do it let's kill them and
00:33:16
Let's launch a container
00:33:19
type network Let's look
00:33:21
only at
00:33:24
networks type And
00:33:29
we're here now and we'll
00:33:33
check the IP addresses and we only have
00:33:36
a curl of the tail I won't launch the second container
00:33:38
because it's clear that they wo
00:33:40
n't be able to communicate with each other in any way. This is it
00:33:43
three main types of networks that
00:33:46
are in Docker but also We remember that
00:33:50
there are two more types of networks that are sometimes
00:33:53
used especially if we want
00:33:55
to work as a network We have some
00:33:57
network applications Firewall them with a proxy then
00:34:00
these will be our networks by name
00:34:04
and
00:34:05
Let's do something let's do something similar with this
00:34:09
So let's create a Mac villan network first
00:34:14
So we write the same thing only
00:34:18
Network Create then we indicate the driver
00:34:22
that we want to do This is Mac Von
00:34:25
as well as the bridges everything else further
00:34:29
We want to indicate the subnet
00:34:32
Let's be 192 168
00:34:35
Well let's be
00:34:39
100 and here Let's indicate the subnet 0 from 24
00:34:46
the most standard I won't
00:34:48
think about anything we indicate
00:34:52
192 168 100.1
00:34:57
then when creating a network of this network, a
00:35:02
10p server is created, that is, when
00:35:06
Docker launches a docker container, we
00:35:09
immediately distribute some kind of
00:35:13
IP from the container the address is from this network
00:35:16
But we don’t want to, we want to specifically
00:35:18
indicate
00:35:20
which IP address will be given to one
00:35:23
container. Let’s say we want to
00:35:25
run the Firewall in the container and we
00:35:28
want it to always be assigned one
00:35:31
IP address; for this it is worth specifying
00:35:34
minus Minus IP
00:35:38
Range That is, this it’s not necessary to do this.
00:35:40
I’m doing this only to show
00:35:43
the possibilities of this, that we can
00:35:46
set what Range can be given by
00:35:50
our container, it will be 192 168 100
00:35:55
and Well, let’s 99,
00:36:01
then we should specify the option
00:36:06
with what the paired mother
00:36:09
network card will be
00:36:11
and Let’s look at network cards
00:36:13
are on the server What are the names and here is
00:36:16
the card itself Ines 18 That is, we
00:36:20
will have Point int 18
00:36:22
and then we write the name of our Steam,
00:36:25
let's call it May
00:36:28
Mag
00:36:32
here, you just need to indicate a
00:36:36
slash 32 What is just
00:36:40
this IP address
00:36:43
Everything has been created for us Let's
00:36:46
see now we can launch the iPad, you
00:36:48
see, nothing has changed here,
00:36:51
so let's look at the Doc Network LS
00:36:56
and now we have our new card,
00:36:59
great. Let's launch a container
00:37:01
that will use this network.
00:37:06
So we have our container and it will
00:37:10
launch
00:37:12
[music]
00:37:13
our news
00:37:15
Okay, let's look at the IP addresses What do
00:37:19
you think the answer will be, this is exactly
00:37:22
the network that we launched here, we
00:37:26
can distribute networks exactly as we want,
00:37:28
anywhere, I just set some kind of
00:37:31
network, that is, let's say it's
00:37:33
home, but Let's still do it
00:37:35
Practical using this
00:37:38
network, if I look at the sapi address, then
00:37:42
north is in the network 10 10 194 Well,
00:37:47
I know that I have 193 free IP address
00:37:51
for sure. Let's create a second network
00:37:54
in this range
00:37:57
like this. Let's slightly change our
00:38:00
command that we had subnet
00:38:04
will be 10
00:38:06
10
00:38:09
next Gateway We will also indicate 10 10 1 IP
00:38:16
Range which will be assigned 10 10
00:38:22
and indicate the IP address 193
00:38:30
we can’t run the second Mac vilan
00:38:33
Let’s delete the previous one
00:38:36
only Network
00:38:44
it
00:38:47
needs to kill the container You see how many
00:38:49
errors How many problems we solve all at once
00:38:53
ok and now let’s start again
00:38:56
Everything worked great finally
00:38:59
[music]
00:39:00
dokas Well, in principle, it’s good that we can
00:39:03
immediately see problems that can
00:39:04
come across
00:39:08
like this and now we’ll launch our container on
00:39:12
our network,
00:39:16
launch
00:39:19
iPad here 193
00:39:23
and Let’s do another thing like that,
00:39:25
run powershell and do Ping 10 10
00:39:31
193, everything works for us If we do 4
00:39:36
also everything will work like this,
00:39:39
it’s all easy to set up well, we have
00:39:43
now given a network and they indicated to me that a
00:39:46
container is launched on our network
00:39:49
with exactly one IP address, that is, we
00:39:51
will not be able to second address The second container
00:39:54
that should automatically receive
00:39:56
Let's try to do something like this
00:39:58
if we specify the IP address
00:40:02
so here is our command and Let's now
00:40:06
indicate here another
00:40:08
minus Minus IP
00:40:11
and we indicated that 10 10
00:40:14
Well, let's 213
00:40:19
launch our container in our
00:40:22
mackvieon network networks,
00:40:26
we look at everything, everything works
00:40:29
fine for us, that is, in this way we can
00:40:31
distribute IP addresses and launch
00:40:33
containers with a specific IP address. That
00:40:35
is, we currently have Our
00:40:38
network,
00:40:39
let’s check it all
00:40:43
just Network LS We have a network my
00:40:48
home LAN like a Mac villan and in this network
00:40:54
We have a DHCP server that
00:40:58
distributes only one IP address if we do not
00:41:02
specify a specific IP address for the container.
00:41:04
But we are also on this network as long as there are other
00:41:06
containers that will use the
00:41:07
IP addresses we have specified, so in
00:41:11
principle this is everything works
00:41:13
Let’s not a simple topic, try
00:41:14
setting up how the container works,
00:41:16
it will be very interesting, we will
00:41:18
only consider compost, it will be
00:41:21
more or less I think it’s clear
00:41:24
and logically it’s all done.
00:41:27
Thank you, we continue

Description:

06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan 00:00 | Основные типы сетей в docker 05:16 | Docker bridge network 08:37 | Docker host network 09:16 | Docker none network 10:09 | Docker macvlan 11:44 | Docker ipvlan 12:21 | Основные команды с докер сетью 16:04 | Создание сети в докер 20:00 | Запуск контейнеров в сети докер 23:14 | Создание сети bridge и запуск контейнеров 25:26 | Перемещение контейнеров по сетям 31:31 | Тип сети host 33:24 | Тип сети none 33:48 | Macvlan | ipvlan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Буду очень благодарен за поддержку в виде чашечки ☕️: https://buymeacoffee.com/romnero ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Предложениям пишите на: [email protected] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "06-Docker: Сети в докер. Network: bridge, host, none, macvlan, ipvlan"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.