Привет всем!!! У меня такая проблема - поставил фряху, пересобрал ядро с подержкой FIREWALL i NAT, у первого интерфейса 192.168.109.100 (NET) у другово 192.168.0.1(LOCAL). В rc.conf прописал всьо что надо (я так думаю 8)) тип фаэра ОPEN - но вот самоэ интересно что с интерфейса каторий смотрит в локалку я могу пинговать только интерфейс которий смотрит в NET a имено 192.168.109.100 - с любово ІР локалки (192.168.0.1,2,3,4,5,6). Почему не роботаєт инет??? Видь на самом сервере он єсть (192.168.109.1 - шлюз провайдера 192.168.109.5 ДНС) а вот в локалку попадпть не хочет... Подскажите плиз чо не так!!!! Вот конфиги
rc.confdefaultrouter="192.168.109.1"
gateway_enable="YES"
hostname="gateway.net"
ifconfig_de0="inet 192.168.109.100 netmask 255.255.255.0"
ifconfig_fxp0="inet 192.168.0.1 netmask 255.255.255.0"
linux_enable="YES"
sshd_enable="YES"
usbd_enable="NO"
sendmail_enable="NO"
sendmail_submit_enable="NO"
firewall_enable="YES"
firewall_type="OPEN"
#firewall_script="/etc/firewall.sh"
natd_enable="YES"
natd_interface="de0"
natd_flags=""
trafd_enable="YES"
trafd_ifaces="fxp0 de0"
trafd_flags=""
inetd_enable="YES"при виводе команди ipfw show/list получаю слудеюшиє
gateway# ipfw show
00100 0 0 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
65000 19378 2136922 allow ip from any to any
65535 4 312 allow ip from any to anygateway# ipfw list
00100 allow ip from any to any via lo0
00200 deny ip from any to 127.0.0.0/8
00300 deny ip from 127.0.0.0/8 to any
65000 allow ip from any to any
65535 allow ip from any to any
>00100 allow ip from any to any via lo0
>00200 deny ip from any to 127.0.0.0/8
>00300 deny ip from 127.0.0.0/8 to any
>65000 allow ip from any to any
>65535 allow ip from any to anyв конфиге ядра есть строчки
options IPFIREWALL
options IPDIVERTпокажи файл /etc/rc.firewall раздел OPEN
case ${firewall_type} in
[Oo][Pp][Ee][Nn]|[Cc][Ll][Ii][Ee][Nn][Tt])
case ${natd_enable} in
[Yy][Ee][Ss])
if [ -n "${natd_interface}" ]; then
${fwcmd} add 50 divert natd ip4 from any to any via ${natd_interface}
fi
;;
esac
esac
Извини конечно но ненащол ту секцию что ти просил вот она покая как есть, а на щот options IPFIREWALL
options IPDIVERT - ето эсть конечно/etc/rc.firewall
#
# Setup system for firewall service.
## Suck in the configuration variables.
if [ -z "${source_rc_confs_defined}" ]; then
if [ -r /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
source_rc_confs
elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf
fi
fi############
# Define the firewall type in /etc/rc.conf. Valid values are:
# open - will allow anyone in
# client - will try to protect just this machine
# simple - will try to protect a whole network
# closed - totally disables IP services except via lo0 interface
# UNKNOWN - disables the loading of firewall rules.
# filename - will load the rules in the given filename (full path required)
#
# For ``client'' and ``simple'' the entries below should be customized
# appropriately.
############
#
# If you don't know enough about packet filtering, we suggest that you
# take time to read this book:
#
# Building Internet Firewalls, 2nd Edition
# Brent Chapman and Elizabeth Zwicky
#
# O'Reilly & Associates, Inc
# ISBN 1-56592-871-7
# http://www.ora.com/
# http://www.oreilly.com/catalog/fire2/
#
# For a more advanced treatment of Internet Security read:
#
# Firewalls & Internet Security
# Repelling the wily hacker
# William R. Cheswick, Steven M. Bellowin
#
# Addison-Wesley
# ISBN 0-201-63357-4
# http://www.awl.com/
# http://www.awlonline.com/product/0%2C2627%2C020163...
#setup_loopback () {
############
# Only in rare cases do you want to change these rules
#
${fwcmd} add 100 pass all from any to any via lo0
${fwcmd} add 200 deny all from any to 127.0.0.0/8
${fwcmd} add 300 deny ip from 127.0.0.0/8 to any
}if [ -n "${1}" ]; then
firewall_type="${1}"
fi############
# Set quiet mode if requested
#
case ${firewall_quiet} in
[Yy][Ee][Ss])
fwcmd="/sbin/ipfw -q"
;;
*)
fwcmd="/sbin/ipfw"
;;
esac############
# Flush out the list before we begin.
#
${fwcmd} -f flush############
# Network Address Translation. All packets are passed to natd(8)
# before they encounter your remaining rules. The firewall rules
# will then be run again on each packet after translation by natd
# starting at the rule number following the divert rule.
#
# For ``simple'' firewall type the divert rule should be put to a
# different place to not interfere with address-checking rules.
#
case ${firewall_type} in
[Oo][Pp][Ee][Nn]|[Cc][Ll][Ii][Ee][Nn][Tt])
case ${natd_enable} in
[Yy][Ee][Ss])
if [ -n "${natd_interface}" ]; then
${fwcmd} add 50 divert natd ip4 from any to any via ${natd_interface}
fi
;;
esac
esac############
# If you just configured ipfw in the kernel as a tool to solve network
# problems or you just want to disallow some particular kinds of traffic
# then you will want to change the default policy to open. You can also
# do this as your only action by setting the firewall_type to ``open''.
#
# ${fwcmd} add 65000 pass all from any to any
# Prototype setups.
#
case ${firewall_type} in
[Oo][Pp][Ee][Nn])
setup_loopback
${fwcmd} add 65000 pass all from any to any
;;[Cc][Ll][Ii][Ee][Nn][Tt])
############
# This is a prototype setup that will protect your system somewhat
# against people from outside your own network.
############# set these to your network and netmask and ip
net="192.0.2.0"
mask="255.255.255.0"
ip="192.0.2.1"setup_loopback
# Allow any traffic to or from my own net.
${fwcmd} add pass all from ${ip} to ${net}:${mask}
${fwcmd} add pass all from ${net}:${mask} to ${ip}# Allow TCP through if setup succeeded
${fwcmd} add pass tcp from any to any established# Allow IP fragments to pass through
${fwcmd} add pass all from any to any frag# Allow setup of incoming email
${fwcmd} add pass tcp from any to ${ip} 25 setup# Allow setup of outgoing TCP connections only
${fwcmd} add pass tcp from ${ip} to any setup# Disallow setup of all other TCP connections
${fwcmd} add deny tcp from any to any setup# Allow DNS queries out in the world
${fwcmd} add pass udp from ${ip} to any 53 keep-state# Allow NTP queries out in the world
${fwcmd} add pass udp from ${ip} to any 123 keep-state# Everything else is denied by default, unless the
# IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel
# config file.
;;[Ss][Ii][Mm][Pp][Ll][Ee])
############
# This is a prototype setup for a simple firewall. Configure this
# machine as a DNS and NTP server, and point all the machines
# on the inside at this machine for those services.
############
# 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.
case ${natd_enable} in
[Yy][Ee][Ss])
if [ -n "${natd_interface}" ]; then
${fwcmd} add divert natd all from any to any via ${natd_interface}
fi
;;
esac# 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 TCP through if setup succeeded
${fwcmd} add pass tcp from any to any established# Allow IP fragments to pass through
${fwcmd} add pass all from any to any frag# Allow setup of incoming email
${fwcmd} add pass tcp from any to ${oip} 25 setup# Allow access to our DNS
${fwcmd} add pass tcp from any to ${oip} 53 setup
${fwcmd} add pass udp from any to ${oip} 53
${fwcmd} add pass udp from ${oip} 53 to any# Allow access to our WWW
${fwcmd} add pass tcp from any to ${oip} 80 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# Allow DNS queries out in the world
${fwcmd} add pass udp from ${oip} to any 53 keep-state# Allow NTP queries out in the world
${fwcmd} add pass udp from ${oip} to any 123 keep-state# Everything else is denied by default, unless the
# IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel
# config file.
;;[Cc][Ll][Oo][Ss][Ee][Dd])
setup_loopback
;;
[Uu][Nn][Kk][Nn][Oo][Ww][Nn])
;;
*)
if [ -r "${firewall_type}" ]; then
${fwcmd} ${firewall_flags} ${firewall_type}
fi
;;
esac
проверяй
ps ax | grep natd
должно быть /sbin/natd -f /etc/natd.conf -n fxp1если есть добавь сам правило в файервол
ipfw add 50 divert natd ip from any to any via fxp1
>проверяй
>ps ax | grep natd
>должно быть /sbin/natd -f /etc/natd.conf -n fxp1
>
>если есть добавь сам правило в файервол
>ipfw add 50 divert natd ip from any to any via fxp1
>Здорова! Смотри сделал как ти сказал - и нечево.... Потом поменял некоториє значания в
rc.conf и после ps ax | grep natd -> /sbin/natd -f /etc/natd.conf -n fxp0Понимаєш тут такая ситуация.... Из локалки я пингую 192.168.109.100, а вот уже 192.168.109.5 - нехочет.... и постояно вибиваєт надпись:
kernel gateway: arp: 192.168.0.2 is on fpx0 but got reply from on de0
что ето такоэ... Вродиьи всьо и роботаэт на в конце концов ничево не получаэтса... Может ти знаэш конкретною статю по настрой???
>[оверквотинг удален]
>rc.conf и после ps ax | grep natd -> /sbin/natd -f /etc/natd.conf -n fxp0
>
>Понимаєш тут такая ситуация.... Из локалки я пингую 192.168.109.100, а вот уже
>192.168.109.5 - нехочет.... и постояно вибиваєт надпись:
>
> kernel gateway: arp: 192.168.0.2 is on fpx0 but got reply from
>on de0
>
>что ето такоэ... Вродиьи всьо и роботаэт на в конце концов ничево
>не получаэтса... Может ти знаэш конкретною статю по настрой???мдя, вернитесь к первоистокам http://www.freebsd.org/doc/ru_RU.KOI8-R/books/handbook/netwo... здесь подробно расписано.