<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Estellt</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Estellt"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Estellt"/>
	<updated>2026-06-13T16:50:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2769</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2769"/>
		<updated>2007-02-18T18:01:24Z</updated>

		<summary type="html">&lt;p&gt;Estellt: Added what version of vzctl is needed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
This page discusses working with multiple network interfaces on the Hardware Node (HN), how this results in ARP Flux, and how to address this.&lt;br /&gt;
&lt;br /&gt;
==The Simple Case==&lt;br /&gt;
In the simple case you have multiple network interfaces on the HN, all with IP addresses in the same subnet.  Each of your Virtual Environments (VE's) also have IP addresses in the same subnet.  You don't care which interfaces your VE's use.&lt;br /&gt;
&lt;br /&gt;
So, no action is required.  Everything just works.  Setup OpenVZ normally.&lt;br /&gt;
&lt;br /&gt;
The only downside is '''ARP flux'''.  This describes the usually harmless condition where the network address (layer 3) drifts between multiple hardware addresses (layer 2).  While this may cause some confusion to anyone trouble shooting, or generate alarms on network monitoring systems, it doesn't interrupt network traffic.&lt;br /&gt;
&lt;br /&gt;
For an example of what this may look like, see the example and tcpdump captures below.&lt;br /&gt;
&lt;br /&gt;
==A More Complex Case==&lt;br /&gt;
Let's say you have three network interfaces on the HN, all with IP addresses on the same subnet.  Each of your VE's also have IP addresses on the same subnet.  But now you ''do'' care which interface your VE's use.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
===Example Network Setup===&lt;br /&gt;
To make this clear we'll use the following HN configuration.  We'll also have another system to act as the client.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! System !! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth4 || 00:0c:29:b3:a2:5e || 192.168.18.12&lt;br /&gt;
|-&lt;br /&gt;
| client || eth0 || 00:0c:29:d2:c7:aa || 192.168.18.129&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===HN ARP Flux===&lt;br /&gt;
The first issue is fixing the '''ARP flux''' noted above.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of the HN addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
====Example One - HN ARP Flux====&lt;br /&gt;
For example, the following is a tcpdump capture from executing &amp;lt;code&amp;gt;ping -c2 192.168.18.10&amp;lt;/code&amp;gt; from the client system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ARP &amp;quot;who has&amp;quot; message generated replies from all three MAC addresses on the HN.  In this case the client took the MAC address for eth4.  The three ICMP messages are then sent to eth4, but all the replies come from eth0.  Normally this behavior isn't a problem, though it may generate some false alarms for a network monitor as it appears someone could be executing a man in the middle attack.&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====A Simple Fix That May Work====&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then this won't achieve the desired results.&lt;br /&gt;
&lt;br /&gt;
====A More Effective Solution====&lt;br /&gt;
The following can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 1&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 2&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Example Two - HN ARP Flux Corrected====&lt;br /&gt;
Now we repeat the ping command, after the arp cache on the client has been cleared.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The desired affect has been achieved.  Only interface eth0 on the HN responds to the ARP message and the other interfaces are silent.&lt;br /&gt;
&lt;br /&gt;
===Adding some VE's===&lt;br /&gt;
Now that the HN is behaving as expected, let's add some VE's and see what happens.&lt;br /&gt;
&lt;br /&gt;
====VE Network Setup====&lt;br /&gt;
The case we're addressing is when the VE's are on the same subnet as the HN.  So we create two new VE's and assign the addresses as follows.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! VEID || IP&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 192.168.18.101&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 192.168.18.102&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Example Three - VE ARP Flux====&lt;br /&gt;
From the client system on you should be able to ping both VE's.  However, looking at the ARP traffic with tcpdump you'll see that once again the network address associated with each VE will be subject to ARP flux, drifting between all three link layer addresses over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====The ARP Cache====&lt;br /&gt;
The reasons for this can be found from executing the following command on the HN to display the ARP cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arp -an&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
? (192.168.18.129) at 00:0C:29:D2:C7:AA [ether] on eth0&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another view is obtained from the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/net/arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP address       HW type     Flags       HW address            Mask     Device&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this shows is that each VE's IP address is associated with each HN's interface.  Therefore each interface will respond to any ARP &amp;quot;who has&amp;quot; query.&lt;br /&gt;
&lt;br /&gt;
====The Cause====&lt;br /&gt;
These entries are created by the vzarp function in the vps_functions script, which are called by vps-net_add, vps-net_del and vps-stop.  The result of this function in our case is to execute the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth3&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the following ARP messages are sent when VEID 101 is started.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.10&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.12&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.11&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here is the result of vzarpipdetect, another function in vps_functions called by vps-net_add.  An ARP &amp;quot;who has&amp;quot; message is sent by each interface and answered by the other interfaces.&lt;br /&gt;
&lt;br /&gt;
What we want is to only add the IP addresses of our VE's to specific devices, not to all devices.  This will prevent the ARP flux problem for our VE's.&lt;br /&gt;
&lt;br /&gt;
====The Quick Fix====&lt;br /&gt;
Unfortunately this involves editing the OpenVZ scripts.  The only case we really care about is vps-net_add, as the others execute &amp;lt;code&amp;gt;ip neigh del proxy&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Manually editing the vzarp script is a quick fix, but not advised.  Creating your own ''fork'' of OpenVZ is difficult to maintain and may have unintended side affects.&lt;br /&gt;
&lt;br /&gt;
Fortunately there is a feature which will allow custom scripts to run during VE startup.&lt;br /&gt;
&lt;br /&gt;
This approach is also described in http://wiki.openvz.org/Virtual_Ethernet_device.&lt;br /&gt;
&lt;br /&gt;
In the VE configuration file, /etc/vz/conf/$VEID.conf, add the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONFIG_CUSTOMIZED=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the file /etc/vz/vznet.conf or /etc/vz/vznetcfg.  Note that this will only work with a recent version of OpenVZ (vzctl-3.0.14) as the change was introduced in December, 2006.  The file name seems to have changed between the two listed here so some trial and error may be required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
EXTERNAL_SCRIPT=&amp;quot;/usr/lib/vzctl/scripts/vznet-custom&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally create the file /usr/lib/vzctl/scripts/vznet-custom and add your custom commands.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss contents of script and provide examples.  Still need to work on getting this to work.&lt;br /&gt;
&lt;br /&gt;
==Testing Environment==&lt;br /&gt;
All of the examples have been generated and tested using Debian Etch for the HN and Debian Stable for the VE's.  VMware Workstation was used to create the test networks.  The client is the BackTrack live CD from Remote Exploit.  If you have different results from other releases of Linux please edit this page.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[Category:Debian]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2768</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2768"/>
		<updated>2007-02-18T17:44:44Z</updated>

		<summary type="html">&lt;p&gt;Estellt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
This page discusses working with multiple network interfaces on the Hardware Node (HN), how this results in ARP Flux, and how to address this.&lt;br /&gt;
&lt;br /&gt;
==The Simple Case==&lt;br /&gt;
In the simple case you have multiple network interfaces on the HN, all with IP addresses in the same subnet.  Each of your Virtual Environments (VE's) also have IP addresses in the same subnet.  You don't care which interfaces your VE's use.&lt;br /&gt;
&lt;br /&gt;
So, no action is required.  Everything just works.  Setup OpenVZ normally.&lt;br /&gt;
&lt;br /&gt;
The only downside is '''ARP flux'''.  This describes the usually harmless condition where the network address (layer 3) drifts between multiple hardware addresses (layer 2).  While this may cause some confusion to anyone trouble shooting, or generate alarms on network monitoring systems, it doesn't interrupt network traffic.&lt;br /&gt;
&lt;br /&gt;
For an example of what this may look like, see the example and tcpdump captures below.&lt;br /&gt;
&lt;br /&gt;
==A More Complex Case==&lt;br /&gt;
Let's say you have three network interfaces on the HN, all with IP addresses on the same subnet.  Each of your VE's also have IP addresses on the same subnet.  But now you ''do'' care which interface your VE's use.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
===Example Network Setup===&lt;br /&gt;
To make this clear we'll use the following HN configuration.  We'll also have another system to act as the client.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! System !! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth4 || 00:0c:29:b3:a2:5e || 192.168.18.12&lt;br /&gt;
|-&lt;br /&gt;
| client || eth0 || 00:0c:29:d2:c7:aa || 192.168.18.129&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===HN ARP Flux===&lt;br /&gt;
The first issue is fixing the '''ARP flux''' noted above.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of the HN addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
====Example One - HN ARP Flux====&lt;br /&gt;
For example, the following is a tcpdump capture from executing &amp;lt;code&amp;gt;ping -c2 192.168.18.10&amp;lt;/code&amp;gt; from the client system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ARP &amp;quot;who has&amp;quot; message generated replies from all three MAC addresses on the HN.  In this case the client took the MAC address for eth4.  The three ICMP messages are then sent to eth4, but all the replies come from eth0.  Normally this behavior isn't a problem, though it may generate some false alarms for a network monitor as it appears someone could be executing a man in the middle attack.&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====A Simple Fix That May Work====&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then this won't achieve the desired results.&lt;br /&gt;
&lt;br /&gt;
====A More Effective Solution====&lt;br /&gt;
The following can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 1&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 2&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Example Two - HN ARP Flux Corrected====&lt;br /&gt;
Now we repeat the ping command, after the arp cache on the client has been cleared.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The desired affect has been achieved.  Only interface eth0 on the HN responds to the ARP message and the other interfaces are silent.&lt;br /&gt;
&lt;br /&gt;
===Adding some VE's===&lt;br /&gt;
Now that the HN is behaving as expected, let's add some VE's and see what happens.&lt;br /&gt;
&lt;br /&gt;
====VE Network Setup====&lt;br /&gt;
The case we're addressing is when the VE's are on the same subnet as the HN.  So we create two new VE's and assign the addresses as follows.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! VEID || IP&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 192.168.18.101&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 192.168.18.102&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Example Three - VE ARP Flux====&lt;br /&gt;
From the client system on you should be able to ping both VE's.  However, looking at the ARP traffic with tcpdump you'll see that once again the network address associated with each VE will be subject to ARP flux, drifting between all three link layer addresses over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====The ARP Cache====&lt;br /&gt;
The reasons for this can be found from executing the following command on the HN to display the ARP cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arp -an&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
? (192.168.18.129) at 00:0C:29:D2:C7:AA [ether] on eth0&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another view is obtained from the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/net/arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP address       HW type     Flags       HW address            Mask     Device&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this shows is that each VE's IP address is associated with each HN's interface.  Therefore each interface will respond to any ARP &amp;quot;who has&amp;quot; query.&lt;br /&gt;
&lt;br /&gt;
====The Cause====&lt;br /&gt;
These entries are created by the vzarp function in the vps_functions script, which are called by vps-net_add, vps-net_del and vps-stop.  The result of this function in our case is to execute the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth3&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the following ARP messages are sent when VEID 101 is started.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.10&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.12&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.11&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here is the result of vzarpipdetect, another function in vps_functions called by vps-net_add.  An ARP &amp;quot;who has&amp;quot; message is sent by each interface and answered by the other interfaces.&lt;br /&gt;
&lt;br /&gt;
What we want is to only add the IP addresses of our VE's to specific devices, not to all devices.  This will prevent the ARP flux problem for our VE's.&lt;br /&gt;
&lt;br /&gt;
====The Quick Fix====&lt;br /&gt;
Unfortunately this involves editing the OpenVZ scripts.  The only case we really care about is vps-net_add, as the others execute &amp;lt;code&amp;gt;ip neigh del proxy&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Manually editing the vzarp script is a quick fix, but not advised.  Creating your own ''fork'' of OpenVZ is difficult to maintain and may have unintended side affects.&lt;br /&gt;
&lt;br /&gt;
Fortunately there is a feature which will allow custom scripts to run during VE startup.&lt;br /&gt;
&lt;br /&gt;
This approach is also described in http://wiki.openvz.org/Virtual_Ethernet_device.&lt;br /&gt;
&lt;br /&gt;
In the VE configuration file, /etc/vz/conf/$VEID.conf, add the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONFIG_CUSTOMIZED=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the file /etc/vz/vznet.conf or /etc/vz/vznetcfg.  Note that this will only work with a recent version of OpenVZ as the change was introduced in December, 2006.  The file name seems to have changed between the two listed here so some trial and error will be required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
EXTERNAL_SCRIPT=&amp;quot;/usr/lib/vzctl/scripts/vznet-custom&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally create the file /usr/lib/vzctl/scripts/vznet-custom and add your custom commands.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss contents of script and provide examples.  Still need to work on getting this to work.&lt;br /&gt;
&lt;br /&gt;
==Testing Environment==&lt;br /&gt;
All of the examples have been generated and tested using Debian Etch for the HN and Debian Stable for the VE's.  VMware Workstation was used to create the test networks.  The client is the BackTrack live CD from Remote Exploit.  If you have different results from other releases of Linux please edit this page.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[Category:Debian]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2766</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2766"/>
		<updated>2007-02-18T17:28:18Z</updated>

		<summary type="html">&lt;p&gt;Estellt: Multiple Network Interfaces moved to Multiple Network Interfaces And ARP Flux&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
This page discusses working with multiple network interfaces on the Hardware Node (HN).&lt;br /&gt;
&lt;br /&gt;
==The Simple Case==&lt;br /&gt;
In the simple case you have multiple network interfaces on the HN, all with IP addresses in the same subnet.  Each of your Virtual Environments (VE's) also have IP addresses in the same subnet.  You don't care which interfaces your VE's use.&lt;br /&gt;
&lt;br /&gt;
So, no action is required.  Everything just works.  Setup OpenVZ normally.&lt;br /&gt;
&lt;br /&gt;
The only downside is '''ARP flux'''.  This describes the usually harmless condition where the network address (layer 3) drifts between multiple hardware addresses (layer 2).  While this may cause some confusion to anyone trouble shooting, or generate alarms on network monitoring systems, it doesn't interrupt network traffic.&lt;br /&gt;
&lt;br /&gt;
For an example of what this may look like, see the example and tcpdump captures below.&lt;br /&gt;
&lt;br /&gt;
==A More Complex Case==&lt;br /&gt;
Let's say you have three network interfaces on the HN, all with IP addresses on the same subnet.  Each of your VE's also have IP addresses on the same subnet.  But now you ''do'' care which interface your VE's use.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
===Example Network Setup===&lt;br /&gt;
To make this clear we'll use the following HN configuration.  We'll also have another system to act as the client.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! System !! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth4 || 00:0c:29:b3:a2:5e || 192.168.18.12&lt;br /&gt;
|-&lt;br /&gt;
| client || eth0 || 00:0c:29:d2:c7:aa || 192.168.18.129&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===HN ARP Flux===&lt;br /&gt;
The first issue is fixing the '''ARP flux''' noted above.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of the HN addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
====Example One - HN ARP Flux====&lt;br /&gt;
For example, the following is a tcpdump capture from executing &amp;lt;code&amp;gt;ping -c2 192.168.18.10&amp;lt;/code&amp;gt; from the client system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ARP &amp;quot;who has&amp;quot; message generated replies from all three MAC addresses on the HN.  In this case the client took the MAC address for eth4.  The three ICMP messages are then sent to eth4, but all the replies come from eth0.  Normally this behavior isn't a problem, though it may generate some false alarms for a network monitor as it appears someone could be executing a man in the middle attack.&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====A Simple Fix That May Work====&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then this won't achieve the desired results.&lt;br /&gt;
&lt;br /&gt;
====A More Effective Solution====&lt;br /&gt;
The following can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 1&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 2&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Example Two - HN ARP Flux Corrected====&lt;br /&gt;
Now we repeat the ping command, after the arp cache on the client has been cleared.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The desired affect has been achieved.  Only interface eth0 on the HN responds to the ARP message and the other interfaces are silent.&lt;br /&gt;
&lt;br /&gt;
===Adding some VE's===&lt;br /&gt;
Now that the HN is behaving as expected, let's add some VE's and see what happens.&lt;br /&gt;
&lt;br /&gt;
====VE Network Setup====&lt;br /&gt;
The case we're addressing is when the VE's are on the same subnet as the HN.  So we create two new VE's and assign the addresses as follows.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! VEID || IP&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 192.168.18.101&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 192.168.18.102&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Example Three - VE ARP Flux====&lt;br /&gt;
From the client system on you should be able to ping both VE's.  However, looking at the ARP traffic with tcpdump you'll see that once again the network address associated with each VE will be subject to ARP flux, drifting between all three link layer addresses over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====The ARP Cache====&lt;br /&gt;
The reasons for this can be found from executing the following command on the HN to display the ARP cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arp -an&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
? (192.168.18.129) at 00:0C:29:D2:C7:AA [ether] on eth0&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another view is obtained from the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/net/arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP address       HW type     Flags       HW address            Mask     Device&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this shows is that each VE's IP address is associated with each HN's interface.  Therefore each interface will respond to any ARP &amp;quot;who has&amp;quot; query.&lt;br /&gt;
&lt;br /&gt;
====The Cause====&lt;br /&gt;
These entries are created by the vzarp function in the vps_functions script, which are called by vps-net_add, vps-net_del and vps-stop.  The result of this function in our case is to execute the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth3&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the following ARP messages are sent when VEID 101 is started.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.10&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.12&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.11&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here is the result of vzarpipdetect, another function in vps_functions called by vps-net_add.  An ARP &amp;quot;who has&amp;quot; message is sent by each interface and answered by the other interfaces.&lt;br /&gt;
&lt;br /&gt;
What we want is to only add the IP addresses of our VE's to specific devices, not to all devices.  This will prevent the ARP flux problem for our VE's.&lt;br /&gt;
&lt;br /&gt;
====The Quick Fix====&lt;br /&gt;
Unfortunately this involves editing the OpenVZ scripts.  The only case we really care about is vps-net_add, as the others execute &amp;lt;code&amp;gt;ip neigh del proxy&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss changes to scripts.&lt;br /&gt;
&lt;br /&gt;
==Testing Environment==&lt;br /&gt;
All of the examples have been generated and tested using Debian Etch for the HN and Debian Stable for the VE's.  VMware Workstation was used to create the test networks.  The client is the BackTrack live CD from Remote Exploit.  If you have different results from other releases of Linux please edit this page.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[Category:Debian]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_Network_Interfaces&amp;diff=2767</id>
		<title>Multiple Network Interfaces</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_Network_Interfaces&amp;diff=2767"/>
		<updated>2007-02-18T17:28:18Z</updated>

		<summary type="html">&lt;p&gt;Estellt: Multiple Network Interfaces moved to Multiple Network Interfaces And ARP Flux&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Multiple Network Interfaces And ARP Flux]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2765</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2765"/>
		<updated>2007-02-18T03:43:45Z</updated>

		<summary type="html">&lt;p&gt;Estellt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
This page discusses working with multiple network interfaces on the Hardware Node (HN).&lt;br /&gt;
&lt;br /&gt;
==The Simple Case==&lt;br /&gt;
In the simple case you have multiple network interfaces on the HN, all with IP addresses in the same subnet.  Each of your Virtual Environments (VE's) also have IP addresses in the same subnet.  You don't care which interfaces your VE's use.&lt;br /&gt;
&lt;br /&gt;
So, no action is required.  Everything just works.  Setup OpenVZ normally.&lt;br /&gt;
&lt;br /&gt;
The only downside is '''ARP flux'''.  This describes the usually harmless condition where the network address (layer 3) drifts between multiple hardware addresses (layer 2).  While this may cause some confusion to anyone trouble shooting, or generate alarms on network monitoring systems, it doesn't interrupt network traffic.&lt;br /&gt;
&lt;br /&gt;
For an example of what this may look like, see the example and tcpdump captures below.&lt;br /&gt;
&lt;br /&gt;
==A More Complex Case==&lt;br /&gt;
Let's say you have three network interfaces on the HN, all with IP addresses on the same subnet.  Each of your VE's also have IP addresses on the same subnet.  But now you ''do'' care which interface your VE's use.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
===Example Network Setup===&lt;br /&gt;
To make this clear we'll use the following HN configuration.  We'll also have another system to act as the client.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! System !! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth4 || 00:0c:29:b3:a2:5e || 192.168.18.12&lt;br /&gt;
|-&lt;br /&gt;
| client || eth0 || 00:0c:29:d2:c7:aa || 192.168.18.129&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===HN ARP Flux===&lt;br /&gt;
The first issue is fixing the '''ARP flux''' noted above.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of the HN addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
====Example One - HN ARP Flux====&lt;br /&gt;
For example, the following is a tcpdump capture from executing &amp;lt;code&amp;gt;ping -c2 192.168.18.10&amp;lt;/code&amp;gt; from the client system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ARP &amp;quot;who has&amp;quot; message generated replies from all three MAC addresses on the HN.  In this case the client took the MAC address for eth4.  The three ICMP messages are then sent to eth4, but all the replies come from eth0.  Normally this behavior isn't a problem, though it may generate some false alarms for a network monitor as it appears someone could be executing a man in the middle attack.&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====A Simple Fix That May Work====&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then this won't achieve the desired results.&lt;br /&gt;
&lt;br /&gt;
====A More Effective Solution====&lt;br /&gt;
The following can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 1&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 2&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Example Two - HN ARP Flux Corrected====&lt;br /&gt;
Now we repeat the ping command, after the arp cache on the client has been cleared.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The desired affect has been achieved.  Only interface eth0 on the HN responds to the ARP message and the other interfaces are silent.&lt;br /&gt;
&lt;br /&gt;
===Adding some VE's===&lt;br /&gt;
Now that the HN is behaving as expected, let's add some VE's and see what happens.&lt;br /&gt;
&lt;br /&gt;
====VE Network Setup====&lt;br /&gt;
The case we're addressing is when the VE's are on the same subnet as the HN.  So we create two new VE's and assign the addresses as follows.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! VEID || IP&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 192.168.18.101&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 192.168.18.102&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Example Three - VE ARP Flux====&lt;br /&gt;
From the client system on you should be able to ping both VE's.  However, looking at the ARP traffic with tcpdump you'll see that once again the network address associated with each VE will be subject to ARP flux, drifting between all three link layer addresses over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====The ARP Cache====&lt;br /&gt;
The reasons for this can be found from executing the following command on the HN to display the ARP cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arp -an&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
? (192.168.18.129) at 00:0C:29:D2:C7:AA [ether] on eth0&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another view is obtained from the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/net/arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP address       HW type     Flags       HW address            Mask     Device&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this shows is that each VE's IP address is associated with each HN's interface.  Therefore each interface will respond to any ARP &amp;quot;who has&amp;quot; query.&lt;br /&gt;
&lt;br /&gt;
====The Cause====&lt;br /&gt;
These entries are created by the vzarp function in the vps_functions script, which are called by vps-net_add, vps-net_del and vps-stop.  The result of this function in our case is to execute the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth3&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the following ARP messages are sent when VEID 101 is started.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.10&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.12&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.11&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here is the result of vzarpipdetect, another function in vps_functions called by vps-net_add.  An ARP &amp;quot;who has&amp;quot; message is sent by each interface and answered by the other interfaces.&lt;br /&gt;
&lt;br /&gt;
What we want is to only add the IP addresses of our VE's to specific devices, not to all devices.  This will prevent the ARP flux problem for our VE's.&lt;br /&gt;
&lt;br /&gt;
====The Quick Fix====&lt;br /&gt;
Unfortunately this involves editing the OpenVZ scripts.  The only case we really care about is vps-net_add, as the others execute &amp;lt;code&amp;gt;ip neigh del proxy&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss changes to scripts.&lt;br /&gt;
&lt;br /&gt;
==Testing Environment==&lt;br /&gt;
All of the examples have been generated and tested using Debian Etch for the HN and Debian Stable for the VE's.  VMware Workstation was used to create the test networks.  The client is the BackTrack live CD from Remote Exploit.  If you have different results from other releases of Linux please edit this page.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[Category:Debian]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2764</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2764"/>
		<updated>2007-02-18T03:32:38Z</updated>

		<summary type="html">&lt;p&gt;Estellt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
This page discusses working with multiple network interfaces on the Hardware Node (HN).&lt;br /&gt;
&lt;br /&gt;
==The Simple Case==&lt;br /&gt;
In the simple case you have multiple network interfaces on the HN, all with IP addresses in the same subnet.  Each of your Virtual Environments (VE's) also have IP addresses in the same subnet.  You don't care which interfaces your VE's use.&lt;br /&gt;
&lt;br /&gt;
So, no action is required.  Everything just works.  Setup OpenVZ normally.&lt;br /&gt;
&lt;br /&gt;
The only downside is '''ARP flux'''.  This describes the usually harmless condition where the network address (layer 3) drifts between multiple hardware addresses (layer 2).  While this may cause some confusion to anyone trouble shooting, or generate alarms on network monitoring systems, it doesn't interrupt network traffic.&lt;br /&gt;
&lt;br /&gt;
For an example of what this may look like, see the example and tcpdump captures below.&lt;br /&gt;
&lt;br /&gt;
==A More Complex Case==&lt;br /&gt;
Let's say you have three network interfaces on the HN, all with IP addresses on the same subnet.  Each of your VE's also have IP addresses on the same subnet.  But now you ''do'' care which interface your VE's use.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
===Example Network Setup===&lt;br /&gt;
To make this clear we'll use the following HN configuration.  We'll also have another system to act as the client.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! System !! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth4 || 00:0c:29:b3:a2:5e || 192.168.18.12&lt;br /&gt;
|-&lt;br /&gt;
| client || eth0 || 00:0c:29:d2:c7:aa || 192.168.18.129&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===HN ARP Flux===&lt;br /&gt;
The first issue is fixing the '''ARP flux''' noted above.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of the HN addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
====Example One - HN ARP Flux====&lt;br /&gt;
For example, the following is a tcpdump capture from executing &amp;lt;code&amp;gt;ping -c2 192.168.18.10&amp;lt;/code&amp;gt; from the client system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ARP &amp;quot;who has&amp;quot; message generated replies from all three MAC addresses on the HN.  In this case the client took the MAC address for eth4.  The three ICMP messages are then sent to eth4, but all the replies come from eth0.  Normally this behavior isn't a problem, though it may generate some false alarms for a network monitor as it appears someone could be executing a man in the middle attack.&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====A Simple Fix That May Work====&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then this won't achieve the desired results.&lt;br /&gt;
&lt;br /&gt;
====A More Effective Solution====&lt;br /&gt;
The following can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 1&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 2&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Example Two - HN ARP Flux Corrected====&lt;br /&gt;
Now we repeat the ping command, after the arp cache on the client has been cleared.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The desired affect has been achieved.  Only interface eth0 on the HN responds to the ARP message and the other interfaces are silent.&lt;br /&gt;
&lt;br /&gt;
===Adding some VE's===&lt;br /&gt;
Now that the HN is behaving as expected, let's add some VE's and see what happens.&lt;br /&gt;
&lt;br /&gt;
====VE Network Setup====&lt;br /&gt;
The case we're addressing is when the VE's are on the same subnet as the HN.  So we create two new VE's and assign the addresses as follows.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! VEID || IP&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 192.168.18.101&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 192.168.18.102&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Example Three - VE ARP Flux====&lt;br /&gt;
From the client system on you should be able to ping both VE's.  However, looking at the ARP traffic with tcpdump you'll see that once again the network address associated with each VE will be subject to ARP flux, drifting between all three link layer addresses over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====The ARP Cache====&lt;br /&gt;
The reasons for this can be found from executing the following command on the HN to display the ARP cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arp -an&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
? (192.168.18.129) at 00:0C:29:D2:C7:AA [ether] on eth0&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another view is obtained from the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/net/arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP address       HW type     Flags       HW address            Mask     Device&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this shows is that each VE's IP address is associated with each HN's interface.  Therefore each interface will respond to any ARP &amp;quot;who has&amp;quot; query.&lt;br /&gt;
&lt;br /&gt;
====The Cause====&lt;br /&gt;
These entries are created by the vzarp function in the vps_functions script, which are called by vps-net_add, vps-net_del and vps-stop.  The result of this function in our case is to execute the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth3&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the following ARP messages are sent when VEID 101 is started.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.10&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.12&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.11&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here is the result of vzarpipdetect, another function in vps_functions called by vps-net_add.  An ARP &amp;quot;who has&amp;quot; message is sent by each interface and answered by the other interfaces.&lt;br /&gt;
&lt;br /&gt;
What we want is to only add the IP addresses of our VE's to specific devices, not to all devices.  This will prevent the ARP flux problem for our VE's.&lt;br /&gt;
&lt;br /&gt;
====The Quick Fix====&lt;br /&gt;
Unfortunately this involves editing the OpenVZ scripts.  The only case we really care about is vps-net_add, as the others execute &amp;lt;code&amp;gt;ip neigh del proxy&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss changes to scripts.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2763</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2763"/>
		<updated>2007-02-18T02:41:05Z</updated>

		<summary type="html">&lt;p&gt;Estellt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This page discusses how to setup a HN with multiple network interfaces on the same physical network and on the same IP network.  Then how to setup multiple VE's to use only one of these interfaces.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
To make this clear we'll use the following HN configuration.  We'll also have another system to act as the client.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! System !! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth4 || 00:0c:29:b3:a2:5e || 192.168.18.12&lt;br /&gt;
|-&lt;br /&gt;
| client || eth0 || 00:0c:29:d2:c7:aa || 192.168.18.129&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== HN ARP Flux ===&lt;br /&gt;
The first issue is ARP flux.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of these addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
For example, the following is a tcpdump capture from executing &amp;lt;pre&amp;gt;ping -c2 192.168.18.10&amp;lt;/pre&amp;gt; from another system on the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ARP &amp;quot;who has&amp;quot; message generated replies from all three MAC addresses on the HN.  In this case the client took the MAC address for eth4.  The three ICMP messages are then sent to eth4, but all the replies com from eth0.  Normally this behavior isn't a problem, though it may generate some false alarms for a network monitor as it appears someone could be executing a man in the middle attack.&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then the following solution will work.  This can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 1&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 2&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we repeat the ping command, after the arp cache has been cleared.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The desired affect has been achieved.  Only interface eth0 on the HN responds to the ARP message and the other interfaces are silent.&lt;br /&gt;
&lt;br /&gt;
=== Adding some VE's ===&lt;br /&gt;
&lt;br /&gt;
Now let's add some VE's to the HN as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! VEID || IP&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 192.168.18.101&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 192.168.18.102&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From another system on the network you should be able to ping both.  However, looking at the ARP traffic with tcpdump you'll see that once again the physical address associated with each VE will be subject to ARP flux, drifting between all three IP addresses over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this can be found from executing the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arp -an&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
? (192.168.18.129) at 00:0C:29:D2:C7:AA [ether] on eth0&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another view is obtained from the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/net/arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP address       HW type     Flags       HW address            Mask     Device&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this shows is that each VE's IP address is associated with each HN's interface.  Therefore each interface will respond to any ARP &amp;quot;who has&amp;quot; query.&lt;br /&gt;
&lt;br /&gt;
These entries are created by the vzarp function in the vps_functions script, which are called by vps-net_add, vps-net_del and vps-stop.  The result of this function in our case is to execute the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.101 dev eth3&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth0&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth4&lt;br /&gt;
/sbin/ip neigh add proxy 192.168.18.102 dev eth3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the following ARP messages are sent when VEID 101 is started.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.10&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.12&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.11&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 (ff:ff:ff:ff:ff:ff) tell 192.168.18.101&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:5e, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:b3:a2:68, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here is the result of vzarpipdetect, another function in vps_functions called by vps-net_add.  An ARP &amp;quot;who has&amp;quot; message is sent by each interface and answered by the other interfaces.&lt;br /&gt;
&lt;br /&gt;
What we want is to only add the IP addresses of our VE's to specific devices, not to all devices.  This will prevent the ARP flux problem for our VE's.&lt;br /&gt;
&lt;br /&gt;
Unfortunately this involves editing the OpenVZ scripts.  The only case we really care about is vps-net_add, as the others execute &amp;lt;code&amp;gt;ip neigh del proxy&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss changes to scripts.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2762</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2762"/>
		<updated>2007-02-17T20:10:06Z</updated>

		<summary type="html">&lt;p&gt;Estellt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This page discusses how to setup a HN with multiple network interfaces on the same physical network and on the same IP network.  Then how to setup multiple VE's to use only one of these interfaces.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
To make this clear we'll use the following HN configuration.  We'll also have another system to act as the client.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! System !! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth4 || 00:0c:29:b3:a2:5e || 192.168.18.12&lt;br /&gt;
|-&lt;br /&gt;
| client || eth0 || 00:0c:29:d2:c7:aa || 192.168.18.129&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== HN ARP Flux ===&lt;br /&gt;
The first issue is ARP flux.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of these addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
For example, the following is a tcpdump capture from executing &amp;lt;pre&amp;gt;ping -c2 192.168.18.10&amp;lt;/pre&amp;gt; from another system on the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ARP &amp;quot;who has&amp;quot; message generated replies from all three MAC addresses on the HN.  In this case the client took the MAC address for eth4.  The three ICMP messages are then sent to eth4, but all the replies com from eth0.  Normally this behavior isn't a problem, though it may generate some false alarms for a network monitor as it appears someone could be executing a man in the middle attack.&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then the following solution will work.  This can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 1&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 1&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we repeat the ping command, after the arp cache has been cleared.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The desired affect has been achieved.  Only interface eth0 on the HN responds to the ARP message and the other interfaces are silent.&lt;br /&gt;
&lt;br /&gt;
=== Adding some VE's ===&lt;br /&gt;
&lt;br /&gt;
Now let's add some VE's to the HN as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! VEID || IP&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 192.168.18.101&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 192.168.18.102&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From another system on the network you should be able to ping both.  However, looking at the ARP traffic with tcpdump you'll see that once again the physical address associated with each VE will be subject to ARP flux, drifting between all three IP addresses over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.101 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.101 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.101: ICMP echo request, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.101 &amp;gt; 192.168.18.129: ICMP echo reply, id 43311, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this can be found from executing the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arp -an&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
? (192.168.18.129) at 00:0C:29:D2:C7:AA [ether] on eth0&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another view is obtained from the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/net/arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP address       HW type     Flags       HW address            Mask     Device&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this shows is that each VE's IP address is associated with each HN's interface.  Therefore each interface will respond to any ARP &amp;quot;who has&amp;quot; query.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss approach of &amp;lt;code&amp;gt;ip rule ...&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ip route ...&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2761</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2761"/>
		<updated>2007-02-17T19:44:50Z</updated>

		<summary type="html">&lt;p&gt;Estellt: Added examples of arpflux.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This page discusses how to setup a HN with multiple network interfaces on the same physical network and on the same IP network.  Then how to setup multiple VE's to use only one of these interfaces.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
To make this clear we'll use the following HN configuration.  We'll also have another system to act as the client.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! System !! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| HN || eth4 || 00:0c:29:b3:a2:5e || 192.168.18.12&lt;br /&gt;
|-&lt;br /&gt;
| client || eth0 || 00:0c:29:d2:c7:aa || 192.168.18.129&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== HN ARP Flux ===&lt;br /&gt;
The first issue is ARP flux.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of these addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
For example, the following is a tcpdump capture from executing &amp;lt;pre&amp;gt;ping -c2 192.168.18.10&amp;lt;/pre&amp;gt; from another system on the network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:5e &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:5e&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:b3:a2:68 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:68&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:5e, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32313, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ARP &amp;quot;who has&amp;quot; message generated replies from all three MAC addresses on the HN.  In this case the client took the MAC address for eth4.  The three ICMP messages are then sent to eth4, but all the replies com from eth0.  Normally this behavior isn't a problem, though it may generate some false alarms for a network monitor as it appears someone could be executing a man in the middle attack.&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then the following solution will work.  This can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following output is from executing this command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sysctl -a | grep net.ipv4.conf.*.arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.conf.venet0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.venet0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.venet0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth4.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth4.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth3.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth3.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.eth0.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.eth0.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.lo.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.lo.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.default.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.default.arp_ignore = 0&lt;br /&gt;
net.ipv4.conf.default.arp_announce = 0&lt;br /&gt;
net.ipv4.conf.default.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
net.ipv4.conf.all.arp_accept = 0&lt;br /&gt;
net.ipv4.conf.all.arp_ignore = 1&lt;br /&gt;
net.ipv4.conf.all.arp_announce = 1&lt;br /&gt;
net.ipv4.conf.all.arp_filter = 0&lt;br /&gt;
net.ipv4.conf.all.proxy_arp = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we repeat the ping command, after the arp cache has been cleared.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; ff:ff:ff:ff:ff:ff, ARP, length 60: arp who-has 192.168.18.10 tell 192.168.18.129&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp reply 192.168.18.10 is-at 00:0c:29:b3:a2:54&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 1, length 64&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, IPv4, length 98: 192.168.18.129 &amp;gt; 192.168.18.10: ICMP echo request, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, IPv4, length 98: 192.168.18.10 &amp;gt; 192.168.18.129: ICMP echo reply, id 32066, seq 2, length 64&lt;br /&gt;
00:0c:29:b3:a2:54 &amp;gt; 00:0c:29:d2:c7:aa, ARP, length 60: arp who-has 192.168.18.129 tell 192.168.18.10&lt;br /&gt;
00:0c:29:d2:c7:aa &amp;gt; 00:0c:29:b3:a2:54, ARP, length 60: arp reply 192.168.18.129 is-at 00:0c:29:d2:c7:aa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The desired affect has been achieved.  Only interface eth0 on the HN responds to the ARP message and the other interfaces are silent.&lt;br /&gt;
&lt;br /&gt;
=== Adding some VE's ===&lt;br /&gt;
&lt;br /&gt;
Now let's add some VE's to the HN as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! VEID || IP&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 192.168.18.101&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 192.168.18.102&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From another system on the network you should be able to ping both.  However, looking at the ARP traffic with tcpdump you'll see that once again the physical address associated with each VE will be subject to ARP flux, drifting between all three IP addresses over time.&lt;br /&gt;
&lt;br /&gt;
The reasons for this can be found from executing the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;arp -an&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
? (192.168.18.129) at 00:0C:29:D2:C7:AA [ether] on eth0&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.102) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth3&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth4&lt;br /&gt;
? (192.168.18.101) at &amp;lt;from_interface&amp;gt; PERM PUB on eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another view is obtained from the following command on the HN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cat /proc/net/arp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP address       HW type     Flags       HW address            Mask     Device&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.102   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth3&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth4&lt;br /&gt;
192.168.18.101   0x1         0xc         00:00:00:00:00:00     *        eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this shows is that each VE's IP address is associated with each HN's interface.  Therefore each interface will respond to any ARP &amp;quot;who has&amp;quot; query.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss approach of &amp;lt;code&amp;gt;ip rule ...&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ip route ...&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2757</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2757"/>
		<updated>2007-02-16T22:19:17Z</updated>

		<summary type="html">&lt;p&gt;Estellt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This page discusses how to setup a HN with multiple network interfaces on the same physical network and on the same IP network.  Then how to setup multiple VE's to use only one of these interfaces.&lt;br /&gt;
&lt;br /&gt;
For example, you want some of your VE's to always use eth3, and some to use eth4. But none of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
To make this clear we'll use the following HN configuration.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=5&lt;br /&gt;
! Interface !! MAC Address !! IP Address&lt;br /&gt;
|-&lt;br /&gt;
| eth0 || 00:0c:29:b3:a2:54 || 192.168.18.10&lt;br /&gt;
|-&lt;br /&gt;
| eth3 || 00:0c:29:b3:a2:68 || 192.168.18.11&lt;br /&gt;
|-&lt;br /&gt;
| eth4 || 00:0c:29:b3:a2:fe || 192.168.18.12&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== HN ARP Flux ===&lt;br /&gt;
The first issue is ARP flux.  Any client on the network broadcasting an ARP &amp;quot;who has&amp;quot; message for any of these addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then the following solution will work.  This can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using another system on the network you should be able to execute the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
arping -c3 192.168.18.10&lt;br /&gt;
arping -c3 192.168.18.11&lt;br /&gt;
apring -c3 192.168.18.12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Each of these should only generate responses from the network interface associated with that IP address on the HN.&lt;br /&gt;
&lt;br /&gt;
=== Adding some VE's ===&lt;br /&gt;
&lt;br /&gt;
Setup two VE's as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VEID = 101  IP = 192.168.18.101&lt;br /&gt;
VEID = 102  IP = 192.168.18.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From another system on the network you should be able to ping both.  However, looking at the ARP traffic with tcpdump or using arping you'll see that once again the physical address associated with each VE will be subject to ARP flux, drifting between all three IP addresses over time.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss approach of &amp;lt;code&amp;gt;ip rule ...&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ip route ...&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
TODO: Add examples of ARP flux before fix is applied, and after.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2756</id>
		<title>Multiple network interfaces and ARP flux</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Multiple_network_interfaces_and_ARP_flux&amp;diff=2756"/>
		<updated>2007-02-16T21:55:11Z</updated>

		<summary type="html">&lt;p&gt;Estellt: New page: This page discusses how to setup a HN with multiple network interfaces on the same physical network and on the same IP network.  For example: &amp;lt;pre&amp;gt; eth0 = 00:0c:29:b3:a2:54 with ip address...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page discusses how to setup a HN with multiple network interfaces on the same physical network and on the same IP network.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
eth0 = 00:0c:29:b3:a2:54 with ip address 192.168.18.10&lt;br /&gt;
eth3 = 00:0c:29:b3:a2:68 with ip address 192.168.18.11&lt;br /&gt;
eth4 = 00:0c:29:b3:a2:fe with ip address 192.168.18.12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first issue is ARP flux.  Any client on the network who broadcasts an ARP &amp;quot;who has&amp;quot; message for any of these addresses will receive replies from all three interfaces.  This results in IP addresses that float between three MAC addresses, depending on which response a client accepts first.&lt;br /&gt;
&lt;br /&gt;
If all three network interfaces are on different IP networks (such as 10.x.x.x, 172.16.x.x, 192.168.x.x) then executing the following will work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sysctl -w net.ipv4.conf.all.arp_filter=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if they are all on the same IP network, which is the case here, then the following solution will work.  This can be added to your /etc/sysctl.conf file once you've tested it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_ignore=1&lt;br /&gt;
sysctl -w net.ipv4.conf.all.arp_announce=2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using another system on the network you should be able to execute the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
arping -c3 192.168.18.10&lt;br /&gt;
arping -c3 192.168.18.11&lt;br /&gt;
apring -c3 192.168.18.12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Each of these should only generate responses from the network interface associated with that IP address on the HN.&lt;br /&gt;
----&lt;br /&gt;
Now, let's say you want some of your VE's to always use eth3, and some to use eth4. None of the VE traffic should use eth0, which is reserved for use by the HN only.  This makes sense if you have VE's that may generate or receive a lot of traffic and you don't want your remote administration of the server over eth0 to degrade or get blocked because of this.&lt;br /&gt;
&lt;br /&gt;
Setup two VE's as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VEID = 101  IP = 192.168.18.101&lt;br /&gt;
VEID = 102  IP = 192.168.18.102&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From another system on the network you should be able to ping both.  However, looking at the ARP traffic with tcpdump or using arping you'll see that once again the physical address associated with each VE will be subject to ARP flux, drifting between all three IP addresses over time.&lt;br /&gt;
&lt;br /&gt;
TODO: Discuss approach of &amp;lt;code&amp;gt;ip rule ...&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ip route ...&amp;lt;/code&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Estellt</name></author>
		
	</entry>
</feed>