Setting up a network and sharing internet

Chris Friedt Chfriedt-0jnyayh6ARPqzrOJbVgLALDks+cytr/Z at public.gmane.org
Thu Aug 18 21:38:02 UTC 2005


I'm fairly sure that iptables-restore will restore your ruleset, however
for many people on a connection with a varying ip address, you would
need something dynamically at lease-time (or boot time, whichever) to
figure out what the ip address is that you've been assigned.

this would do the trick:
---------------------------------------------------------------
#!/bin/bash

# you may change eth0 to whatever, although I've never tried w/ a
dial-up/ppp only minor changes in any event
IFC=/sbin/ifconfig
AWK=/bin/awk
EXTIF=eth0
...
EXTIP="`get_ip $EXTIF`"
...
function get_ip() {
    IF=$1
    $IFC $IF | $AWK /$IF/'{next}//{split($0,a,":");split(a[2],a,"
");print a[1];
exit}';
}
-------------------------------------------------------------

~/Chris

> 4. Currently I am using Firestarter on BOX#1. Would it be better to
> use an iptables scipt? If so, does anyone have an iptables file that
I
> can use for this purpose? Also, how do I enable iptables at boot
time
> (instead of using "iptables-restore <file>")?

I thought 'iptables-restore' does exactly that.


--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list