[ale] Linux box as a router w/DHCP

Jerry Yu jjj863 at gmail.com
Sat Jan 20 13:18:50 EST 2007


I did this before using RHL 9. Nothing magic on iptables' end. You just need
to update your 'nat' table with the new IP addressed obtained by DHCP. I
wrote a wrapper script to be called from 'ifup.local'.
 It could be an init-style script, with 'stop' to remove all NAT related
rules, while 'start' to add all NAT related rules (detecting the new WAN IP
as James indicated).

On 1/20/07, Bob Kruger <bkruger at mindspring.com> wrote:
>
>
>
>
> James;
>
> Thanks for the reply, but it sees that the link you gave is broken.  Would
> you be good enough to recheck?
>
> V/r
>
> Bob
>
> >James Sumners wrote:
> >
> >> The Frozen Tux tutorial is the best one available in my opinion --
> >> http://iptables-tutorial.frozentux.net/iptables-tutorial.html
> >>
> >> It really isn't difficult, though. Instead if specifying a static
> >> external IP, you just need to supply a variable which contains your
> >> current external IP. I do this in my script like so:
> >>
> >> EXTERNAL_IP=`ifconfig ${EXTERNAL_IFACE} | grep "inet addr" | cut -d \:
> >> -f 2 | cut -d ' ' -f 1`
> >>
> >> Maybe there are better ways of getting the IP, but that works well
> >> enough for me.
> >>
> >> On 1/20/07, Bob Kruger <bkruger at mindspring.com> wrote:
> >>
> >>> All;
> >>>
> >>> I would like to use a Linux box as both a router and as a firewall for
> a small network going out to the internet.  The issue is that the IP address
> to the ISP varies as it is assigned via a DHCP server.  This makes static
> routing commands problematic.
> >>>
> >>> Does anyone know of a good "howto" or tutorial that addresses this and
> would allow for some sort of dynamic routing configuration when the IP
> address assigned by the ISP changes?
> >>>
> >>> Thanks in advance for any assistance.
> >>>
> >>> V/r
> >>>
> >>> Bob
> >>>
> >>>
> >>> _______________________________________________
> >>> Ale mailing list
> >>> Ale at ale.org
> >>> http://www.ale.org/mailman/listinfo/ale
> >>>
> >>
> >>
> >
> >
> >
>
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>
-------------- next part --------------
An HTML attachment was scrubbed...




More information about the Ale mailing list