On Thursday 08 May 2003 11:24 am, Tom Eastep wrote:
[...]
> I think that the part about multicast is misleading and that you should
> stick with just talking about broadcast. The most common situation where
> Leaf users will encounter problems in this regard would be with Windows
> network browsing which is broadcast-based. The solution in that case is to
> configure a Linux box as a WINS server. Other possible problem areas
> include DHCP (run dhcrelay on the firewall) and NTP (configure the ntp
> clients to use particular servers rather than relying on broadcasts).
Alright, I removed the multi-cast instance and added information indicating
possible workarounds to broadcast issues. If there isn't any other errors
that stand out (other than spell-checking), I run it through the spell-checker
and submit it to the LEAF docs.
Thanks,
~Lynn
################# START OF DOC ###########################
PROXY-ARP HOW-TO
by Lynn Avants
TABLE OF CONTENTS
1) PREFACE
1a) WHEN SHOULD I USE PROXY-ARP?
2) EXPLANATION OF PROXY-ARP
3) EXAMPLE
4) EXPLANATION OF EXAMPLE
5) HOW TO SETUP THE FILTERING/FIREWALLING
5a) Dachstein Configuration
5b) Bering/Shorewall Configuration
6) THE ROUTING TABLE
7) FINISHING THINGS UP
8) REFERENCES
9) ACKNOWLEDGEMENTS
1) PREFACE
This How-To is intended for LEAF users that would like to use a service
that is commonly referred to as a "transparent firewalling bridge" or
technically 'Proxy-ARP'. Proxy-ARP is generally used for servers in a
protected subnet (DMZ) that need to use public ip addresses (in addition
to the ip address of the router itself) and also make use of the firewalling
capabilities of the router. It is not mandatory to use Proxy-ARP on a
"DMZ" subnet, it can be used between any number of interfaces. However,
I would suggest against using public addresses on a LAN segment for
work-stations where masquerading/NAT is generally a preferred choice.
1a) WHEN SHOULD I USE PROXY-ARP?
Proxy-ARP is generally used in much the same situations as Static NAT,
but can be preferrable when NAT'ing of a service may cause problems or
when the service itself MUST know/work from the public ip address.
For the uninitiated, Static NAT (or SNAT) is a one-to-one mapping of a
real internet-known ip address to a masqueraded private-class ip address
as used by the actual server itself. Masquerading of ip addresses this
way does not always work well with many applications or services.
Proxy-ARP allows the use of the actual internet-known ip address on the
protected side of the router, so masqerading is not used and all
applications should work as expected. For services such as web, mail,
and dns on a topology that will use 3 or less DMZ (server) addresses,
I would suggest using SNAT instead of Proxy-ARP since the filtering
setup is generally less confusing. Users with a full subnet of ip addresses
to run more servers and/or running services such as active-ftp, game-
servers, or other non-standard services may find Proxy-ARP to be much
easier to setup and run instead. An preferred system to use SNAT on
would be a 2 or 3 ip address connection offered by many ISP's.
The largest apparent difference between 'true' bridging and proxy-arp is
that bridging forwards all broadcast traffic across all interfaces. This
cannot be done by any routing function, such as proxy-arp, and seperate
broadcast domain is created for each interface. Any work-arounds that
work with general routing for broadcast traffic will also work with
proxy-arp such as adding WINS servers, dhrelay, or sometimes simply
adding the ip address of the necessary server in the application
configuration rather than relying on broadcast resolution.
A common use for proxy-arp is to avoid creating a seperate subnet with the
required
routing changes for use between different interfaces (both interfaces will
work on a single subnet). On larger networks you may regularly need to
split the ip addresses up into smaller subnets which commonly leads to
'lost' addresses due to the creation of these smaller subnets with each
subnet using ip addresses for network and broadcast requirements. Use of
proxy-arp can avoid the need to create these smaller subnets and conserve
the available ip addresses in the process. My last reason is that it is
simply easy to setup and can be used in most network topologies (WAN-LAN,
LAN-LAN, WAN-DMZ, etc...).
2) EXPLANATION OF PROXY-ARP
The configuration and use of Proxy-ARP is really quite simple, but is
generally found to be quite confusing because what is actually being
done behind the scenes is not understood. "True" bridging is a OSI layer 2
(link layer, e.g., Ethernet) protocol that makes use of only the
'Address Routing Protocol' (ARP) that only uses MAC address resolution.
Bridging does not look at ip addresses of the connecting machine or make use
of routing tables and ip-filtering, thus making OSI layer 3 (network layer,
e.g.,
IPv4 addresses) filtering impossible. Routing is done on the OSI layer 3
and makes use of routing tables and firewalling by use of ip addresses and
routing tables setup on the machine. Proxy-ARP acts as if it is a
consolidation
of both features of bridging and routing whereas a client machine is bound to
a
designated ip address that is answered by one (or more) of the router's
interfaces,
but is done at OSI layer 3 so that filtering of the traffic on this ip address
can
be done by the router instead of being "blindly" passed through the router.
Proxy-ARP has been an available feature of Linux kernels since the 2.0.x
series
and is technically enabled by the kernel through a set of boolean files on the
/proc filesystem located at '/proc/sys/net/ipv4/conf/<interface>/proxy_arp'.
The boolean toggle (0|1) in this set of files "disables|enables" proxy-arp
by interface. Rather than setting this option by hand editing, proxy-arp is
generally
enabled by the firewall/filtering program on the system. Arp-cache entries can
also be manually set (persistant) by use of the 'arp' utility. Many firewall
applications, such as Shorewall, make use of both 'arp' and the kernel proc
files.
All traffic filtering with proxy-arp must be configured with the
firewall/filtering
application that you are using.
A couple of things you will want to keep in mind is that:
1) Proxy-ARP is not bridging, so DO NOT CONFIGURE BRIDGE OPTIONS!!!
2) Proxy-ARP is a function of routing, so you MUST configure the interfaces
as such.
3) Proxy-ARP ip addresses are not defined on the router with the ip
address/netmask/etc...
other than the necessary settings for the interfaces themselves.
!!!DO NOT CONFIGURE THE INTERFACE(S) WITH THE PROXY-ARP'ed IP
INFORMATION!!!
3) EXAMPLE
Consider this example:
The use of the 24.64.200.16 public subnet is "purely" for example use in this
document. Use the ip addresses/subnet assigned by your ISP instead!!!
Subnet 24.64.200.16/29 (.16-.23)
Reserved Addresses in Subnet:
Network address 24.64.200.16
Broadcast address 24.64.200.23
Default gateway (ISP) 24.64.200.17
Internet
_________ |
/ \ |
/ ISP's \._____
| Default Gateway |
|_.________________/
| 24.64.200.17/29
|
|
|
| 24.64.200.18/29 notice how both
______.___________________________ eth0 and eth2
| eth0 external | share the same
| | ip/netmask.
| LEAF Router |
| |
| eth1 internal eth2 DMZ |
|_.__________________________._____|
| 192.168.1.254/24 | 24.64.200.18/29
| |
| |
_|_ _|_
| | private NAT | | proxy-arp'ed
| S | lan computers | S | dmz computers
| W | | W |
| I |__192.168.1.1/24 | I |___24.64.200.19/29
| T |__192.168.1.2/24 | T |___24.64.200.20/29
| C |__ ... | C |___24.64.200.21/29
| H | | H |___24.64.200.22/29
|___| |___|
4) EXPLANATION OF EXAMPLE
From this example in a typical 3-interface DMZ setup we can see that
we receive 6 ip addresses from our ISP in the 24.64.200.16/29 block.
The 24.64.200.16 ip is the network address (not used by a machine) and
the 24.64.200.23 ip _must_ be used for the broadcast address of the block.
The ISP will use the 24.64.200.17 address for it's router (or default
gateway for the network), so that leaves us with 4 usable ip addresses
for our DMZ servers (24.64.200.19-22). In the example I used the .18 address
proxy-arp'ed on both the external and DMZ interfaces (eth0 and eth2), which
has the effect of 'bridging' these interfaces. The DMZ machines now use
ip addresses out of the rest of the public subnet pool allowed (.19-.22).
5) HOW TO SETUP THE FILTERING/FIREWALLING
Proxy-ARP is set in a status file on the kernel's /proc filesystem for
each interface, but most firewall applications have options to set the
proxy-arp function. As the built-in firewall for Dachstein and
the Bering/Shorewall combination are generally the most commonly used
implementations for LEAF machines, I will cover the necessary configuration
for these environments.
5a) Dachstein Configuration
In Dachstein, you will need to edit the '/etc/network.conf' file.
Under each interface you wish to Proxy-ARP, turn the PROXY_ARP option
to 'YES'.
Considering my previous example:
eth0_PROXY_ARP=YES
eth2_PROXY_ARP=YES
Routing controls which IP's the firewall thinks are connected to which
interface. You can use the eth[X]_ROUTES variable to control this in
Dachstein. Considering the previous example:
eth0_ROUTES="24.64.200.17"
eth2_ROUTES="24.64.200.16/29"
Note that you can have more than one entry for the 'eth[X]_ROUTES'. For
example, if you need to move one of the DMZ machines outside the firewall
for testing, you could do the following, which routes the .19 machine outside
the firewall:
eth0_ROUTES="24.64.200.17 24.64.200.19"
Remember more specific routes take precidence over less specific routes,
so the "host" routes to a single IP override the "default" route to the
entire /29 network.
This will setup proxy-arp, but you still need to setup proper firewall
rules. Dachstein is designed to allow creation of a Proxy-ARP based
"DMZ" network for public server systems via the use of network.conf. A
typical configuration for the above example would look like the following:
DMZ_SWITCH=PROXY
DMZ_IF="eth2"
DMZ_NET=24.64.200.16/29
DMZ_EXT_ADDRS="24.64.200.19 24.64.200.20 24.64.200.21 24.64.200.22"
DMZ_HIGH_TCP_CONNECT=NO
DMZ_OPEN_DEST="tcp_${DMZ_NET}_www
tcp_24.64.200.21_smtp
tcp_24.64.200.21_pop-3
udp_24.64.200.22_domain
tcp_24.64.200.22_domain"
For this example, a web server is running on all DMZ machines, while .21
is also running a mail/pop server, and .22 is also running a domain server.
NOTES:
- 'DMZ_NET' is typicall your full external (public) subnet.
- 'DMZ_EXT_ADDRS' *MUST* be configured with any IP's that are on the
unprotected side of your firewall.
- It is safe to allow a service such as 'www' to the entire network range
(the first entry in DMZ_OPEN_DEST), as non-DMZ IP's (the gateway and firewall
ip addresses in this example, specified by 'DMZ_EXT_ADDRS') are filtered
prior to applying the 'DMZ_OPEN_DEST' accept rules.
- Opening ports to the firewall's IP is done in the conventional manner,
with the 'EXTERN_UDP_PORTS' and 'EXTERN_TCP_PORTS' variables and the
'EXTERN_UDP_PORT[n]' and 'EXTERN_TCP_PORT[n]' walk-lists. You can get more
thorough information on doing this in the LEAF "Port-Forwarding with
Dachstein" FAQ if needed.
http://sourceforge.net/docman/display_doc.php?docid=10418&group_id=13751
Now save the file, backup the 'etc' package via the 'lrcfg' menu, and
reload the networking with the command:
svi network reload
That should finish the necessary configuration for the firewall!
5b) Bering/Shorewall Configuration
Using Bering/Shorewall, you will want to edit _either_ the
'/etc/shorewall/interfaces' -OR-
the '/etc/shorewall/proxyarp' file. Use the 'interfaces' method to proxy-arp
an entire
subnet, or use the 'proxyarp' file to allow single hosts (ip addresses)......
BUT DO NOT USE BOTH!!!
There are more details and explanations located at:
http://www.shorewall.net/ProxyARP.htm
Considering my previous example:
EXAMPLE-1
For a entire subnet use '/etc/shorewall/interfaces':
ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect proxyarp,norfc1918,blacklist
loc eth1 detect
dmz eth2 detect proxyarp
-OR-
EXAMPLE-2
For individual host/ip addresses use '/etc/shorewall/proxyarp':
ADDRESS INTERFACE EXTERNAL HAVEROUTE
24.64.200.19 eth2 eth0 No
24.64.200.20 eth2 eth0 No
24.64.200.21 eth2 eth0 No
24.64.200.22 eth2 eth0 No
Now backup the 'shorewall' package and restart shorewall with the command:
svi shorewall restart
That should finish the necessary configuration for the firewall!
Check the documentation for the necessary information to configure the
filtering of the proxy-arp'ed traffic (http://shorewall.net/).
Other information on using proxy-arp with Shorewall can be found at:
http://www.shorewall.net/shorewall_setup_guide.htm#ProxyARP
http://www.shorewall.net/ProxyARP.htm
6) THE ROUTING TABLE
Verify that your routing table is correct.
This is the routing table of my example:
# ip route show
24.64.200.17 via 24.64.200.18 dev eth0
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.254
24.64.200.16/29 dev eth2 proto kernel scope link src 24.64.200.18
default via 24.64.200.17 dev eth0
7) FINISHING THINGS UP
Now set up your client machines in the DMZ with the desired public ip
addresses
and everything *should* work. The possibility exists that you may need
for the ISP's router to update it's ARP table to acknowledge the DMZ machines.
You may be able to update the arp-cache with use of the 'arping' utility,
or wait for the arp-cache to update itself (which may take an hour or longer).
You may need to check with your ISP if the proxy-arp'ed addresses do not
appear
to be working to verify that the DMZ machines have been cached.
You may now setup any filtering for the proxy-arp'ed machines with your
firewall
application to allow/disallow traffic by ip address if you can access the
proxy-arp'ed
machines via the internet.
8) REFERENCES
http://www.shorewall.net/shorewall_setup_guide.htm#ProxyARP
http://www.shorewall.net/ProxyARP.htm
http://www.ibiblio.org/pub/Linux/docs/HOWTO/mini/other-formats/html_single/Proxy-ARP-Subnet.html
http://www.linux.org/docs/ldp/howto/Adv-Routing-HOWTO/lartc.bridging.html
ftp://metalab.unc.edu/pub/Linux/docs/HOWTO/unmaintained/mini/Proxy-ARP
http://sourceforge.net/docman/display_doc.php?docid=2104&group_id=13751
http://www.linuxguruz.com/iptables/howto/2.4routing-16.html
http://www.die.net/doc/linux/man/man8/arp.8.html
http://www.die.net/doc/linux/man/man8/arping.8.html
9) ACKNOWLEDGEMENTS
My thanks goes to Rick Onanian (c0wz) for his Proxy-ARP HowTo and inspiring
this How-To. His effort and time has definately been put to use over the
years! ;)
Very special thanks goes to Ray Olszewski, Matt Schalit, Charles Steinkuehler,
and Tom Eastep who have made major contributions to the accuracy and
completeness
of this document that would not have existed otherwise.
~Lynn Avants
[EMAIL PROTECTED]
################# END OF DOC ###########################
--
~Lynn Avants
Linux Embedded Appliance Firewall Developer
http://leaf.sourceforge.net
http://guitarlynn.homelinux.org:81
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
leaf-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel