Re: routing help on dual homed box
On Sun, Jan 06, 2002 at 09:22:49AM -0800, Serge Rey wrote:
| now i'm trying to figure out the best way to automate this. i think my
| problems the last few days were in the sequencing of configuring the
| following mix of things
|
| eth1 - lan
| eth0 - dhcp
| firewall script
|
| the latter runs some masqing of the lan and has to run immediately after
| eth0 is assigned an ip (so that the external connection is configured
| correctly in the fw).
|
| any suggestions of how to do this the proper (i.e., debian) way within
| the context of the bootup scripts?
-------------------
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# LAN
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
# WAN (ADSL)
auto eth1
iface eth1 inet dhcp
-------------------
This will setup the interfaces correctly (well, for my network, as per
above you want to switch eth0 and eth1).
I wrote /etc/init.d/FIREWALL, a shell script I wrote to configure
iptables. Then I added a symlink to it
$ ls -l /etc/rc2.d
lrwxrwxrwx 1 root root 20 Aug 19 16:59 S13FIREWALL -> /etc/init.d/FIREWALL
The iptables rules use 'eth1' to refer to the external interface, not
a hard-coded IP since it can't be known ahead of time.
-D
--
Whoever gives heed to instruction prospers,
and blessed is he who trusts in the Lord.
Proverbs 16:20
Reply to: