1
00:00:04,370 --> 00:00:10,010
We have just found out that it is not possible to communicate between the containers using either the

2
00:00:10,080 --> 00:00:14,100
names or host names in default broker network.

3
00:00:14,320 --> 00:00:19,600
And now let me show you how we able to lease the default networks that are created in Tokyo by default

4
00:00:19,930 --> 00:00:23,050
and how you are able to create custom network.

5
00:00:23,080 --> 00:00:23,800
Let's do that.

6
00:00:23,890 --> 00:00:24,880
Let's go to this.

7
00:00:24,880 --> 00:00:26,090
The last step probably.

8
00:00:26,200 --> 00:00:31,590
And here let's clear terminal and here and circumvent Docker network.

9
00:00:31,730 --> 00:00:39,300
There's less help and you'll see a small list of options you are able to use with Docker network command

10
00:00:39,600 --> 00:00:42,590
network is basically management Docker command.

11
00:00:42,690 --> 00:00:49,130
And here you're able to list networks using as you are able to inspect read the details about specific

12
00:00:49,170 --> 00:00:52,740
network or you're able to create new network.

13
00:00:52,740 --> 00:00:59,340
Also you're able to use connect and disconnect commands in order to connect and disconnect the run in

14
00:00:59,340 --> 00:01:03,180
containers of top containers from specific networks.

15
00:01:03,180 --> 00:01:03,510
Great.

16
00:01:03,780 --> 00:01:12,310
Let's first use Docker network allows command in order to list existing network Docker network Alice.

17
00:01:13,220 --> 00:01:16,050
And I see here three networks on the list.

18
00:01:16,260 --> 00:01:17,910
And here in the thrust column you'll see it.

19
00:01:17,910 --> 00:01:21,570
Network idea here here and here also you see here.

20
00:01:21,570 --> 00:01:24,680
Network names breach host and none.

21
00:01:24,720 --> 00:01:28,970
And also you'll see it dry Ross breach host and now great.

22
00:01:29,130 --> 00:01:31,560
But I will explain you at the moment.

23
00:01:31,620 --> 00:01:34,520
What host and not networks do.

24
00:01:34,650 --> 00:01:37,190
I'll focus only on the bridge network.

25
00:01:37,320 --> 00:01:38,670
Let me know inspect.

26
00:01:38,880 --> 00:01:41,640
Read the dailies about this breach network.

27
00:01:41,780 --> 00:01:50,980
For that let's type Docker network inspect and here type breach or you're able to use a d of that network.

28
00:01:51,270 --> 00:01:54,780
And here you'll see the tales about default breach network.

29
00:01:54,780 --> 00:01:57,330
Let me scroll up to the beginning of this output.

30
00:01:57,360 --> 00:02:06,490
And most important part is here subnet it is set to 172 17 0 0 slash 16.

31
00:02:06,580 --> 00:02:08,419
Sixteen is network mask.

32
00:02:08,550 --> 00:02:15,330
It means that this part will be the same for all containers that are running in default breach network

33
00:02:15,870 --> 00:02:22,560
and basically when containers are created Docker hosted a science IP addresses two containers from this

34
00:02:22,680 --> 00:02:23,990
network range.

35
00:02:24,100 --> 00:02:32,340
They're also address 172 17 0 1 is default gateway arduous it is assigned to Docker host itself and

36
00:02:32,340 --> 00:02:34,310
containers get addresses next.

37
00:02:34,350 --> 00:02:40,980
After this first one for example we saw here that the busy box a one container got this address and

38
00:02:40,980 --> 00:02:45,030
the busy bookstore got address this one next after this one.

39
00:02:45,150 --> 00:02:51,970
It means that the docker or simply assigns to new container next free a badass from this range.

40
00:02:52,200 --> 00:03:00,060
This range also in those details about this breach network you might see which containers are currently

41
00:03:00,060 --> 00:03:02,130
created in this network.

42
00:03:02,220 --> 00:03:09,160
Here is container section and you'll see here now two containers Busy Box one here was its name.

43
00:03:09,300 --> 00:03:12,480
Also you see here mac address of this container.

44
00:03:12,480 --> 00:03:14,250
It is also created randomly.

45
00:03:14,580 --> 00:03:17,770
And here is a was assigned to this container.

46
00:03:17,820 --> 00:03:21,900
If you scroll down you'll see the tails about second container.

47
00:03:21,900 --> 00:03:24,010
Here they are here.

48
00:03:24,080 --> 00:03:25,780
It's a name busy bookstore.

49
00:03:25,800 --> 00:03:30,330
And here was a B version of four address assigned to this second container.

50
00:03:30,480 --> 00:03:33,710
And you may notice that MAC address also D for us.

51
00:03:33,720 --> 00:03:39,960
And here you see basically two different MAC addresses because MAC addresses must be unique at least

52
00:03:40,020 --> 00:03:44,270
across the same network those containers are in the same network.

53
00:03:44,280 --> 00:03:47,050
That's why Mike addresses must be also different.

54
00:03:47,070 --> 00:03:47,840
Great.

55
00:03:47,850 --> 00:03:51,330
This current set up in default breach network.

56
00:03:51,360 --> 00:03:57,830
Now let me show you how you're able to create new custom network using Docker network command.

57
00:03:58,050 --> 00:03:59,700
But let's do that next by mail.

