€•ÎnŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ%/translations/zh_CN/networking/ipvlan”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/zh_TW/networking/ipvlan”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/it_IT/networking/ipvlan”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ja_JP/networking/ipvlan”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ko_KR/networking/ipvlan”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/pt_BR/networking/ipvlan”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/sp_SP/networking/ipvlan”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ?/var/lib/git/docbuild/linux/Documentation/networking/ipvlan.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒIPVLAN Driver HOWTO”h]”hŒIPVLAN Driver HOWTO”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒdefinition_list”“”)”}”(hhh]”hŒdefinition_list_item”“”)”}”(hŒ9Initial Release: Mahesh Bandewar ”h]”(hŒterm”“”)”}”(hŒInitial Release:”h]”hŒInitial Release:”…””}”(hhêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hèh³hÇh´KhhäubhŒ definition”“”)”}”(hhh]”hŒ paragraph”“”)”}”(hŒ'Mahesh Bandewar ”h]”hŒ'Mahesh Bandewar ”…””}”(hhÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khhúubah}”(h]”h ]”h"]”h$]”h&]”uh1høhhäubeh}”(h]”h ]”h"]”h$]”h&]”uh1hâh³hÇh´Khhßubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhhÊh²hh³hÇh´NubhÉ)”}”(hhh]”(hÎ)”}”(hŒ1. Introduction:”h]”hŒ1. Introduction:”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´K ubhþ)”}”(hXAThis is conceptually very similar to the macvlan driver with one major exception of using L3 for mux-ing /demux-ing among slaves. This property makes the master device share the L2 with its slave devices. I have developed this driver in conjunction with network namespaces and not sure if there is use case outside of it.”h]”hXAThis is conceptually very similar to the macvlan driver with one major exception of using L3 for mux-ing /demux-ing among slaves. This property makes the master device share the L2 with its slave devices. I have developed this driver in conjunction with network namespaces and not sure if there is use case outside of it.”…””}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K hjh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ1. introduction:”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ2. Building and Installation:”h]”hŒ2. Building and Installation:”…””}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjFh²hh³hÇh´Kubhþ)”}”(hŒ¦In order to build the driver, please select the config item CONFIG_IPVLAN. The driver can be built into the kernel (CONFIG_IPVLAN=y) or as a module (CONFIG_IPVLAN=m).”h]”hŒ¦In order to build the driver, please select the config item CONFIG_IPVLAN. The driver can be built into the kernel (CONFIG_IPVLAN=y) or as a module (CONFIG_IPVLAN=m).”…””}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KhjFh²hubeh}”(h]”Œbuilding-and-installation”ah ]”h"]”Œ2. building and installation:”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3. Configuration:”h]”hŒ3. Configuration:”…””}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjmh²hh³hÇh´Kubhþ)”}”(hŒeThere are no module parameters for this driver and it can be configured using IProute2/ip utility. ::”h]”hŒbThere are no module parameters for this driver and it can be configured using IProute2/ip utility.”…””}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khjmh²hubhŒ literal_block”“”)”}”(hŒ¤ip link add link name type ipvlan [ mode MODE ] [ FLAGS ] where MODE: l3 (default) | l3s | l2 FLAGS: bridge (default) | private | vepa”h]”hŒ¤ip link add link name type ipvlan [ mode MODE ] [ FLAGS ] where MODE: l3 (default) | l3s | l2 FLAGS: bridge (default) | private | vepa”…””}”hjŽsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K"hjmh²hubhþ)”}”(hŒe.g.”h]”hŒe.g.”…””}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K'hjmh²hubhŒ block_quote”“”)”}”(hX+(a) Following will create IPvlan link with eth0 as master in L3 bridge mode:: bash# ip link add link eth0 name ipvl0 type ipvlan (b) This command will create IPvlan link in L2 bridge mode:: bash# ip link add link eth0 name ipvl0 type ipvlan mode l2 bridge (c) This command will create an IPvlan device in L2 private mode:: bash# ip link add link eth0 name ipvlan type ipvlan mode l2 private (d) This command will create an IPvlan device in L2 vepa mode:: bash# ip link add link eth0 name ipvlan type ipvlan mode l2 vepa ”h]”hŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒFollowing will create IPvlan link with eth0 as master in L3 bridge mode:: bash# ip link add link eth0 name ipvl0 type ipvlan”h]”(hþ)”}”(hŒIFollowing will create IPvlan link with eth0 as master in L3 bridge mode::”h]”hŒHFollowing will create IPvlan link with eth0 as master in L3 bridge mode:”…””}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K)hj·ubj)”}”(hŒ2bash# ip link add link eth0 name ipvl0 type ipvlan”h]”hŒ2bash# ip link add link eth0 name ipvl0 type ipvlan”…””}”hjÉsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K,hj·ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhj²ubj¶)”}”(hŒ~This command will create IPvlan link in L2 bridge mode:: bash# ip link add link eth0 name ipvl0 type ipvlan mode l2 bridge ”h]”(hþ)”}”(hŒ8This command will create IPvlan link in L2 bridge mode::”h]”hŒ7This command will create IPvlan link in L2 bridge mode:”…””}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K-hjÝubj)”}”(hŒAbash# ip link add link eth0 name ipvl0 type ipvlan mode l2 bridge”h]”hŒAbash# ip link add link eth0 name ipvl0 type ipvlan mode l2 bridge”…””}”hjïsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K/hjÝubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhj²ubj¶)”}”(hŒ†This command will create an IPvlan device in L2 private mode:: bash# ip link add link eth0 name ipvlan type ipvlan mode l2 private ”h]”(hþ)”}”(hŒ>This command will create an IPvlan device in L2 private mode::”h]”hŒ=This command will create an IPvlan device in L2 private mode:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K1hjubj)”}”(hŒCbash# ip link add link eth0 name ipvlan type ipvlan mode l2 private”h]”hŒCbash# ip link add link eth0 name ipvlan type ipvlan mode l2 private”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K3hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhj²ubj¶)”}”(hŒThis command will create an IPvlan device in L2 vepa mode:: bash# ip link add link eth0 name ipvlan type ipvlan mode l2 vepa ”h]”(hþ)”}”(hŒ;This command will create an IPvlan device in L2 vepa mode::”h]”hŒ:This command will create an IPvlan device in L2 vepa mode:”…””}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K5hj)ubj)”}”(hŒ@bash# ip link add link eth0 name ipvlan type ipvlan mode l2 vepa”h]”hŒ@bash# ip link add link eth0 name ipvlan type ipvlan mode l2 vepa”…””}”hj;sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K7hj)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhj²ubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œ loweralpha”Œprefix”Œ(”Œsuffix”Œ)”uh1j°hj¬ubah}”(h]”h ]”h"]”h$]”h&]”uh1jªh³hÇh´K)hjmh²hubeh}”(h]”Œ configuration”ah ]”h"]”Œ3. configuration:”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ4. Operating modes:”h]”hŒ4. Operating modes:”…””}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjih²hh³hÇh´K;ubhþ)”}”(hXIPvlan has two modes of operation - L2 and L3. For a given master device, you can select one of these two modes and all slaves on that master will operate in the same (selected) mode. The RX mode is almost identical except that in L3 mode the slaves won't receive any multicast / broadcast traffic. L3 mode is more restrictive since routing is controlled from the other (mostly) default namespace.”h]”hXIPvlan has two modes of operation - L2 and L3. For a given master device, you can select one of these two modes and all slaves on that master will operate in the same (selected) mode. The RX mode is almost identical except that in L3 mode the slaves won’t receive any multicast / broadcast traffic. L3 mode is more restrictive since routing is controlled from the other (mostly) default namespace.”…””}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K=hjih²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 4.1 L2 mode:”h]”hŒ 4.1 L2 mode:”…””}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjˆh²hh³hÇh´KEubhþ)”}”(hŒïIn this mode TX processing happens on the stack instance attached to the slave device and packets are switched and queued to the master device to send out. In this mode the slaves will RX/TX multicast and broadcast (if applicable) as well.”h]”hŒïIn this mode TX processing happens on the stack instance attached to the slave device and packets are switched and queued to the master device to send out. In this mode the slaves will RX/TX multicast and broadcast (if applicable) as well.”…””}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KGhjˆh²hubeh}”(h]”Œl2-mode”ah ]”h"]”Œ 4.1 l2 mode:”ah$]”h&]”uh1hÈhjih²hh³hÇh´KEubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 4.2 L3 mode:”h]”hŒ 4.2 L3 mode:”…””}”(hj²h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¯h²hh³hÇh´KMubhþ)”}”(hXkIn this mode TX processing up to L3 happens on the stack instance attached to the slave device and packets are switched to the stack instance of the master device for the L2 processing and routing from that instance will be used before packets are queued on the outbound device. In this mode the slaves will not receive nor can send multicast / broadcast traffic.”h]”hXkIn this mode TX processing up to L3 happens on the stack instance attached to the slave device and packets are switched to the stack instance of the master device for the L2 processing and routing from that instance will be used before packets are queued on the outbound device. In this mode the slaves will not receive nor can send multicast / broadcast traffic.”…””}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KOhj¯h²hubeh}”(h]”Œl3-mode”ah ]”h"]”Œ 4.2 l3 mode:”ah$]”h&]”uh1hÈhjih²hh³hÇh´KMubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 4.3 L3S mode:”h]”hŒ 4.3 L3S mode:”…””}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÖh²hh³hÇh´KVubhþ)”}”(hXThis is very similar to the L3 mode except that iptables (conn-tracking) works in this mode and hence it is L3-symmetric (L3s). This will have slightly less performance but that shouldn't matter since you are choosing this mode over plain-L3 mode to make conn-tracking work.”h]”hXThis is very similar to the L3 mode except that iptables (conn-tracking) works in this mode and hence it is L3-symmetric (L3s). This will have slightly less performance but that shouldn’t matter since you are choosing this mode over plain-L3 mode to make conn-tracking work.”…””}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KXhjÖh²hubeh}”(h]”Œl3s-mode”ah ]”h"]”Œ 4.3 l3s mode:”ah$]”h&]”uh1hÈhjih²hh³hÇh´KVubeh}”(h]”Œoperating-modes”ah ]”h"]”Œ4. operating modes:”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K;ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ5. Mode flags:”h]”hŒ5. Mode flags:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´K^ubhþ)”}”(hŒ/At this time following mode flags are available”h]”hŒ/At this time following mode flags are available”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K`hjh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 5.1 bridge:”h]”hŒ 5.1 bridge:”…””}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj$h²hh³hÇh´Kcubhþ)”}”(hXThis is the default option. To configure the IPvlan port in this mode, user can choose to either add this option on the command-line or don't specify anything. This is the traditional mode where slaves can cross-talk among themselves apart from talking through the master device.”h]”hXThis is the default option. To configure the IPvlan port in this mode, user can choose to either add this option on the command-line or don’t specify anything. This is the traditional mode where slaves can cross-talk among themselves apart from talking through the master device.”…””}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kdhj$h²hubeh}”(h]”Œbridge”ah ]”h"]”Œ 5.1 bridge:”ah$]”h&]”uh1hÈhjh²hh³hÇh´KcubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 5.2 private:”h]”hŒ 5.2 private:”…””}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjKh²hh³hÇh´Kjubhþ)”}”(hŒ‡If this option is added to the command-line, the port is set in private mode. i.e. port won't allow cross communication between slaves.”h]”hŒ‰If this option is added to the command-line, the port is set in private mode. i.e. port won’t allow cross communication between slaves.”…””}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KkhjKh²hubeh}”(h]”Œprivate”ah ]”h"]”Œ 5.2 private:”ah$]”h&]”uh1hÈhjh²hh³hÇh´KjubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 5.3 vepa:”h]”hŒ 5.3 vepa:”…””}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjrh²hh³hÇh´Koubhþ)”}”(hX°If this is added to the command-line, the port is set in VEPA mode. i.e. port will offload switching functionality to the external entity as described in 802.1Qbg Note: VEPA mode in IPvlan has limitations. IPvlan uses the mac-address of the master-device, so the packets which are emitted in this mode for the adjacent neighbor will have source and destination mac same. This will make the switch / router send the redirect message.”h]”hX°If this is added to the command-line, the port is set in VEPA mode. i.e. port will offload switching functionality to the external entity as described in 802.1Qbg Note: VEPA mode in IPvlan has limitations. IPvlan uses the mac-address of the master-device, so the packets which are emitted in this mode for the adjacent neighbor will have source and destination mac same. This will make the switch / router send the redirect message.”…””}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kphjrh²hubeh}”(h]”Œvepa”ah ]”h"]”Œ 5.3 vepa:”ah$]”h&]”uh1hÈhjh²hh³hÇh´Koubeh}”(h]”Œ mode-flags”ah ]”h"]”Œ5. mode flags:”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K^ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ'6. What to choose (macvlan vs. ipvlan)?”h]”hŒ'6. What to choose (macvlan vs. ipvlan)?”…””}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¡h²hh³hÇh´Kyubhþ)”}”(hŒ×These two devices are very similar in many regards and the specific use case could very well define which device to choose. if one of the following situations defines your use case then you can choose to use ipvlan:”h]”hŒ×These two devices are very similar in many regards and the specific use case could very well define which device to choose. if one of the following situations defines your use case then you can choose to use ipvlan:”…””}”(hj²h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K{hj¡h²hubj±)”}”(hhh]”(j¶)”}”(hŒyThe Linux host that is connected to the external switch / router has policy configured that allows only one mac per port.”h]”hþ)”}”(hŒyThe Linux host that is connected to the external switch / router has policy configured that allows only one mac per port.”h]”hŒyThe Linux host that is connected to the external switch / router has policy configured that allows only one mac per port.”…””}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K€hjÃubah}”(h]”h ]”h"]”h$]”h&]”uh1jµhjÀh²hh³hÇh´Nubj¶)”}”(hŒNo of virtual devices created on a master exceed the mac capacity and puts the NIC in promiscuous mode and degraded performance is a concern.”h]”hþ)”}”(hŒNo of virtual devices created on a master exceed the mac capacity and puts the NIC in promiscuous mode and degraded performance is a concern.”h]”hŒNo of virtual devices created on a master exceed the mac capacity and puts the NIC in promiscuous mode and degraded performance is a concern.”…””}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K‚hjÛubah}”(h]”h ]”h"]”h$]”h&]”uh1jµhjÀh²hh³hÇh´Nubj¶)”}”(hŒƒIf the slave device is to be put into the hostile / untrusted network namespace where L2 on the slave could be changed / misused. ”h]”hþ)”}”(hŒIf the slave device is to be put into the hostile / untrusted network namespace where L2 on the slave could be changed / misused.”h]”hŒIf the slave device is to be put into the hostile / untrusted network namespace where L2 on the slave could be changed / misused.”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K„hjóubah}”(h]”h ]”h"]”h$]”h&]”uh1jµhjÀh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jUjVjWjXjYjZuh1j°hj¡h²hh³hÇh´K€ubeh}”(h]”Œ what-to-choose-macvlan-vs-ipvlan”ah ]”h"]”Œ'6. what to choose (macvlan vs. ipvlan)?”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KyubhÉ)”}”(hhh]”(hÎ)”}”(hŒ6. Example configuration:”h]”hŒ6. Example configuration:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´K‰ubj)”}”(hX?+=============================================================+ | Host: host1 | | | | +----------------------+ +----------------------+ | | | NS:ns0 | | NS:ns1 | | | | | | | | | | | | | | | | ipvl0 | | ipvl1 | | | +----------#-----------+ +-----------#----------+ | | # # | | ################################ | | # eth0 | +==============================#==============================+”h]”hX?+=============================================================+ | Host: host1 | | | | +----------------------+ +----------------------+ | | | NS:ns0 | | NS:ns1 | | | | | | | | | | | | | | | | ipvl0 | | ipvl1 | | | +----------#-----------+ +-----------#----------+ | | # # | | ################################ | | # eth0 | +==============================#==============================+”…””}”hj*sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´Khjh²hubj±)”}”(hhh]”(j¶)”}”(hŒVCreate two network namespaces - ns0, ns1:: ip netns add ns0 ip netns add ns1 ”h]”(hþ)”}”(hŒ*Create two network namespaces - ns0, ns1::”h]”hŒ)Create two network namespaces - ns0, ns1:”…””}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kœhj;ubj)”}”(hŒ!ip netns add ns0 ip netns add ns1”h]”hŒ!ip netns add ns0 ip netns add ns1”…””}”hjMsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´Kžhj;ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhj8h²hh³hÇh´Nubj¶)”}”(hŒœCreate two ipvlan slaves on eth0 (master device):: ip link add link eth0 ipvl0 type ipvlan mode l2 ip link add link eth0 ipvl1 type ipvlan mode l2 ”h]”(hþ)”}”(hŒ2Create two ipvlan slaves on eth0 (master device)::”h]”hŒ1Create two ipvlan slaves on eth0 (master device):”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K¡hjaubj)”}”(hŒ_ip link add link eth0 ipvl0 type ipvlan mode l2 ip link add link eth0 ipvl1 type ipvlan mode l2”h]”hŒ_ip link add link eth0 ipvl0 type ipvlan mode l2 ip link add link eth0 ipvl1 type ipvlan mode l2”…””}”hjssbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K£hjaubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhj8h²hh³hÇh´Nubj¶)”}”(hŒ~Assign slaves to the respective network namespaces:: ip link set dev ipvl0 netns ns0 ip link set dev ipvl1 netns ns1 ”h]”(hþ)”}”(hŒ4Assign slaves to the respective network namespaces::”h]”hŒ3Assign slaves to the respective network namespaces:”…””}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K¦hj‡ubj)”}”(hŒ?ip link set dev ipvl0 netns ns0 ip link set dev ipvl1 netns ns1”h]”hŒ?ip link set dev ipvl0 netns ns0 ip link set dev ipvl1 netns ns1”…””}”hj™sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K¨hj‡ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhj8h²hh³hÇh´Nubj¶)”}”(hX•Now switch to the namespace (ns0 or ns1) to configure the slave devices - For ns0:: (1) ip netns exec ns0 bash (2) ip link set dev ipvl0 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl0 (6) ip -4 route add default via $ROUTER dev ipvl0 - For ns1:: (1) ip netns exec ns1 bash (2) ip link set dev ipvl1 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl1 (6) ip -4 route add default via $ROUTER dev ipvl1”h]”(hþ)”}”(hŒGNow switch to the namespace (ns0 or ns1) to configure the slave devices”h]”hŒGNow switch to the namespace (ns0 or ns1) to configure the slave devices”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K«hj­ubj«)”}”(hX- For ns0:: (1) ip netns exec ns0 bash (2) ip link set dev ipvl0 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl0 (6) ip -4 route add default via $ROUTER dev ipvl0 - For ns1:: (1) ip netns exec ns1 bash (2) ip link set dev ipvl1 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl1 (6) ip -4 route add default via $ROUTER dev ipvl1”h]”hŒ bullet_list”“”)”}”(hhh]”(j¶)”}”(hŒüFor ns0:: (1) ip netns exec ns0 bash (2) ip link set dev ipvl0 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl0 (6) ip -4 route add default via $ROUTER dev ipvl0 ”h]”(hþ)”}”(hŒ For ns0::”h]”hŒFor ns0:”…””}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K­hjÈubj)”}”(hŒÌ(1) ip netns exec ns0 bash (2) ip link set dev ipvl0 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl0 (6) ip -4 route add default via $ROUTER dev ipvl0”h]”hŒÌ(1) ip netns exec ns0 bash (2) ip link set dev ipvl0 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl0 (6) ip -4 route add default via $ROUTER dev ipvl0”…””}”hjÚsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K¯hjÈubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhjÅubj¶)”}”(hŒûFor ns1:: (1) ip netns exec ns1 bash (2) ip link set dev ipvl1 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl1 (6) ip -4 route add default via $ROUTER dev ipvl1”h]”(hþ)”}”(hŒ For ns1::”h]”hŒFor ns1:”…””}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K¶hjîubj)”}”(hŒÌ(1) ip netns exec ns1 bash (2) ip link set dev ipvl1 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl1 (6) ip -4 route add default via $ROUTER dev ipvl1”h]”hŒÌ(1) ip netns exec ns1 bash (2) ip link set dev ipvl1 up (3) ip link set dev lo up (4) ip -4 addr add 127.0.0.1 dev lo (5) ip -4 addr add $IPADDR dev ipvl1 (6) ip -4 route add default via $ROUTER dev ipvl1”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jŒh³hÇh´K¸hjîubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhjÅubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jÃh³hÇh´K­hj¿ubah}”(h]”h ]”h"]”h$]”h&]”uh1jªh³hÇh´K­hj­ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jµhj8h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jUjVjWjXjYjZuh1j°hjh²hh³hÇh´Kœubeh}”(h]”Œexample-configuration”ah ]”h"]”Œ6. example configuration:”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K‰ubeh}”(h]”Œipvlan-driver-howto”ah ]”h"]”Œipvlan driver howto”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jaŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j;j8jCj@jjjgjfjcjjÿj¬j©jÓjÐjúj÷jžj›jHjEjojlj–j“jjj3j0uŒ nametypes”}”(j;‰jC‰jj‰jf‰j‰j¬‰jÓ‰jú‰jž‰jH‰jo‰j–‰j‰j3‰uh}”(j8hÊj@jjgjFjcjmjÿjij©jˆjÐj¯j÷jÖj›jjEj$jljKj“jrjj¡j0juŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.