Re: Tie UDP reply to incoming interface



On Sep 16, 4:23 am, pk <p...@xxxxxxxxxx> wrote:

It's not clear that you are fully aware, because you seem to be
confusing the ARP issue (which only occurs with two interfaces in the
same subnet) with the end system model issue issue here (which has
nothing to do with ARP).

Of course. Where did I say otherwise? My claim was that an upstream router
will never ARP for the IP address assigned to the ethernet interface that
connects to the other provider.

Right, but that has nothing to do with the issue. This issue has
nothing to do with ARP.

ISP A ROUTER              ISP B ROUTER
     |                      |
     |                      /
     \                     /
      eth1               eth2
       linux firewall/router

What I was saying is that eth1 will never get an ARP request for eth2's IP
address, and viceversa. Of course when ISP A router has a packet for some
destination behind the linux firewall, it will arp for eth1's IP address,
and so will ISP B router for eth2, which is what you said.

Right, so even though each ISP will only ARP for the IP address facing
it, it does not follow that eth1 will never receive a packet whose
destination is assigned to eth2. The reason that will never happen is
that the ISP routers simply don't know enough to do that.

Consider:

ISP A core <-> ISP A access <-> eth1 <-> you <-> eth2 <-> ISP B access
<-> ISP B core

Suppose, ISP B buys ISP A and suddenly these two routers start talking
to each other. The ISP A core router may learn that its ISP A access
router is the best route to your eth2 address. In that case, the ISP A
access router will receive packets with the destination of your eth2
address and they will arrive on eth1.

Of course, this is very unlikely to happen. But nothing about your
topology compels it -- it's just that the two routers don't exchange
information on that level. If isn't your setup that compels it, but
your ISP's.

In this case, however, you do need to deal with the fact that your
ISPs are probably going to drop packets with the other ISP's source
address thinking it's spoofed even though it's not. In that case, you
need to filter packets based on the *origin* *IP* *address*.

Note that doing it based on the receive interface won't work --
because there's no way to unambiguously map an outbound packet to the
inbound packet that "caused" it.

It can be done with commands like:

/sbin/ip route add table 4 default via <ISP_B_default_route_IP>
/sbin/ip rule add fwmark 4 table 4

And in the 'mangle' table:
-A OUTPUT -s <ISP_B_IP> ! -d <local_IPs> -j MARK --set-mark 4

You can eliminate the '! -d <local_IPs>' if you add routes for local
IPs to the extra table.

DS
.



Relevant Pages

  • Re: Tie UDP reply to incoming interface
    ... What I was saying is that eth1 will never get an ARP request for eth2's ... address, and so will ISP B router for eth2, which is what you said. ...
    (comp.os.linux.networking)
  • Re: Pure IP & ARP broadcasts
    ... It actually communicates via the MAC address of the Nics (aka Layer2 ... what the ARP request does. ... A host has a packet to send, it has the IP# and nothing else. ... But if the owner of the IP# is not on that segment then the Router replies ...
    (microsoft.public.windows.server.networking)
  • Re: AD authentication - min packet size
    ... reset ISP router Cisco 1800, authentication is again ok. ... I don't think that there's a min/max packet size really as it all depends on multiple things. ... If you say 1500 bytes is the magic number, get a tool that can generate a large number of packages this size and try to force the router to choke. ...
    (microsoft.public.windows.server.active_directory)
  • RE: Nimda et.al. versus ISP responsibility
    ... It is not true that a properly formed packet is necessarily ... If my router sends a packet to my ISP with a source ... filtering if a customer is willing to pay for it; ...
    (Incidents)
  • Re: NAT to a broadcast addess using iptables?
    ... The problem with sending unicast packets to a sleeping host is ARP ... If your router supports the 'arp' or 'ip' commands, ... the magic packet can be sent to either the mac address of the ... I didn't think that ARP resolution is a problem. ...
    (comp.os.linux.networking)