[FreeBSD] NATD en IPFW

Pagina: 1
Acties:
  • 169 views sinds 30-01-2008
  • Reageer

  • Infern0
  • Registratie: September 2000
  • Laatst online: 16-03 23:51

Infern0

Hou die ontzettende rust!!

Topicstarter
Hallo,

Ik hoop dat jullie mij hiermee kunnen helpen wat ik snap er niks meer van.
Situatie:
FreeBSD gateway met nat en ipfw geinstalleerd en werkend.
Probleem is nu:
ICQ wil onder windows gewoon werken omdat ik voor elke client 50 poorten heb geforward


Nu gebruik ik zelf Debian en wil ook ICQ gebruiken.

Met Licq kun je netjes de poorten instellen maar online komen wil niet.

Kicq: wil helemaal niks

GnomeICU: werkt ook niet

Nu heb ik ook nog eens socks5 geinstalleerd op de freebsd gateway, maar ik zie dat hij connect vanaf mijn ip, maar dan gebeurt er verder ook niks.

Wel zie ik steeds op de console verschijnen
[NATD] Failed to write packed back (permission denied)

http://www.bsdfreaks.nl Home site: http://rob.lensen.nu /me was RobL


Verwijderd

firewall probleem. welke poorten heb je geforward en hoe?

  • Infern0
  • Registratie: September 2000
  • Laatst online: 16-03 23:51

Infern0

Hou die ontzettende rust!!

Topicstarter
Dit staat er in mijn /etc/natd.conf

dynamic yes
use_sockets yes
same_ports yes
#WinVNC port forward
redirect_port tcp 192.168.1.2:5900 5900
#ICQ Forward
redirect_port tcp 192.168.1.2:2000-2048 2000-2048
#D8 misschien dat udp nodig was voor Licq
redirect_port udp 192.168.1.2:2000-2048 2000-2048

Mijn /etc/rc.ipfw


# rc.ipfw - Firewall Rules
#
# This file is a modified version of /etc/rc.firewall.
#
# Maintained by: D. O'Connor
# Modified: 7/18/2000.
#

