From: "Largo Hellenz" <lamp@nyc.rr.com>
To: lartc@vger.kernel.org
Subject: [LARTC] 2 gateways out
Date: Sat, 22 Sep 2001 21:45:50 +0000 [thread overview]
Message-ID: <marc-lartc-100119531523323@msgid-missing> (raw)
hi,
first, i'd like to say im so happy this list is finally back up!!!!
my situation is that i have two cable modems connected to two different
2.4.2 boxes.
box A (eth0 x.x.x.x, eth1 10.1.1.1/24)
box B (eth0 x.x.x.x, eth2 10.2.2.1/24)
those two connect to a central 2.4.2 machine with 5 nics.
box C (eth0 10.0.0.1/24, eth1 10.1.1.2/24, eth2 10.2.2.2/24, eth3
10.3.3.1/24, eth4 10.4.4.1/24)
10.0.0.0/24 is cisco management subnet
10.1.1.0/24 is only for the box A - box C connection
10.2.2.0/24 is only for the box B - box C connection
10.3.3.0/24 is public MS lan
10.4.4.0/24 is my private lan for my linux servers and personal machines
i masquerade 10.3.3.0/24 and 10.4.4.0/24 at box C, 10.1.1.0/24 at box A,
and 10.2.2.0/24 at box B.
box C will send any outgoing masquerades based upon its default gateway.
the cable modems both fail serveral hours a week.
when when goes down, i manually switch box C to the other gateway.
when they are both up, only one is used.
obviously, you can see the problem.
the most important thing is to load balence between the two cable modems
and route all traffic out the right way if one of the cable modems goes
down.
if possible, possibly even send some packets out one way and some out
aNother (based on payload content and packet tagging?) but this is for my
next lesson :)
here are my configs:
(please feel free to point out any errors or possible enhancements to these
configs, since i am just starting out with iptables -- and linux routing in
general --- ...any suggestions would be appreciated, thanX)
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------
BOX C:
[root@io /root]# cat masquerade
#!/bin/sh
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -F
/sbin/iptables -P INPUT DROP
/sbin/iptables -A INPUT -p tcp --dport 22 -i eth+ -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 53 -i eth3 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 53 -i eth4 -j ACCEPT
/sbin/iptables -A INPUT -i eth+ -m state --state ESTABLISHED,RELATED -j
ACCEPT
/sbin/iptables -A INPUT -i eth+ -p icmp -j ACCEPT
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A INPUT -i eth+ -m state --state NEW,INVALID -j
LOG --log-level debug --log-prefix "FIREWALL: Input: "
/sbin/iptables -P FORWARD DROP
/sbin/iptables -A FORWARD -o eth0 -j ACCEPT
/sbin/iptables -A FORWARD -o eth1 -j ACCEPT
/sbin/iptables -A FORWARD -o eth2 -j ACCEPT
/sbin/iptables -A FORWARD -i eth3 -j ACCEPT
/sbin/iptables -A FORWARD -i eth4 -j ACCEPT
/sbin/iptables -A FORWARD -i eth+ -m state --state ESTABLISHED,RELATED -j
ACCEPT
/sbin/iptables -A FORWARD -o eth+ -j LOG --log-level debug --log-prefix
"FIREWALL: Forward-Out: "
/sbin/iptables -A FORWARD -i eth+ -j LOG --log-level debug --log-prefix
"FIREWALL: Forward-In: "
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
----------------------------------------------------------------------------
-----------------------------------------------------------------
BOX A & B:
[root@matador /root]# cat masquerade
#!/bin/sh
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -F
/sbin/iptables -P INPUT DROP
/sbin/iptables -A INPUT -p tcp --dport 22 -i eth+ -j ACCEPT
/sbin/iptables -A INPUT -i eth+ -m state --state ESTABLISHED,RELATED -j
ACCEPT
/sbin/iptables -A INPUT -i eth1 -p icmp -j ACCEPT
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -j LOG --log-level debug --log-prefix
"FIREWALL: Input: "
/sbin/iptables -P FORWARD DROP
/sbin/iptables -A FORWARD -o eth0 -j ACCEPT
/sbin/iptables -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j
ACCEPT
/sbin/iptables -A FORWARD -i eth1 -j ACCEPT
/sbin/iptables -A FORWARD -i eth0 -j LOG --log-level debug --log-prefix
"FIREWALL: For-In: Spoof: "
/sbin/iptables -A FORWARD -o eth1 -j LOG --log-level debug --log-prefix
"FIREWALL: For-Out: Spoof: "
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
----------------------------------------------------------------------------
--------------------------------------------------------------------------
thanks,
Fernando Pando
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
next reply other threads:[~2001-09-22 21:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-22 21:45 Largo Hellenz [this message]
2001-09-23 14:59 ` [LARTC] 2 gateways out bert hubert
2001-09-23 19:04 ` Largo Hellenz
2001-09-23 20:00 ` bert hubert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-lartc-100119531523323@msgid-missing \
--to=lamp@nyc.rr.com \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.