2008年10月29日水曜日

Debian Etchルーター

今日は、Debian Etchにネットワークカードを2枚さして、ネットワーク帯を2つ作成し、そのDebianサーバーをSquidプロクシサーバーにしておいた。
このDebian機は、ハードディスクを970MB/10GBしか使っていません。(^o^)
設定のメモを一応

2枚目のネットワークカードの種類を調べておく。
RTL8139であったので、
/var/log/message
で、RTL8139が認識されているか、IRQナンバーの設定を見ておく。

/etc/network/interface の状況
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.B
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.A
dns-nameservers ***.***.***.***
dns-search i***

allow-hotplug eth1
iface eth1 inet static
address 192.168.1.C
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.0.A

/proc/sys/net/ipv4/ip_forwardの状況
1

2枚目のネットワークカードにgwを設定する。
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.A

ルーティングテーブルが設定されているかどうかを診る
root#route -v
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 192.168.0.A 255.255.255.0 UG 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
localnet * 255.255.255.0 U 0 0 0 eth0
default 192.168.0.A 0.0.0.0 UG 0 0 0 eth0

ネットワーク帯の他のパソコンから導通試験をする。
ping 192.168.0.B
ping 192.168.0.C

Debian Etch機にSquidサーバーを設定する。
※このDebian機は別のParentプロクシのChildプロクシになってる
acl netw0 src 192.168.0.0/255.255.255.0
acl netw1 src 192.168.1.0/255.255.255.0
http_access allow netw0
http_access allow netw1

後は、ネットワーク帯のパソコンからプロクシができることを確かめる。終了。

0 件のコメント:

コメント