[Tokyodebian-2006] Debian勉強会21事前課題
Yasuhiko Takasugi
takasugi at flcl.org
Thu Oct 19 00:59:13 UTC 2006
高杉です。
事前課題を遅らせて頂きます。
debian のネットワーク設定に関しては、マシンの用途、接続方法などでいくつ
か設定方法があると思います。私の知る限りでは以下の設定があります。
1)/etc/network 以下
interfacesとインターフェース起動時の処理のスクリプト群
2)/etc/ppp 以下
ppp 接続時の処理のスクリプト群
3)dhcp 接続時
4)network-manager を使った設定
これらの設定の解説や設定例があるとよいとおもいます。
******* DMZ 家庭内LAN間FW *******
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback
# The first network card - this entry was created during the Debian
installation
# (network, broadcast and gateway are optional)
# automatically added when upgrading
auto eth0 eth1
iface eth1 inet static
address 210.150.XXX.XXX
netmask 255.255.255.XXX
network 210.150.XXX.XXX
broadcast 210.150.XXX.XXX
gateway 210.150.XXX.XXX
#IP Masquarade
up iptables -t nat -A POSTROUTING -s 192.168.X.0/24 -o eth1 -j MASQUERADE
#For Diablo
# up iptables -t nat -A PREROUTING -p tcp --dport 4000 -i eth0 -j DNAT
--to 192.168.X.37:4000
# up iptables -t nat -A PREROUTING -p udp --dport 4000 -i eth0 -j DNAT
--to 192.168.X.37:4000
# up iptables -t nat -A PREROUTING -p tcp --dport 6112:6119 -i eth0 -j
DNAT --to 192.168.X.37:6112-6119
# up iptables -t nat -A PREROUTING -p udp --dport 6112:6119 -i eth0 -j
DNAT --to 192.168.X.37:6112-6119
#Filtering
up iptables -N block
up iptables -A block -i eth1 -j DROP -p tcp --dport 137:139
up iptables -A block -i eth1 -j DROP -p udp --dport 137:139
up iptables -A block -o eth1 -j DROP -p tcp --dport 137:139
up iptables -A block -o eth1 -j DROP -p udp --dport 137:139
up iptables -A INPUT -j block
up iptables -A FORWARD -j block
#routing
up route add -net 192.168.X.0 netmask 255.255.255.0 eth0
iface eth0 inet static
address 192.168.X.1
netmask 255.255.255.0
network 192.168.X.0
broadcast 192.168.X.255
********** 家庭内ファイルサーバ ********
注)DHCPでIPを取得してますが、DHCPでIP取得時にBINDに名前を登録しているの
で、書いていないでの運用上大きな問題はない。
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping eth0
script grep
map eth0
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
--
takasugi at flcl.org
More information about the Tokyodebian-2006
mailing list