[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] Optus Cable & Linux Masquerading



On Fri,  8 Jun 2001 17:31, David Gonzalez wrote:
 ] Has anyone been successful in setting up Optus Cable on a Linux box?
 ] 
 ] If so, how is this done?
 ] 
 ] As usual any pointers would be much appreciated.

 There are a couple of O@nospam.H web pages around .. google is, as always,
 a good place to start looking for them.  There's also a good mailing list
 at yahoo / eGroups -- try sending an email to :

 athome-linux-subscribe@nospam.eGroups.com

 All you need to do is set up masq'ing, as per normal, from the eth0
 device for the eth1 network (eth0 external, eth1 internal in the following).
 You can get carried away with setting up DHCP (I use debian's dhcpd
 package, as I had no luck with pump), but O@nospam.H rarely changes your
 IP address (mine lasted for 8 months before I got disconnected, and
 ended up with a new one).

 Something like this, followed by all your ipchains firewall commands
 (try to deny everything that is not explicitly allowed)

 #!/bin/sh
# Linux Firewall Script
#
# Jedd, Jun2000

# Interface (Ethernet) devices device :
EXTERNAL=`ifconfig eth0 | grep inet | awk  -F : '{print $2}' | awk '{print $1}'`
IETH="192.168.0.1"
LOCAL="192.168.0.0/24"
REMOTE="203.164.50.0/24"

DHCPSERVER="203.164.2.52"
FTOOMSH="138.25.6.1"
NTPSERVER1="203.21.84.4"
NTPSERVER2="129.127.40.3"

OPTUSMAIL="203.164.2.55"
FTOOMSHMAIL="138.25.6.1"

IPCHAINS="/sbin/ipchains"
PATH=/sbin:$PATH

######################################
#     START OF FIREWALL COMMANDS     #
######################################

echo "Flushing INPUT chain.."
$IPCHAINS -F input
echo "Flushing OUTPUT chain.."
$IPCHAINS -F output
echo "Flushing FORWARD chain.."

$IPCHAINS -F forward
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "IP Forward active."

echo "Allowing INTERNAL traffic."
$IPCHAINS -A input -s $LOCAL -d $LOCAL -j ACCEPT
$IPCHAINS -A output -s $LOCAL -d $LOCAL -j ACCEPT
echo "Setting up LOOPBACK interface 'lo'."
$IPCHAINS -A input -i lo -s 0/0 -d 0/0 -j ACCEPT
$IPCHAINS -A output -i lo -s 0/0 -d 0/0 -j ACCEPT
echo -n "Setting up Masquerading..."
$IPCHAINS -A forward -s $LOCAL -d $LOCAL -j ACCEPT
echo -n "..NO INTERNAL.."
$IPCHAINS -A forward -s $REMOTE -d 0/0 -j ACCEPT
echo -n "..NO EXTERNAL.."
$IPCHAINS -A forward -s $LOCAL -d 0/0 -j MASQ
echo -n "..INTERNAL - EXTERNAL.."
echo "..Done."






-- 
 jedd == jedd at progsoc dot org
 "The unemployment queue is no longer just for philosophy
 majors - useful people are now being affected too."
			  -- Kent Brockman, The Simpsons.
-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.