Newbie : NAT Probleme: 2 public Interface, 1 privat NAT Interface

From: Stefan Mallepell <steve(at)syso.ch>
Date: Wed, 4 Sep 2002 23:40:37 +0200

Hi

Ich hoffe ich stelle als Anfänger nicht eine zu doofe Frage. Für eine
Antwort bin ich sehr dankbar, da ich trotz mehrerer Stunden suchen, keine
Lösung fand.

Folgendes ist das Problem:

Eine Maschine mit 3 Netzwerkkarten soll als Router, Firewall fungieren.
Folgende Konstallation habe ich:

Def Gateway 195.1.1.1
fxp0 -> public interface A (zB 195.1.1.22 / 255.255.255.0)
fxp1 -> public interface B (zB 195.1.2.193 / 255.255.255.248)
fxp2 -> privat interface C (NAT: zB 192.168.1.1 / 255.255.255.0)

NAT will einfach nicht recht funktionieren. Hab zuerst mal genau nach
Handbuch gearbeitet und weil das nicht funktioniert hat, dann einige weitere
Ideen versucht ...

Unten sind Auszüge aus meinen Konfigs. Falls jemand Tips oder eine Anleitung
hat, wie ich das machen soll, dann wäre ich echt froh.

Herzlichen Dank und Viele Grüsse

Stefan

Kernel Kopnfiguration
----------------------
# Firewall Konfiguration / natd
options IPFIREWALL #firewall aktiviert
options IPFIREWALL_VERBOSE #print info of dropped packets
options IPFIREWALL_VERBOSE_LIMIT=200 #Limits No packets logged
options IPDIVERT #divert sockets / needed by natd

rc.conf (aktuelle Version nach viel testen ...)
-----------------------------------------------------
hostname="fwall.syso.ch"

# Interface Settings
ifconfig_fxp0="inet 195.1.1.22 netmask 255.255.255.0"
ifconfig_fxp1="inet 195.1.2.193 netmask 255.255.255.248"
ifconfig_fxp2="inet 192.168.1.1 netmask 255.255.255.0"

# Routing Settings
defaultrouter="195.1.1.1"
gateway_enable="YES"

# Netzwerk Dienste
inetd_enable="NO"
nfs_server_enable="NO"
sendmail_enable="NO"
sshd_enable="YES"

# Firewall Settings
firewall_enable="YES"
firewall_script="/etc/firewall/fwrules"
natd_enable="YES"
natd_interface="fxp2"
natd_flags="-v -a 195.1.1.22"

# Security
kern_securelevel="2"
kern_securelevel_enable="YES"

#Regional Settings
keymap="swissgerman.iso"

Firewall rules
--------------
#!/bin/sh

# Define the Firewall command
fwcmd="/sbin/ipfw"

#### Force a flushing of the current rules before we load our own rules
$fwcmd -f flush

#### NAT auf FXP2 definieren
$fwcmd add 50 divert natd all from any to any via fxp2

#### only for testing: temp open everything
$fwcmd add allow all from any to any

--
********************
SYSO GmbH
Zürcherstrasse 204
9014 St. Gallen
T +41 (0)71 274 93 83
F +41 (0)71 274 93 84
info(at)syso.ch
Stefan Mallepell
mallepell(at)syso.ch
********************
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Wed 04 Sep 2002 - 23:42:03 CEST

search this site