2004-02-14 19:06:39 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
|
|
|
<article>
|
|
|
|
<!--$Id$-->
|
|
|
|
|
|
|
|
<articleinfo>
|
|
|
|
<title>About My Network</title>
|
|
|
|
|
|
|
|
<authorgroup>
|
|
|
|
<author>
|
|
|
|
<firstname>Tom</firstname>
|
|
|
|
|
|
|
|
<surname>Eastep</surname>
|
|
|
|
</author>
|
|
|
|
</authorgroup>
|
|
|
|
|
2004-09-07 18:09:11 +02:00
|
|
|
<pubdate>2004-09-06</pubdate>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<copyright>
|
|
|
|
<year>2001-2004</year>
|
|
|
|
|
|
|
|
<holder>Thomas M. Eastep</holder>
|
|
|
|
</copyright>
|
|
|
|
|
|
|
|
<legalnotice>
|
|
|
|
<para>Permission is granted to copy, distribute and/or modify this
|
|
|
|
document under the terms of the GNU Free Documentation License, Version
|
|
|
|
1.2 or any later version published by the Free Software Foundation; with
|
|
|
|
no Invariant Sections, with no Front-Cover, and with no Back-Cover
|
|
|
|
Texts. A copy of the license is included in the section entitled
|
2004-08-07 04:13:32 +02:00
|
|
|
<quote><ulink url="GnuCopyright.htm">GNU Free Documentation
|
|
|
|
License</ulink></quote>.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
</legalnotice>
|
|
|
|
</articleinfo>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>My Current Network</title>
|
|
|
|
|
|
|
|
<caution>
|
|
|
|
<para>I use a combination of One-to-one NAT and Proxy ARP, neither of
|
|
|
|
which are relevant to a simple configuration with a single public IP
|
|
|
|
address. If you have just a single public IP address, most of what you
|
2004-08-07 04:13:32 +02:00
|
|
|
see here won't apply to your setup so beware of copying parts of this
|
|
|
|
configuration and expecting them to work for you. What you copy may or
|
|
|
|
may not work for you.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
</caution>
|
|
|
|
|
|
|
|
<caution>
|
|
|
|
<para>The configuration shown here corresponds to Shorewall version
|
2004-09-04 22:07:48 +02:00
|
|
|
2.1.7. My configuration uses features not available in earlier Shorewall
|
2004-05-09 00:31:54 +02:00
|
|
|
releases.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
</caution>
|
|
|
|
|
|
|
|
<para>I have DSL service and have 5 static IP addresses
|
2004-07-15 00:06:35 +02:00
|
|
|
(206.124.146.176-180). My DSL <quote>modem</quote> (Westell 2200) is
|
2004-09-07 18:09:11 +02:00
|
|
|
connected to eth0 and has IP address 192.168.1.1 (factory default). The
|
|
|
|
modem is configured in <quote>bridge</quote> mode so PPPoE is not
|
|
|
|
involved. I have a local network connected to eth2 (subnet 192.168.1.0/24)
|
|
|
|
and a DMZ connected to eth1 (206.124.146.176/32). Note that I configure
|
|
|
|
the same IP address on both <filename class="devicefile">eth0</filename>
|
|
|
|
and <filename class="devicefile">eth1</filename>.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
2004-03-17 16:03:46 +01:00
|
|
|
<para>In this configuration:</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2004-09-04 22:07:48 +02:00
|
|
|
<para>I use one-to-one NAT for Ursa (my personal system that run SuSE
|
|
|
|
9.1) - Internal address 192.168.1.5 and external address
|
|
|
|
206.124.146.178.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
2004-03-17 16:03:46 +01:00
|
|
|
<para>I use one-to-one NAT for EastepLaptop (My work system -- Windows
|
2004-07-06 20:18:08 +02:00
|
|
|
XP SP1). Internal address 192.168.1.7 and external address
|
2004-02-14 19:06:39 +01:00
|
|
|
206.124.146.180.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
2004-09-04 22:07:48 +02:00
|
|
|
<para>I use SNAT through 206.124.146.179 for my Wife's Windows XP
|
|
|
|
system <quote>Tarry</quote>, and our dual-booting (Windows
|
|
|
|
XP/SuSE 9.1) laptop <quote>Tipper</quote> which connects through the
|
|
|
|
Wireless Access Point (wap) via a Wireless Bridge (wet).<note>
|
2004-08-07 04:13:32 +02:00
|
|
|
<para>While the distance between the WAP and where I usually use
|
|
|
|
the laptop isn't very far (25 feet or so), using a WAC11 (CardBus
|
|
|
|
wireless card) has proved very unsatisfactory (lots of lost
|
|
|
|
connections). By replacing the WAC11 with the WET11 wireless
|
|
|
|
bridge, I have virtually eliminated these problems (Being an old
|
|
|
|
radio tinkerer (K7JPV), I was also able to eliminate the
|
|
|
|
disconnects by hanging a piece of aluminum foil on the family room
|
|
|
|
wall. Needless to say, my wife Tarry rejected that as a permanent
|
|
|
|
solution :-).</para>
|
|
|
|
</note></para>
|
2004-02-14 19:06:39 +01:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
2004-03-17 16:03:46 +01:00
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2004-09-04 22:07:48 +02:00
|
|
|
<para>I have Ursa (193.168.1.5/206.124.146.178) configured as a 2-port
|
|
|
|
bridge.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Squid runs on the firewall and is configured as a transparent
|
|
|
|
proxy.</para>
|
2004-03-17 16:03:46 +01:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
2004-09-04 22:07:48 +02:00
|
|
|
<para>The firewall runs on a 384MB K-6/II with SuSE 9.1.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
2004-09-04 22:07:48 +02:00
|
|
|
<para>Ursa runs Samba for file sharing with the Windows systems..</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
2004-09-04 22:07:48 +02:00
|
|
|
<para>The wireless network connects to Ursa's eth0 via a LinkSys
|
2004-08-07 04:13:32 +02:00
|
|
|
WAP11. In additional to using the rather weak WEP 40-bit encryption
|
|
|
|
(64-bit with the 24-bit preamble), I use <ulink
|
2004-03-17 16:03:46 +01:00
|
|
|
url="MAC_Validation.html">MAC verification</ulink>. This is still a weak
|
|
|
|
combination and if I lived near a wireless <quote>hot spot</quote>, I
|
2004-08-07 04:13:32 +02:00
|
|
|
would probably add IPSEC or something similar to my WiFi->local
|
2004-03-17 16:03:46 +01:00
|
|
|
connections.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<para>The single system in the DMZ (address 206.124.146.177) runs postfix,
|
|
|
|
Courier IMAP (imaps and pop3), DNS, a Web server (Apache) and an FTP
|
2004-06-11 20:35:13 +02:00
|
|
|
server (Pure-ftpd) under Fedora Core 2. The system also runs fetchmail to
|
2004-02-14 19:06:39 +01:00
|
|
|
fetch our email from our old and current ISPs. That server is managed
|
|
|
|
through Proxy ARP.</para>
|
|
|
|
|
|
|
|
<para>The firewall system itself runs a DHCP server that serves the local
|
|
|
|
network.</para>
|
|
|
|
|
|
|
|
<para>All administration and publishing is done using ssh/scp. I have a
|
|
|
|
desktop environment installed on the firewall but I am not usually logged
|
|
|
|
in to it. X applications tunnel through SSH to Ursa. The server also has a
|
|
|
|
desktop environment installed and that desktop environment is available
|
|
|
|
via XDMCP from the local zone. For the most part though, X tunneled
|
|
|
|
through SSH is used for server administration and the server runs at run
|
2004-07-06 20:18:08 +02:00
|
|
|
level 3 (multi-user console mode on Fedora).</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<para>I run an SNMP server on my firewall to serve <ulink
|
|
|
|
url="http://www.ee.ethz.ch/~oetiker/webtools/mrtg/">MRTG</ulink> running
|
2004-05-09 00:31:54 +02:00
|
|
|
in the DMZ.</para>
|
|
|
|
|
|
|
|
<para>The ethernet interface in the Server is configured with IP address
|
2004-08-07 04:13:32 +02:00
|
|
|
206.124.146.177, netmask 255.255.255.0. The server's default gateway is
|
|
|
|
206.124.146.254 (Router at my ISP. This is the same default gateway used
|
|
|
|
by the firewall itself). On the firewall, an entry in my
|
2004-02-14 19:06:39 +01:00
|
|
|
/etc/network/interfaces file (see below) adds a host route to
|
|
|
|
206.124.146.177 through eth1 when that interface is brought up.</para>
|
|
|
|
|
2004-09-04 22:07:48 +02:00
|
|
|
<para>Tarry (192.168.1.4) runs a PPTP server for Road Warrior access from
|
|
|
|
my work laptop and the Firewall is configured with IPSEC for tunnel mode
|
|
|
|
road warrior access from Tipper.</para>
|
2004-05-09 00:31:54 +02:00
|
|
|
|
|
|
|
<para><graphic align="center" fileref="images/network.png" /></para>
|
2004-03-17 16:03:46 +01:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Firewall Configuration</title>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Shorewall.conf</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>LOGFILE=/var/log/messages
|
2004-09-04 22:07:48 +02:00
|
|
|
LOGFORMAT="Shorewall:%s:%s "
|
2004-02-14 19:06:39 +01:00
|
|
|
LOGRATE=
|
|
|
|
LOGBURST=
|
|
|
|
LOGUNCLEAN=$LOG
|
|
|
|
BLACKLIST_LOGLEVEL=
|
|
|
|
LOGNEWNOTSYN=$LOG
|
|
|
|
MACLIST_LOG_LEVEL=$LOG
|
|
|
|
TCP_FLAGS_LOG_LEVEL=$LOG
|
|
|
|
RFC1918_LOG_LEVEL=$LOG
|
|
|
|
SMURF_LOG_LEVEL=
|
2004-09-04 22:07:48 +02:00
|
|
|
PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
|
2004-02-14 19:06:39 +01:00
|
|
|
SHOREWALL_SHELL=/bin/ash
|
2004-09-04 22:07:48 +02:00
|
|
|
SUBSYSLOCK=
|
2004-02-14 19:06:39 +01:00
|
|
|
STATEDIR=/var/state/shorewall
|
|
|
|
MODULESDIR=
|
2004-09-04 22:07:48 +02:00
|
|
|
CONFIG_PATH=/etc/shorewall:/etc/shorewall/actiondir:/usr/share/shorewall
|
|
|
|
RESTOREFILE=standard
|
2004-02-14 19:06:39 +01:00
|
|
|
FW=fw
|
|
|
|
IP_FORWARDING=On
|
|
|
|
ADD_IP_ALIASES=Yes
|
|
|
|
ADD_SNAT_ALIASES=Yes
|
|
|
|
TC_ENABLED=Yes
|
2004-09-04 22:07:48 +02:00
|
|
|
CLEAR_TC=Yes
|
2004-02-14 19:06:39 +01:00
|
|
|
MARK_IN_FORWARD_CHAIN=No
|
|
|
|
CLAMPMSS=Yes
|
|
|
|
ROUTE_FILTER=No
|
|
|
|
DETECT_DNAT_IPADDRS=Yes
|
|
|
|
MUTEX_TIMEOUT=60
|
|
|
|
NEWNOTSYN=Yes
|
|
|
|
BLACKLISTNEWONLY=Yes
|
2004-09-04 22:07:48 +02:00
|
|
|
DYNAMIC_ZONES=No
|
|
|
|
DISABLE_IPV6=Yes
|
|
|
|
PKTTYPE=No
|
2004-02-14 19:06:39 +01:00
|
|
|
BLACKLIST_DISPOSITION=DROP
|
|
|
|
MACLIST_DISPOSITION=REJECT
|
|
|
|
TCP_FLAGS_DISPOSITION=DROP
|
|
|
|
</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Params File (Edited)</title>
|
|
|
|
|
|
|
|
<blockquote>
|
2004-08-07 04:13:32 +02:00
|
|
|
<para><programlisting>MIRRORS=<list of shorewall mirror ip addresses>
|
|
|
|
NTPSERVERS=<list of the NTP servers I sync with>
|
|
|
|
TEXAS=<ip address of gateway in Plano>
|
2004-09-04 22:07:48 +02:00
|
|
|
OMAK=<ip address of tipper while we are at our second home>
|
|
|
|
LOG=info
|
|
|
|
EXT_IF=eth1
|
|
|
|
INT_IF=eth0
|
|
|
|
DMZ_IF=eth2
|
|
|
|
</programlisting></para>
|
2004-02-14 19:06:39 +01:00
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Zones File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ZONE DISPLAY COMMENTS
|
|
|
|
net Internet Internet
|
|
|
|
dmz DMZ Demilitarized zone
|
|
|
|
loc Local Local networks
|
2004-09-04 22:07:48 +02:00
|
|
|
omak Omak Our Laptop at our second home
|
|
|
|
tx Texas Peer Network in Dallas
|
|
|
|
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE
|
|
|
|
</programlisting>
|
2004-02-14 19:06:39 +01:00
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Interfaces File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>This is set up so that I can start the firewall before bringing
|
|
|
|
up my Ethernet interfaces.</para>
|
|
|
|
|
2004-09-04 22:07:48 +02:00
|
|
|
<programlisting>#ZONE INTERFACE BROADCAST OPTIONS
|
|
|
|
net $EXT_IF 206.124.146.255 dhcp,norfc1918,routefilter,blacklist,tcpflags,nosmurfs
|
|
|
|
loc $INT_IF detect dhcp
|
|
|
|
dmz $DMZ_IF -
|
|
|
|
- texas -
|
|
|
|
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE</programlisting>
|
2004-02-14 19:06:39 +01:00
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Hosts File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ZONE HOST(S) OPTIONS
|
2004-09-04 22:07:48 +02:00
|
|
|
tx texas:192.168.8.0/22
|
|
|
|
omak $EXT_IF:$OMAK
|
2004-02-14 19:06:39 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
2004-09-04 22:07:48 +02:00
|
|
|
<section>
|
|
|
|
<title>Ipsec File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ZONE IPSEC OPTIONS IN OUT
|
|
|
|
# ONLY OPTIONS OPTIONS
|
|
|
|
omak yes mode=tunnel
|
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
|
|
|
|
</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
2004-02-14 19:06:39 +01:00
|
|
|
<section>
|
|
|
|
<title>Routestopped File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#INTERFACE HOST(S)
|
2004-09-04 22:07:48 +02:00
|
|
|
$DMZ_IF 206.124.146.177
|
|
|
|
$INT_IF -
|
|
|
|
$EXT_IF $OMAK
|
2004-02-14 19:06:39 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Blacklist File (Partial)</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ADDRESS/SUBNET PROTOCOL PORT
|
|
|
|
0.0.0.0/0 udp 1434
|
|
|
|
0.0.0.0/0 tcp 1433
|
2004-03-17 16:03:46 +01:00
|
|
|
0.0.0.0/0 tcp 3127
|
2004-02-14 19:06:39 +01:00
|
|
|
0.0.0.0/0 tcp 8081
|
|
|
|
0.0.0.0/0 tcp 57
|
|
|
|
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
2004-07-15 00:06:35 +02:00
|
|
|
<section>
|
|
|
|
<title>RFC1918 File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>Because my DSL modem has an RFC 1918 address (192.168.1.1) and
|
|
|
|
is connected to eth0, I need to make an exception for that address in
|
|
|
|
my rfc1918 file. I copied /usr/share/shorewall/rfc1918 to
|
|
|
|
/etc/shorewall/rfc1918 and changed it as follows:</para>
|
|
|
|
|
|
|
|
<programlisting>#SUBNET TARGET
|
|
|
|
<emphasis role="bold">192.168.1.1 RETURN</emphasis>
|
|
|
|
172.16.0.0/12 logdrop # RFC 1918
|
|
|
|
192.168.0.0/16 logdrop # RFC 1918
|
|
|
|
10.0.0.0/8 logdrop # RFC 1918
|
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
|
|
|
|
</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
2004-02-14 19:06:39 +01:00
|
|
|
<section>
|
|
|
|
<title>Policy File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#SOURCE DESTINATION POLICY LOG LEVEL BURST:LIMIT
|
2004-09-04 22:07:48 +02:00
|
|
|
fw fw ACCEPT
|
|
|
|
loc net ACCEPT
|
|
|
|
fw sec ACCEPT
|
|
|
|
omak fw ACCEPT
|
|
|
|
fw omak ACCEPT
|
|
|
|
omak loc ACCEPT
|
|
|
|
loc omak ACCEPT
|
|
|
|
omak net NONE
|
|
|
|
net omak NONE
|
|
|
|
omak dmz NONE
|
|
|
|
dmz omak NONE
|
|
|
|
omak tx NONE
|
|
|
|
tx omak NONE
|
|
|
|
$FW loc ACCEPT #Firewall to Local
|
|
|
|
$FW tx ACCEPT
|
|
|
|
loc tx ACCEPT
|
|
|
|
loc fw REJECT $LOG
|
|
|
|
dmz tx ACCEPT
|
|
|
|
net all DROP $LOG 10/sec:40
|
|
|
|
all all REJECT $LOG
|
2004-02-14 19:06:39 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Masq File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>Although most of our internal systems use one-to-one NAT, my
|
2004-08-07 04:13:32 +02:00
|
|
|
wife's system (192.168.1.4) uses IP Masquerading (actually SNAT) as do
|
|
|
|
my SuSE system (192.168.1.3), our laptop (192.168.3.8) and visitors
|
|
|
|
with laptops.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
2004-07-15 00:06:35 +02:00
|
|
|
<para>The first entry allows access to the DSL modem and uses features
|
2004-08-07 04:13:32 +02:00
|
|
|
introduced in Shorewall 2.1.1. The leading plus sign ("+_") causes the
|
|
|
|
rule to be placed before rules generated by the /etc/shorewall/nat
|
|
|
|
file below. The double colons ("::") causes the entry to be exempt
|
|
|
|
from ADD_SNAT_ALIASES=Yes in my shorewall.conf file above.</para>
|
2004-07-15 00:06:35 +02:00
|
|
|
|
2004-02-14 19:06:39 +01:00
|
|
|
<programlisting>#INTERFACE SUBNET ADDRESS
|
2004-09-04 22:07:48 +02:00
|
|
|
+$EXT_IF::192.168.1.1 0.0.0.0/0 192.168.1.254
|
|
|
|
$EXT_IF:2 eth2 206.124.146.179
|
2004-02-14 19:06:39 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS LINE -- DO NOT REMOVE
|
|
|
|
</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>NAT File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#EXTERNAL INTERFACE INTERNAL ALL INTERFACES LOCAL
|
|
|
|
206.124.146.178 eth0:0 192.168.1.5 No No
|
|
|
|
206.124.146.180 eth0:1 192.168.1.7 No No
|
|
|
|
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS LINE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="ProxyARP">
|
|
|
|
<title>Proxy ARP File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
2004-09-07 18:09:11 +02:00
|
|
|
<para>I configure the host route to 206.124.146.177 on <filename
|
|
|
|
class="devicefile">eth1</filename> using the Yast2 Network Interface
|
|
|
|
tool; the <quote>Gateway</quote> is specified as 0.0.0.0 which
|
|
|
|
indicates that the host is directly attached to the LAN on that
|
|
|
|
interface.</para>
|
|
|
|
|
2004-02-14 19:06:39 +01:00
|
|
|
<programlisting>#ADDRESS INTERFACE EXTERNAL HAVEROUTE PERSISTENT
|
|
|
|
206.124.146.177 eth1 eth0 Yes
|
2004-07-15 00:06:35 +02:00
|
|
|
192.168.1.1 eth0 eth2 yes # Allow access to DSL modem from the local zone
|
2004-02-14 19:06:39 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
2004-08-07 04:13:32 +02:00
|
|
|
<title>Tunnels File (Shell variable TEXAS set in
|
|
|
|
/etc/shorewall/params)</title>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#TYPE ZONE GATEWAY GATEWAY ZONE PORT
|
|
|
|
gre net $TEXAS
|
2004-09-04 22:07:48 +02:00
|
|
|
ipsec:noah net $OMAK omak
|
2004-02-14 19:06:39 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="Actions">
|
|
|
|
<title>Actions File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ACTION
|
|
|
|
Mirrors #Accept traffic from the Shorewall Mirror sites
|
|
|
|
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>action.Mirrors File</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>The $MIRRORS variable expands to a list of approximately 10 IP
|
|
|
|
addresses. So moving these checks into a separate chain reduces the
|
2004-08-07 04:13:32 +02:00
|
|
|
number of rules that most net->dmz traffic needs to
|
|
|
|
traverse.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<programlisting>#TARGET SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE
|
|
|
|
# PORT PORT(S) DEST LIMIT
|
|
|
|
ACCEPT $MIRRORS
|
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
2004-02-15 18:29:58 +01:00
|
|
|
<title>/etc/shorewall/action.Drop</title>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>This is my common action for the DROP policy. It is like the
|
2004-02-15 18:29:58 +01:00
|
|
|
standard <emphasis role="bold">Drop</emphasis> action except that it
|
2004-02-14 19:06:39 +01:00
|
|
|
allows <quote>Ping</quote>.</para>
|
|
|
|
|
|
|
|
<programlisting>#TARGET SOURCE DEST PROTO DEST SOURCE RATE USER/
|
|
|
|
# PORT(S) PORT(S) LIMIT GROUP
|
|
|
|
RejectAuth
|
|
|
|
AllowPing
|
|
|
|
dropBcast
|
|
|
|
DropSMB
|
|
|
|
DropUPnP
|
2004-07-15 00:06:35 +02:00
|
|
|
dropNotSyn
|
2004-02-14 19:06:39 +01:00
|
|
|
DropDNSrep</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
2004-02-15 18:29:58 +01:00
|
|
|
<title>/etc/shorewall/action.Reject</title>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>This is my common action for the REJECT policy. It is like the
|
2004-02-15 18:29:58 +01:00
|
|
|
standard <emphasis role="bold">Reject</emphasis> action except that it
|
|
|
|
allows <quote>Ping</quote> and contains one rule that guards against
|
|
|
|
log flooding by broken software running in my local zone.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<programlisting>#TARGET SOURCE DEST PROTO DEST SOURCE RATE USER/
|
|
|
|
# PORT(S) PORT(S) LIMIT GROUP
|
|
|
|
RejectAuth
|
|
|
|
AllowPing
|
|
|
|
dropBcast
|
|
|
|
RejectSMB
|
|
|
|
DropUPnP
|
2004-07-15 00:06:35 +02:00
|
|
|
dropNotSyn
|
2004-02-14 19:06:39 +01:00
|
|
|
DropDNSrep
|
2004-08-07 04:13:32 +02:00
|
|
|
DROP loc:eth2:!192.168.1.0/24 #So that my braindead Windows[tm] XP system doesn't flood my log
|
2004-02-14 19:06:39 +01:00
|
|
|
#with NTP requests with a source address in 16.0.0.0/8 (address of
|
|
|
|
#its PPTP tunnel to HP).</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
2004-08-07 04:13:32 +02:00
|
|
|
<title>Rules File (The shell variables are set in
|
|
|
|
/etc/shorewall/params)</title>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>###############################################################################################################################################################################
|
2004-09-04 22:07:48 +02:00
|
|
|
#RESULT CLIENT(S) SERVER(S) PROTO PORT(S) CLIENT ORIGINAL RATE USER
|
|
|
|
# PORT(S) DEST:SNAT SET
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
2004-07-15 00:06:35 +02:00
|
|
|
# Local Network to Internet - Reject attempts by Trojans to call home, direct SMTP and MS Message Service
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
RejectSMTP loc net tcp 25
|
|
|
|
REJECT:$LOG loc net tcp 6667,25
|
|
|
|
REJECT:$LOG loc net udp 1025:1031
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
|
|
|
# Stop NETBIOS crap since our policy is ACCEPT
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
REJECT loc net tcp 137,445
|
|
|
|
REJECT loc net udp 137:139
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
DROP loc:!192.168.1.0/24 net
|
|
|
|
#
|
|
|
|
# SQUID
|
|
|
|
#
|
|
|
|
REDIRECT loc 3128 tcp 80
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
2004-09-04 22:07:48 +02:00
|
|
|
# Local Network to Firewall
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
DROP loc:!192.168.1.0/24 fw
|
|
|
|
ACCEPT loc fw tcp ssh,time
|
|
|
|
ACCEPT loc fw udp 161,ntp
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
|
|
|
# Local Network to DMZ
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
DROP loc:!192.168.1.0/24 dmz
|
|
|
|
ACCEPT loc dmz udp domain,xdmcp
|
|
|
|
ACCEPT loc dmz tcp www,smtp,smtps,domain,ssh,imap,https,imaps,cvspserver,ftp,10027,pop3 -
|
2004-07-15 00:06:35 +02:00
|
|
|
###############################################################################################################################################################################
|
|
|
|
# Internet to ALL -- drop NewNotSyn packets
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
dropNotSyn net fw tcp
|
|
|
|
dropNotSyn net loc tcp
|
|
|
|
dropNotSyn net dmz tcp
|
|
|
|
|
|
|
|
#
|
|
|
|
# Drop ping to firewall and local
|
|
|
|
#
|
|
|
|
|
|
|
|
DropPing net fw
|
|
|
|
DropPing net loc
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
2004-09-04 22:07:48 +02:00
|
|
|
# Internet to DMZ
|
|
|
|
#
|
|
|
|
DNAT- net dmz:206.124.146.177 tcp smtp - 206.124.146.179,206.124.146.1
|
|
|
|
78
|
|
|
|
ACCEPT net dmz tcp smtp,smtps,www,ftp,imaps,domain,https,cvspserver -
|
|
|
|
ACCEPT net dmz udp domain
|
|
|
|
ACCEPT net dmz udp 33434:33436
|
|
|
|
Mirrors net dmz tcp rsync
|
|
|
|
ACCEPT net:$OMAK dmz tcp 22 #SSH from Omak
|
|
|
|
AllowPing net dmz
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
|
|
|
#
|
|
|
|
# Net to Local
|
|
|
|
#
|
2004-08-07 04:13:32 +02:00
|
|
|
# When I'm "on the road", the following two rules allow me VPN access back home.
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
DNAT net loc:192.168.1.4 tcp 1723 -
|
|
|
|
DNAT net:!$TEXAS loc:192.168.1.4 gre -
|
|
|
|
ACCEPT net loc:192.168.1.5 tcp 22
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
|
|
|
# ICQ
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT net loc:192.168.1.5 tcp 4000:4100
|
|
|
|
DNAT net loc:192.168.1.8 tcp 4000:4100 - 206.124.146.179
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
|
|
|
# Real Audio
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT net loc:192.168.1.5 udp 6970:7170
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
|
|
|
# Overnet
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
#ACCEPT net loc:192.168.1.5 tcp 4662
|
|
|
|
#ACCEPT net loc:192.168.1.5 udp 12112
|
2004-07-15 00:06:35 +02:00
|
|
|
#
|
|
|
|
# Silently Handle common probes
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
REJECT net loc tcp www,ftp,https
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
|
|
|
# DMZ to Internet
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT dmz net tcp smtp,domain,www,81,https,whois,echo,2702,21,2703,ssh,8080
|
|
|
|
ACCEPT dmz net udp domain
|
2004-07-15 00:06:35 +02:00
|
|
|
REJECT:$LOG dmz net udp 1025:1031
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT dmz net:$POPSERVERS tcp pop3
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
|
|
|
# Something is wrong with the FTP connection tracking code or there is some client out there
|
2004-08-07 04:13:32 +02:00
|
|
|
# that is sending a PORT command which that code doesn't understand. Either way,
|
2004-02-14 19:06:39 +01:00
|
|
|
# the following works around the problem.
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT:$LOG dmz net tcp 1024: 20
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
2004-08-07 04:13:32 +02:00
|
|
|
# DMZ to Firewall -- ntp & snmp, Silently reject Auth
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT dmz fw udp ntp ntp
|
|
|
|
ACCEPT dmz fw tcp 161,ssh
|
|
|
|
ACCEPT dmz fw udp 161
|
|
|
|
REJECT dmz fw tcp auth
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
2004-09-04 22:07:48 +02:00
|
|
|
# DMZ to Local Network
|
2004-02-14 19:06:39 +01:00
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT dmz loc tcp smtp,6001:6010
|
|
|
|
ACCEPT dmz:206.124.146.177 loc:192.168.1.5 tcp 111
|
|
|
|
ACCEPT dmz:206.124.146.177 loc:192.168.1.5 udp
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
|
|
|
# Internet to Firewall
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
REJECT net fw tcp www,ftp,https
|
|
|
|
ACCEPT net dmz udp 33434:33435
|
|
|
|
ACCEPT net:$OMAK fw udp ntp
|
|
|
|
ACCEPT net:$OMAK fw tcp 22 #SSH from Omak
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
|
|
|
# Firewall to Internet
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT fw net:$NTPSERVERS udp ntp ntp
|
|
|
|
#ACCEPT fw net:$POPSERVERS tcp pop3
|
|
|
|
ACCEPT fw net udp domain
|
|
|
|
ACCEPT fw net tcp domain,www,https,ssh,1723,whois,1863,ftp,2702,2703,7
|
|
|
|
ACCEPT fw net udp 33435:33535
|
|
|
|
ACCEPT fw net icmp
|
2004-07-15 00:06:35 +02:00
|
|
|
REJECT:$LOG fw net udp 1025:1031
|
2004-09-04 22:07:48 +02:00
|
|
|
DROP fw net udp ntp
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
|
|
|
# Firewall to DMZ
|
|
|
|
#
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT fw dmz tcp www,ftp,ssh,smtp
|
|
|
|
ACCEPT fw dmz udp domain
|
|
|
|
REJECT fw dmz udp 137:139
|
2004-02-14 19:06:39 +01:00
|
|
|
###############################################################################################################################################################################
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT tx loc:192.168.1.5 all
|
2004-07-15 00:06:35 +02:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
|
|
|
|
</programlisting>
|
2004-02-14 19:06:39 +01:00
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
</section>
|
2004-03-17 16:03:46 +01:00
|
|
|
|
|
|
|
<section>
|
2004-09-04 22:07:48 +02:00
|
|
|
<title>Bridge (Ursa) Configuration</title>
|
2004-03-17 16:03:46 +01:00
|
|
|
|
2004-09-04 22:07:48 +02:00
|
|
|
<para>As mentioned above, Ursa acts as a bridge. It's view of the network
|
|
|
|
is diagrammed in the following figure.</para>
|
2004-03-17 16:03:46 +01:00
|
|
|
|
|
|
|
<graphic fileref="images/network1.png" />
|
|
|
|
|
2004-08-07 04:13:32 +02:00
|
|
|
<para>I've included the files that I used to configure that system -- some
|
|
|
|
of them are SuSE-specific.</para>
|
2004-03-17 16:03:46 +01:00
|
|
|
|
|
|
|
<para>The configuration on Wookie can be modified to test various bridging
|
|
|
|
features -- otherwise, it serves to isolate the Wireless network from the
|
|
|
|
rest of our systems.</para>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>shorewall.conf</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>Only the changes from the defaults are shown.</para>
|
|
|
|
|
|
|
|
<programlisting>BRIDGING=Yes</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>zones</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ZONE DISPLAY COMMENTS
|
|
|
|
loc Local Local networks
|
2004-09-04 22:07:48 +02:00
|
|
|
net Internet The Big Bad Internet
|
|
|
|
WiFi Wireless Wireless Network
|
2004-03-17 16:03:46 +01:00
|
|
|
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE
|
|
|
|
</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>policy</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#SOURCE DEST POLICY LOG LIMIT:BURST
|
|
|
|
loc fw ACCEPT
|
2004-09-04 22:07:48 +02:00
|
|
|
loc net NONE
|
2004-09-07 18:09:11 +02:00
|
|
|
loc WiFi ACCEPT
|
2004-09-04 22:07:48 +02:00
|
|
|
net fw ACCEPT
|
|
|
|
net WiFi ACCEPT
|
|
|
|
net loc NONE
|
|
|
|
WiFi net ACCEPT
|
2004-09-07 18:09:11 +02:00
|
|
|
fw all ACCEPT
|
2004-03-17 16:03:46 +01:00
|
|
|
#
|
|
|
|
# THE FOLLOWING POLICY MUST BE LAST
|
|
|
|
#
|
|
|
|
all all REJECT info
|
|
|
|
#LAST LINE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>interfaces</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ZONE INTERFACE BROADCAST OPTIONS
|
2004-09-04 22:07:48 +02:00
|
|
|
- br0 192.168.1.255 dhcp
|
2004-03-17 16:03:46 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>hosts</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ZONE HOST(S) OPTIONS
|
2004-09-04 22:07:48 +02:00
|
|
|
loc br0:eth1:192.168.1.0/24
|
2004-03-17 16:03:46 +01:00
|
|
|
net br0:eth1
|
2004-09-04 22:07:48 +02:00
|
|
|
WiFi br0:eth0 maclist
|
2004-03-17 16:03:46 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS LINE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>rules</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL
|
|
|
|
# PORT PORT(S) DEST
|
2004-09-04 22:07:48 +02:00
|
|
|
ACCEPT WiFi loc udp 137:139
|
|
|
|
ACCEPT WiFi loc tcp 22,80,137,139,445,631,901,3389
|
|
|
|
ACCEPT WiFi loc udp 1024: 137
|
|
|
|
ACCEPT WiFi loc udp 177,123
|
|
|
|
ACCEPT WiFi loc:192.168.1.4 tcp 1723
|
|
|
|
ACCEPT WiFi loc:192.168.1.4 47
|
|
|
|
ACCEPT WiFi loc tcp 5900:5909
|
|
|
|
|
|
|
|
ACCEPT WiFi fw tcp ssh,80,111,137,139,445,9100:9104
|
|
|
|
ACCEPT WiFi fw udp
|
2004-03-17 16:03:46 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>routestopped</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#INTERFACE HOST(S) OPTIONS
|
|
|
|
br0 0.0.0.0/0 routeback
|
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>maclist</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<programlisting>#INTERFACE MAC IP ADDRESSES (Optional)
|
2004-09-04 22:07:48 +02:00
|
|
|
br0:eth0 00:A0:1C:DB:0C:A0 192.168.1.7 #Work Laptop
|
|
|
|
br0:eth0 00:04:59:0e:85:b9 #WAP11
|
|
|
|
br0:eth0 00:06:D5:45:33:3c #WET11
|
|
|
|
br0:eth0 00:0b:c1:53:cc:97 192.168.1.8 #TIPPER
|
2004-03-17 16:03:46 +01:00
|
|
|
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS LINE -- DO NOT REMOVE</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>/etc/init.d/bridge</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>This file is SuSE-specific and creates the bridge device
|
|
|
|
<filename class="devicefile">br0</filename>. A script for other
|
|
|
|
disbributions would be similar.</para>
|
|
|
|
|
|
|
|
<programlisting>#!/bin/sh
|
|
|
|
################################################################################
|
|
|
|
# Script to create a bridge between eth0, eth1 and eth2
|
|
|
|
#
|
|
|
|
# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
|
|
|
|
#
|
|
|
|
# (c) 2004 - Tom Eastep (teastep@shorewall.net)
|
|
|
|
#
|
|
|
|
# Modify the following variables to match your configuration
|
|
|
|
#
|
|
|
|
# chkconfig: 2345 05 89
|
|
|
|
# description: Layer 2 Bridge
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
|
|
|
|
|
|
|
|
do_stop() {
|
2004-08-07 04:13:32 +02:00
|
|
|
echo "Stopping Bridge"
|
2004-03-17 16:03:46 +01:00
|
|
|
brctl delbr br0
|
|
|
|
ip link set eth0 down
|
|
|
|
ip link set eth1 down
|
|
|
|
}
|
|
|
|
|
|
|
|
do_start() {
|
|
|
|
|
2004-08-07 04:13:32 +02:00
|
|
|
echo "Starting Bridge"
|
2004-03-17 16:03:46 +01:00
|
|
|
ip link set eth0 up
|
|
|
|
ip link set eth1 up
|
|
|
|
brctl addbr br0
|
|
|
|
brctl addif br0 eth0
|
|
|
|
brctl addif br0 eth1
|
|
|
|
}
|
|
|
|
|
2004-08-07 04:13:32 +02:00
|
|
|
case "$1" in
|
2004-03-17 16:03:46 +01:00
|
|
|
start)
|
|
|
|
do_start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
do_stop
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
do_stop
|
|
|
|
sleep 1
|
|
|
|
do_start
|
|
|
|
;;
|
|
|
|
*)
|
2004-08-07 04:13:32 +02:00
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
2004-03-17 16:03:46 +01:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
exit 0</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>/etc/sysconfig/network/ifcfg-br0</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>This file is SuSE-specific</para>
|
|
|
|
|
2004-08-07 04:13:32 +02:00
|
|
|
<programlisting>BOOTPROTO='static'
|
|
|
|
BROADCAST='192.168.1.255'
|
2004-09-04 22:07:48 +02:00
|
|
|
IPADDR='192.168.1.5'
|
2004-08-07 04:13:32 +02:00
|
|
|
NETWORK='192.168.1.0'
|
|
|
|
NETMASK='255.255.255.0'
|
|
|
|
REMOTE_IPADDR=''
|
|
|
|
STARTMODE='onboot'
|
|
|
|
UNIQUE='3hqH.MjuOqWfSZ+C'
|
|
|
|
WIRELESS='no'
|
|
|
|
MTU=''</programlisting>
|
2004-03-17 16:03:46 +01:00
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>/etc/sysconfig/network/routes</title>
|
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<para>This file is SuSE-specific</para>
|
|
|
|
|
|
|
|
<programlisting>192.168.1.0 - 255.255.255.0 br0
|
|
|
|
default 192.168.1.254 - -</programlisting>
|
|
|
|
</blockquote>
|
|
|
|
</section>
|
|
|
|
</section>
|
2004-02-14 19:06:39 +01:00
|
|
|
</article>
|