netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: "Thompson, Ian" <Ian_Thompson@adaptec.com>
Cc: "'netdev@oss.sgi.com'" <netdev@oss.sgi.com>
Subject: Re: ARP problem?
Date: Wed, 16 Oct 2002 16:56:35 -0700	[thread overview]
Message-ID: <3DADFCB3.6010206@candelatech.com> (raw)
In-Reply-To: E156A23F1885D4119ED800B0D0498A9F02128B96@aimexc07.adaptec.com

Thompson, Ian wrote:
>>You need arp-filtering:
>>
>>     # Set up arp-filter magic.  This, with source-based 
>>routing allows us
>>     # to have multiple NICs on the same subnet, on the same 
>>machine, connected
>>     # to the same switch...
>>     if [ -f  /proc/sys/net/ipv4/conf/all/arp_filter ];
>>     then
>>	echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
>>     else
>>	echo "ERROR: kernel does not support arp_filter.  Don't 
>>put more than"
>>	echo "       one interface on the same subnet on the 
>>same machine."
>>	echo ""
>>     fi
>>
> 
> 
> I tried this, and now I'm getting only one ARP response.  However, I get the
> same MAC address for ARP broadcasts for either IP address.  Does ARP
> filtering turn off all but the first interface when processing ARP packets?
> Can I get each interface to answer ARP packets only for its specific IP
> address?

Try setting up source-based routing.  Here is a snippet of perl code that
does that, but it will be difficult for you to decipher out of context:

e_if is a list of interfaces (ie eth2)
e_ip is the IP for this interface
sigb is the significant bits, ie the 24 in 192.168.2.0/24
e_tbl is the table name, you need a table for each interface.


       print "# Setup for device: $e_if[$i]  IP:  $e_ip[$i]  sig-bits: $e_sigb[$i]\n";
       printAndExec("ip link set $e_if[$i] down");
       printAndExec("ip link set $e_if[$i] up");
       printAndExec("ip addr flush dev $e_if[$i]");
       if ($e_ip[$i] ne "0.0.0.0") {
	printAndExec("ip address add $e_ip[$i]/$e_sigb[$i] broadcast $e_bcast[$i] dev $e_if[$i]");
       }
       printAndExec("ip link set dev $e_if[$i] up");
       if ($e_ip[$i] ne "0.0.0.0") {
	printAndExec("ip ru add from $e_ip[$i]/32 table $e_tbl[$i]");
	printAndExec("ip route add $e_sub[$i]/$e_sigb[$i] via $e_ip[$i] table $e_tbl[$i]");
       }
       if ($e_gw[$i] ne "0.0.0.0") {
	printAndExec("ip route add 0/0 via $e_gw[$i] dev $e_if[$i] table $e_tbl[$i]");
       }

You can use this to give you ideas of what to look for as you read one of the
advanced-routing HOWTOs.  With source-based routing and arp-filtering, I have
gotten many interfaces on the same subnet to work as you would expect, so it
can be done :)

Ben


> 
> Thanks,
> -ian
> 


-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear

  reply	other threads:[~2002-10-16 23:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-16 23:17 ARP problem? Thompson, Ian
2002-10-16 23:56 ` Ben Greear [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-16 22:54 Thompson, Ian
2002-10-16 23:06 ` Ben Greear
2002-10-17  9:24 ` Julian Anastasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DADFCB3.6010206@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=Ian_Thompson@adaptec.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).