From: Rudi Starcevic <tech@wildcash.com>
To: netfilter@lists.netfilter.org
Subject: Re: dumb question...route from local eth1 to eth2 and vice versa
Date: Thu, 01 Dec 2005 17:08:01 +1000 [thread overview]
Message-ID: <438EA151.1040206@wildcash.com> (raw)
In-Reply-To: <438EA0BD.3070804@wildcash.com>
[-- Attachment #1: Type: text/plain, Size: 125 bytes --]
Hi,
Oh man .. it's just too late in my day ....
Let me try one more time to attach these 2 scripts ..
Doh .. sorry .....
[-- Attachment #2: ip_b_firewall_1._b.sh --]
[-- Type: text/plain, Size: 1088 bytes --]
#!/bin/bash
echo "Firewall Setup Start"
################################################################################
echo -n "Firewall: sysctl "
# Enable forwarding
echo "Enable Kernel Forwarding"
echo 1 > /proc/sys/net/ipv4/ip_forward
################################################################################
echo -n "reset "
for table in filter nat mangle ; do
iptables --table $table --flush
iptables --table $table --delete-chain
done
modprobe ip_nat_ftp
################################################################################
echo -n "FORWARD "
iptables -A FORWARD -i eth0 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
################################################################################
echo -n "OUTPUT "
# allows unrestricted output from this machine
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -o eth0 -j ACCEPT
iptables -A OUTPUT -o eth1 -j ACCEPT
################################################################################
echo done.
[-- Attachment #3: ip_a_route_1.sh --]
[-- Type: text/plain, Size: 982 bytes --]
#!/bin/sh
echo "Network Setup Start"
echo "Flushing NICs"
ip addr flush eth0
ip addr flush eth1
ip link set eth0 down
ip link set eth1 down
ip link set eth0 up
ip link set eth1 up
echo "Routing Tables:"
cat /etc/iproute2/rt_tables
### example file ###
## reserved values
##
#255 local
#254 main
#253 default
#0 unspec
##
## local
##
##1 inr.ruhep
#200 implan
#201 inet
### example end ###
echo "Setup NIC 0"
ip addr add 192.168.3.10/24 dev eth0 brd +
echo "Setup NIC 1"
ip addr add 192.168.1.1/24 dev eth1 brd +
ip addr list
ip route list
echo "Setup Default Route [ inet table ]"
ip route add default via 192.168.1.254 proto static table inet
echo "Setup LAN Route [ implan table ]"
ip route add 192.168.3/24 via 192.168.3.10 proto static table implan
ip route list
echo "Setup LAN ip rule"
ip rule add to 192.168.3/24 prio 16000 table implan
echo "Setup Internet ip rule"
ip rule add to 0/0 prio 17000 table inet
echo "Flushing ip route cache"
ip route flush cache
next prev parent reply other threads:[~2005-12-01 7:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-01 2:43 dumb question...route from local eth1 to eth2 and vice versa Joel F
2005-12-01 3:13 ` Jesse Gordon
2005-12-01 3:22 ` Thomas Kuiper
2005-12-01 3:36 ` Jesse Gordon
2005-12-01 6:44 ` Rob Sterenborg
2005-12-01 6:59 ` Rudi Starcevic
2005-12-01 8:49 ` Rob Sterenborg
2005-12-01 7:05 ` Rudi Starcevic
2005-12-01 7:08 ` Rudi Starcevic [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-12-01 10:18 Rudi Starcevic
2005-12-01 21:04 ` Anthony Sadler
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=438EA151.1040206@wildcash.com \
--to=tech@wildcash.com \
--cc=netfilter@lists.netfilter.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.