File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
content/manuals/engine/network/drivers Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,23 @@ $ docker network create -d macvlan \
101
101
102
102
### Use an IPvlan instead of Macvlan
103
103
104
- In the above example, you are still using a L3 bridge. You can use ` ipvlan `
105
- instead, and get an L2 bridge. Specify ` -o ipvlan_mode=l2 ` .
104
+ An ` ipvlan ` network created with option ` -o ipvlan_mode=l2 ` is very similar
105
+ to a macvlan network. The main difference is that the ` ipvlan ` driver
106
+ doesn't assign a MAC address to each container, the layer-2 network stack
107
+ is shared by devices in the ipvlan network. So, containers use the parent
108
+ interface's MAC address.
109
+
110
+ The network will see fewer MAC addresses, and the host's MAC address will be
111
+ associated with the IP address of each container.
112
+
113
+ The choice of network type depends on your environment and requirements.
114
+ There are some notes about the trade-offs in the [ Linux kernel
115
+ documentation] ( https://docs.kernel.org/networking/ipvlan.html#what-to-choose-macvlan-vs-ipvlan ) .
106
116
107
117
``` console
108
118
$ docker network create -d ipvlan \
109
119
--subnet=192.168.210.0/24 \
110
- --subnet=192.168.212.0/24 \
111
120
--gateway=192.168.210.254 \
112
- --gateway=192.168.212.254 \
113
121
-o ipvlan_mode=l2 -o parent=eth0 ipvlan210
114
122
```
115
123
You can’t perform that action at this time.
0 commit comments