# Suck in the configuration variables.
if [ -r /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
source_rc_confs
elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf
fi

if [ -n "${1}" ]; then
firewall_type="${1}"
fi

# Firewall program
fwcmd="/sbin/ipfw"

# Outside interface network and netmask and ip
oif="de0"
onet="1.1.1.1"
omask="255.255.248.0"
oip="1.1.1.1"

# Inside interface network and netmask and ip
iif="rl0"
inet="192.168.1.0"
imask="255.255.255.0"
iip="192.168.1.1"

# My ISP's DNS servers
dns1="1.1.1.1"
# dns2="98.76.54.123"
# Flush previous rules
${fwcmd} -f flush

# Allow loopbacks, deny imposters
${fwcmd} add 100 pass all from any to any via lo0
${fwcmd} add 200 deny all from any to 127.0.0.0/8

# If you're using 'options BRIDGE', uncomment the following line to pass ARP
#${fwcmd} add 300 pass udp from 0.0.0.0 2054 to 0.0.0.0

# Stop spoofing
${fwcmd} add deny all from ${inet}:${imask} to any in via ${oif}
${fwcmd} add deny all from ${onet}:${omask} to any in via ${iif}

# Stop RFC1918 nets on the outside interface
${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif}
${fwcmd} add deny all from any to 172.16.0.0/12 via ${oif}
${fwcmd} add deny all from any to 192.168.0.0/16 via ${oif}


#Socks5 blokkering van buiten
${fwcmd} add 550 deny tcp from any to any 1080 in recv de0 setup


# Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
# on the outside interface
${fwcmd} add deny all from any to 0.0.0.0/8 via ${oif}
${fwcmd} add deny all from any to 169.254.0.0/16 via ${oif}
${fwcmd} add deny all from any to 192.0.2.0/24 via ${oif}
${fwcmd} add deny all from any to 224.0.0.0/4 via ${oif}
${fwcmd} add deny all from any to 240.0.0.0/4 via ${oif}

# Network Address Translation. This rule is placed here deliberately
# so that it does not interfere with the surrounding address-checking
# rules. If for example one of your internal LAN machines had its IP
# address set to 192.0.2.1 then an incoming packet for it after being
# translated by natd(8) would match the `deny' rule above. Similarly
# an outgoing packet originated from it before being translated would
# match the `deny' rule below. ${fwcmd} add divert natd all from any to any via ${oif}

# Stop RFC1918 nets on the outside interface
${fwcmd} add deny all from 10.0.0.0/8 to any via ${oif}
${fwcmd} add deny all from 172.16.0.0/12 to any via ${oif}
${fwcmd} add deny all from 192.168.0.0/16 to any via ${oif}

# Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
# on the outside interface
${fwcmd} add deny all from 0.0.0.0/8 to any via ${oif}
${fwcmd} add deny all from 169.254.0.0/16 to any via ${oif}
${fwcmd} add deny all from 192.0.2.0/24 to any via ${oif}
${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif}
${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif}

# Allow established connections with minimal overhead
${fwcmd} add pass tcp from any to any established

# Allow IP fragments to pass through
${fwcmd} add pass all from any to any frag


### TCP RULES

# HTTP - Allow access to our web server
${fwcmd} add pass tcp from any to any 80 setup

# SMTP - Allow access to sendmail for incoming e-mail
${fwcmd} add pass tcp from any to any 25 setup

# FTP - Allow incoming data channel for outgoing connections,
# reject & log all incoming control connections
${fwcmd} add pass tcp from any 20 to any 1024-65535 setup
${fwcmd} add deny log tcp from any to any 21 in via ${oif} setup

#WinVNC
${fwcmd} add pass tcp from any to any 5900


#Proxy Server
${fwcmd} add pass tcp from any to any 2064

# ICQ poorten
${fwcmd} add pass tcp from any to any 2000-2400
${fwcmd} add pass udp from any to any 2000-2400

# SSH Login - Allow & Log all incoming
${fwcmd} add pass log tcp from any to any 22 in via ${oif} setup

# IDENT - Reset incoming connections
${fwcmd} add reset tcp from any to any 113 in via ${oif} setup

# Reject&Log all setup of incoming connections from the outside
${fwcmd} add deny log tcp from any to any in via ${oif} setup

# Allow setup of any other TCP connection
${fwcmd} add pass tcp from any to any setup


### UDP RULES

# DNS - Allow queries out in the world
${fwcmd} add pass udp from any to ${dns1} 53
${fwcmd} add pass udp from any to ${dns2} 53
${fwcmd} add pass udp from ${dns1} 53 to any
${fwcmd} add pass udp from ${dns2} 53 to any

# SMB - Allow local traffic
${fwcmd} add pass udp from any to any 137-139 via ${iif}

# SYSLOG - Allow machines on inside net to log to us.
${fwcmd} add pass log udp from any to any 514 via ${iif}

# NTP - Allow queries out in the world
${fwcmd} add pass udp from any 123 to any 123 via ${oif}
${fwcmd} add pass udp from any 123 to any via ${iif}
${fwcmd} add pass udp from any to any 123 via ${iif}

# TRACEROUTE - Allow outgoing
${fwcmd} add pass udp from any to any 33434-33523 out via ${oif}
### ICMP RULES

# ICMP packets
# Allow all ICMP packets on internal interface
${fwcmd} add pass icmp from any to any via ${iif}

# Allow outgoing pings
${fwcmd} add pass icmp from any to any icmptypes 8 out via ${oif}
${fwcmd} add pass icmp from any to any icmptypes 0 in via ${oif}

# Allow Destination Unreachable, Source Quench, Time Exceeded, and Bad Header
${fwcmd} add pass icmp from any to any icmptypes 3,4,11,12 via ${oif}

# Deny the rest of them
${fwcmd} add deny icmp from any to any


### MISCELLANEOUS REJECT RULES

# Reject broadcasts from outside interface
${fwcmd} add 63000 deny ip from any to 0.0.0.255:0.0.0.255 in via ${oif}

# Reject&Log SMB connections on outside interface
${fwcmd} add 64000 deny log udp from any to any 137-139 via ${oif}

# Reject&Log all other connections from outside interface
${fwcmd} add 65000 deny log ip from any to any via ${oif}

# Everything else is denied by default, unless the
# IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel
# config file.

http://www.bsdfreaks.nl Home site: http://rob.lensen.nu /me was RobL


Verwijderd

even heel snel uit mijn hoofd: volgens mij ben je bij redirect_port het source adres vergeten op te geven (target) ports (source) ports. bij jou ontbreekt het source adres. 'k weet niet zo of dat van belang is, maar meer kan ik er nu even niet over zeggen.

Verwijderd

<hier stond onzin>

  • deadinspace
  • Registratie: Juni 2001
  • Nu online

deadinspace

The what goes where now?

Hmmm, ik draai licq op mijn (debian) laptop, en ik kan gewoon online komen met licq (ook de windows icq client op een andere compu wil gewoon online), maar ik heb geen ports geforward in mijn firewall.

Hoe zit dat dan? Forward de firewall in linux 2.2.19 automatisch icq-requests? Volgensmij niet.

Verwijderd

Op zondag 01 juli 2001 16:26 schreef deadinspace het volgende:
Hmmm, ik draai licq op mijn (debian) laptop, en ik kan gewoon online komen met licq (ook de windows icq client op een andere compu wil gewoon online), maar ik heb geen ports geforward in mijn firewall.

Hoe zit dat dan? Forward de firewall in linux 2.2.19 automatisch icq-requests? Volgensmij niet.
Nee, als je gewoon NAT hebt dan kun je gewoon normaal ICQ'en alleen kun je geen files ontvangen / chatten enz (lees: direct connection) dat is het enige, je kan wel normaal icq'en hoor...

  • deadinspace
  • Registratie: Juni 2001
  • Nu online

deadinspace

The what goes where now?

Ja, dat klopt, ik moest wat klooien voor file transfer werkte, maar gewoon icq-en werkte dus direct.

  • Chiron
  • Registratie: Januari 2001
  • Laatst online: 00:05

Chiron

Moderator Discord / TFV & AWM
hoe heb je filetransfer aan de praat gekregen?

"Light thinks it travels faster than anything. It doesn't. For wherever light travels it finds darkness has got there first and is waiting for it."


  • Infern0
  • Registratie: September 2000
  • Laatst online: 16-03 23:51

Infern0

Hou die ontzettende rust!!

Topicstarter
gewoon een aantal poorten doosturen bv 2000-2400
en dit ook in icq aangeven

http://www.bsdfreaks.nl Home site: http://rob.lensen.nu /me was RobL

Pagina: 1