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

From: Patric Mrawek <patric(at)argv.de>
Date: Thu, 5 Sep 2002 09:20:09 +0200

Stefan Mallepell wrote:

> 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)

> 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"

Hier widersprichst Du Dir selbst. »fxp2« ist Dein internes Interface.
»-a 195.1.1.22« sagt natd auf welche IP er die Pakete umschreiben
soll, in diesem Fall die IP auf einen externen Interface. In der
man-Page natd(8) steht sehr genau was -a und -i tun.

Da Du ja sehr wahrscheinlich ausgehendes NAT machen willst musst Du
das externe Interface als »natd_interface« angeben, also »fxp0«.
»-a« brauchst Du nur, wenn Du auf Deinem NAT-Interface IP-Aliases
definiert hast.
>
> # 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

Hier muss natuerlich auch »fxp0« stehen.

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

Patric

-- 
The problem with troubleshooting is that trouble shoots back.
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Thu 05 Sep 2002 - 09:20:13 CEST

search this site