---- Original Message -----
From: "Paul Gear" <paulgear@yahoo.com>> Have you guys heard of perl? :-)
>
> Try this:
> perl -e ''for ($i = 1; $i < 255; ++$i) { printf
> "1.2.3.%-4s\t\teth1\t\teth0\t\tNo\n", $i; }'' >>
/etc/shorewall/proxyarp
<grin>
OK, Paul....you tweaked me just right --- I tried your
slick-but-impossible-to-memorize code, and was impressed that it could
configure an entire subnet before I had released the Enter key... Beats the
heck out of my original approach.
I scrounged and blundered until I put together a variation on your theme. I
even set it up to bark if all parameters are not specified, and to include
the default header and footer comments. This is the first "real" Perl
script I have ever marginally succeeded with, so caveat emptor :)
The script is at www.optimumnetworks.com/PAconfig, for anyone interested.
The comments are below. Thanks for the inspiration!
Dan
====================================================================# PAconfig
generates a ''proxyarp'' file for use with Shorewall, saving
time
over
# manually typing in IP address information. The script generates all
necessary
# entries, based upon command line arguments. It will create entries for
# contiguous blocks of IP addresses, based upon the start and stop values
# provided.
#
# PAconfig takes 7 arguments at the command line in the following order:
#
# 24Bit_Network_Address
# The first three octets of the network, with no dot on the end.
#
# Start_Host_Address
# First address to configure
#
# Stop_Host_Address
# Last address to configure
#
# INTERFACE
# As defined in Shorewall doc
#
# EXTERNAL
# As defined in Shorewall doc
#
# HAVEROUTE
# As defined in Shorewall doc
#
# Output_File_Name
# If you want it to create the proxyarp file, overwriting existing, use:
# /etc/shorewall/proxyarp
#
# EXAMPLE
#
# Configure 209.95.33.0/25, allowing .1 for router, .2 for Shorewall
external
# address. Configure remaining addresses through .121. Assumes eth0 as
# external interface, with Shorewall creating host routes for all protected
# addresses automatically, then saving the file with default name and
location:
#
# [root@myfw]# ./PAconfig 209.95.33 3 121 eth1 eth0 Yes
/etc/shorewall/proxyarp