[HOME] [github] [twitter] [blog] [fml4] [fml8] [北海道] Powered by NetBSD and [nuinui.net] .

設定例

Table of Contents
設定ファイルの例
OS の設定
Postfix の設定
squid の設定
jftpgw の設定
ssh proxy の設定

Caution

なお、nfgw (1.0系列) は、すでに obsolete です。 nfgw2 シリーズを御利用下さい。 本ドキュメントは、記録保持の一貫として、維持されています。

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>

[HOME] [github] [twitter] [blog] [fml4] [fml8] [北海道] Powered by NetBSD and [nuinui.net] .
Copyright (C) 1993-2022 Ken'ichi Fukamachi mail:< fukachan at fml.org >