Proxy-ARP-Subnet(1).pdf
(
20 KB
)
Pobierz
ProxyARP Subnetting HOWTO
ProxyARP Subnetting HOWTO
Bob Edwards
Robert.Edwards@anu.edu.au
v2.0, 27 August 2000
This HOWTO discusses using Proxy Address Resolution Protocol (ARP) with subnetting in order to make a
small network of machines visible on another Internet Protocol (IP) subnet (I call it sub−subnetting). This
makes all the machines on the local network (network 0 from now on) appear as if they are connected to the
main network (network 1).
This is only relevent if all machines are connected by Ethernet or ether devices (ie. it won't work for
SLIP/PPP/CSLIP etc.)
ProxyARP Subnetting HOWTO
Table of Contents
1. Acknowledgements
.........................................................................................................................................1
2. Why use Proxy ARP with subnetting?.
.........................................................................................................2
3. How Proxy ARP with subnetting works.
......................................................................................................3
4. Setting up Proxy ARP with subnetting.
........................................................................................................5
5. Other alternatives to Proxy ARP with subnetting.
......................................................................................7
6. Other Applications of Proxy ARP with subnetting
.....................................................................................8
7. Copying conditions.
.........................................................................................................................................9
i
1. Acknowledgements
This document, and my Proxy ARP implementation could not have been made possible without the help of:
·
Andrew Tridgell, who implemented the subnetting options for arp in Linux, and who personally
assisted me in getting it working
·
the Proxy−ARP mini−HOWTO, by Al Longyear
the Multiple−Ethernet mini−HOWTO, by Don Becker
· the
arp
(8) source code and man page by Fred N. van Kempen and Bernd Eckenfels
1. Acknowledgements
1
·
2. Why use Proxy ARP with subnetting?
The applications for using Proxy ARP with subnetting are fairly specific.
In my case, I had a wireless Ethernet card that plugs into an 8−bit ISA slot. I wanted to use this card to
provide connectivity for a number of machines at once. Being an ISA card, I could use it on a Linux machine,
after I had written an appropriate device driver for it − this is the subject of another document. From here, it
was only necessary to add a second Ethernet interface to the Linux machine and then use some mechanism to
join the two networks together.
For the purposes of discussion, let network 0 be the local Ethernet connected to the Linux box via an
NE−2000 clone Ethernet interface on eth0. Network 1 is the main network connected via the wireless
Ethernet card on eth1. Machine A is the Linux box with both interfaces. Machine B is any TCP/IP machine
on network 0 and machine C is likewise on network 1.
Normally, to provide the connectivity, I would have done one of the following:
Used the IP−Bridge software (see the Bridge mini−HOWTO) to bridge the traffic between the two
network interfaces. Unfortunately, the wireless Ethernet interface cannot be put into "Promiscuous"
mode (ie. it can't see all packets on network 1). This is mainly due to the lower bandwidth of the
wireless Ethernet (2MBit/sec) meaning that we don't want to carry any traffic not specifically
destined to another wireless Ethernet machine − in our case machine A − or broadcasts. Also,
bridging is rather CPU intensive!
· Alternatively, use subnets and an IP−router to pass packets between the two networks (see the
IP−Subnetworking mini−HOWTO). This is a protocol specific solution, where the Linux kernel can
handle the Internet Protocol (IP) packets, but other protocols (such as AppleTalk) need extra software
to route. This also requires the allocation of a new IP subnet (network) number, which is not always
an option.
In my case, getting a new subnet (network) number was not an option, so I wanted a solution that allowed all
the machines on network 0 to appear as if they were on network 1. This is where Proxy ARP comes in. Other
solutions are used to connect other (non−IP) protocols, such as netatalk to provide AppleTalk routing.
2. Why use Proxy ARP with subnetting?
2
·
3. How Proxy ARP with subnetting works
The Proxy ARP is actually only used to get packets from network 1 to network 0. To get packets back the
other way, the normal IP routing functionality is employed.
In my case, network 1 has an 8−bit subnet mask (255.255.255.0). I have chosen the subnet mask for network
0 to be 4−bit (255.255.255.240), allowing 14 IP nodes on network 0 (2 ^ 4 = 16, less two for the all zeros and
all ones cases). Note that any size of subnet mask up to, but not including, the size of the mask of the other
network is allowable here (eg. 2, 3, 4, 5, 6 or 7 bits in this case − for one bit, just use normal Proxy ARP!)
All the IP numbers for network 0 (16 in total) appear in network 1 as a subset. Note that it is very important,
in this case, not to allow any machine connected directly to network 1 to have an IP number in this range! In
my case, I have "reserved" the IP numbers of network 1 ending in 64 .. 79 for network 0. In this case, the IP
numbers ending in 64 and 79 can't actually be used by nodes − 79 is the broadcast address for network 0.
Machine A is allocated two IP numbers, one within the network 0 range for it's real Ethernet interface (eth0)
and the other within the network 1 range, but outside of the network 0 range, for the wireless Ethernet
interface (eth1).
Say machine C (on network 1) wants to send a packet to machine B (on network 0). Because the IP number
of machine B makes it look to machine C as though it is on the same physical network, machine C will use
the Address Resolution Protocol (ARP) to send a broadcast message on network 1 requesting the machine
with the IP number of machine B to respond with it's hardware (Ethernet or MAC layer) address. Machine B
won't see this request, as it isn't actually on network 1, but machine A, on both networks, will see it.
The first bit of magic now happens as the Linux kernel arp code on machine A, with a properly configured
Proxy ARP with subnetting entry, determines that the ARP request has come in on the network 1 interface
(eth1) and that the IP number being ARP'd for is in the subnet range for network 0. Machine A then sends it's
own hardware (Ethernet) address back to machine C as an ARP response packet.
Machine C then updates it's ARP cache with an entry for machine B, but with the hardware (Ethernet)
address of machine A (in this case, the wireless Ethernet interface). Machine C can now send the packet for
machine B to this hardware (Ethernet) address, and machine A receives it.
Machine A notices that the destination IP number in the packet is that of machine B, not itself. Machine A's
Linux kernel IP routing code attempts to forward the packet to machine B by looking at it's routing tables to
determine which interface contains the network number for machine B. However, the IP number for machine
B is valid for both the network 0 interface (eth0), and for the network 1 interface (eth1).
At this point, something else clever happens. Because the subnet mask for the network 0 interface has more 1
bits (it is more specific) than the subnet mask for the network 1 interface, the Linux kernel routing code will
match the IP number for machine B to the network 0 interface, and not keep looking for the potential match
with the network 1 interface (the one the packet came in on).
Now machine A needs to find out the "real" hardware (Ethernet) address for machine B (assuming that it
doesn't already have it in the ARP cache). Machine A uses an ARP request, but this time the Linux kernel arp
code notes that the request isn't coming from the network 1 interface (eth1), and so doesn't respond with the
Proxy address of eth1. Instead, it sends the ARP request on the network 0 interface (eth0), where machine B
will see it and respond with it's own (real) hardware (Ethernet) address. Now machine A can send the packet
(from machine C) onto machine B.
3. How Proxy ARP with subnetting works
3
Plik z chomika:
megaskrypty
Inne pliki z tego folderu:
3-Button-Mouse(1).pdf
(58 KB)
XWindow-Overview-HOWTO(1).pdf
(30 KB)
Xterm-Title(1).pdf
(39 KB)
Xterminals(1).pdf
(30 KB)
Xinerama-HOWTO(1).pdf
(33 KB)
Inne foldery tego chomika:
Programowanie
Zgłoś jeśli
naruszono regulamin