The Internet (192.168.0.0/24) | ------------ | | fw0 fw1 | | ------------ | local network (10.0.0.0/24) | clientという例を考えることにします。 IP アドレスは 内側のネットワークは 10.0.0.0/24 外側のネットワークは 192.168.0.0/24 とします。
仮想アドレスには 10.0.0.1 を割り当て、 実アドレスは fw0 が 10.0.0.2 fw1 が 10.0.0.3 とします。
以下では SMTP HTTP FTP SSH proxy の設定について考えます。 POP 等については SSH と同様に設定をするだけですので、 省略します。
起動するための shell script の例:
libexec_dir=/usr/local/nfgw/libexec $libexec_dir/tproxy -p -s 10080 -d -a 10/24 localhost 3128 & $libexec_dir/transtone -T -N ssh-gw -l localhost:0 localhost:10022 & $libexec_dir/transtone -T -N telnet-gw -l localhost:0 localhost:10023 & $libexec_dir/transtone -T -N pop-gw -l localhost:0 localhost:10110 & $libexec_dir/transtone -T -N https-gw -l localhost:0 localhost:10443 & $libexec_dir/transtone -T -N rsync-gw -l localhost:0 localhost:10873 & $libexec_dir/transtone -T -N irc-gw -l localhost:0 localhost:16667 & $libexec_dir/transtone -T -N cvs-gw -l localhost:0 localhost:12401 & $libexec_dir/jftpgw
/etc/ipf.conf の例:
pass in log all pass out log all/etc/ipnat.conf の例:
rdr ep0 0.0.0.0/0 port 21 -> 127.0.0.1 port 10021 tcp rdr ep0 0.0.0.0/0 port 22 -> 127.0.0.1 port 10022 tcp rdr ep0 0.0.0.0/0 port 25 -> 127.0.0.1 port 25 tcp rdr ep0 0.0.0.0/0 port 80 -> 127.0.0.1 port 3128 tcp rdr ep0 0.0.0.0/0 port 81 -> 127.0.0.1 port 10081 tcp rdr ep0 0.0.0.0/0 port 110 -> 127.0.0.1 port 10110 tcp rdr ep0 0.0.0.0/0 port 873 -> 127.0.0.1 port 10873 tcp rdr ep0 0.0.0.0/0 port 443 -> 127.0.0.1 port 10443 tcp rdr ep0 0.0.0.0/0 port 2401 -> 127.0.0.1 port 12401 tcp rdr ep0 0.0.0.0/0 port 6667 -> 127.0.0.1 port 16667 tcp
jftpgw は次のような設定です。
<global>
serverport 21
defaultmode asclient
debuglevel 9
dropprivileges loggedin
runasuser nobody
# need to know which interface we should use.
transparent-proxy on
dataclientaddress 10.0.0.1
</global>
<servertype standalone>
listen 127.0.0.1:10021
logstyle syslog
logfile /var/log/jftpgw.log
pidfile /var/run/jftpgw.pid
</servertype>
<servertype inetd>
logstyle syslog
</servertype>
<from 0.0.0.0/0>
access deny
</from>
<from 10.0.0.0/24>
access allow
</from>my homepage is www.fml.org/home/fukachan/.
my free softwares are found at www.fml.org/software/.
fml 4.0 project homepage is www.fml.org/fml/menu.ja.html.
fml 8.0 (fml-devel) project homepage is www.fml.org/software/fml8/.
about one floppy bsd routers, see www.bsdrouter.org/.
my laboratory will be nsrg.fml.org (under preparation).
Also, visit nuinui's world :) at www.nuinui.net.
For questions about me, e-mail <fukachan@fml.org>.
Copyright (C) 1993-2008 Ken'ichi Fukamachi
Powered by NetBSD.