[Armadillo:01288] Re: armadillo230のIPアドレス設定について(追記)

email@hidden
2006年 10月 9日 (月) 21:23:15 JST


こんばんは。

アルマジロのファイアーウォールスクリプトをどう使うのが一番いいのかは私も知らないのですが、とりあえず、
/etc/init.d/firewall
でパケット転送とファイアーウォール関連が指定されていますので、私の場合、直接書き換えてしまいました。

具体的には、/proc/sys/net/ipv4/ip_forwardに1を書き込むとパケット転送がONになり、

# echo 1 > /proc/sys/net/ipv4/ip_foward

さらにiptablesで、下記のように何でもOKになればすべてが通過でき、転送されます。

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

一応、/etc/init.d/firewallを以下のようにすればそうなります。正式にどうするのが良いかはわかりませんけど。
イントラのルーターとして使う分にはすべて許可でも良い場合もありますが、インターネットとのルーターとして使う場合はセキュリティを考えて
フィルタリングしましょう。iptablesによるフィルタリングに関してはネットでも書籍でも情報はたくさんありますので。

#
# iptables firewall script (filter table)
# Produced by at-cgi
#

# Options

IPT=/bin/iptables
IP_FORWARD=yes

# Pre-rule configuration

# Enable/disable IP forading
if [ "$IP_FORWARD" = "yes" ] ; then
  echo "1" > /proc/sys/net/ipv4/ip_forward
else
  echo "0" > /proc/sys/net/ipv4/ip_forward
fi

# Disable Source Routed Packets
for f in /proc/sys/net/ipv4/conf/*/accept_source_route
do
  echo 0 > $f
done

# Drop spoofed packets coming in on an interface, where responses
# would result in the reply going out a different interface.
for f in /proc/sys/net/ipv4/conf/*/rp_filter
do
  echo 1 > $f
done

# Disable ICMP redirect acceptance
for f in /proc/sys/net/ipv4/conf/*/accept_redirects
do
  echo 0 > $f
done

# Accept ICMP redirect messages only for gateways,
# listed in default gateway list
for f in /proc/sys/net/ipv4/conf/*/secure_redirects
do
  echo 1 > $f
done

# Don't send redirect messages
for f in /proc/sys/net/ipv4/conf/*/send_redirects
do
  echo 0 > $f
done

# Log packets with impossible addresses
for f in /proc/sys/net/ipv4/conf/*/log_martians
do
  echo 1 > $f
done

# Ignore echo broadcasts
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

# Ignore ICMP errors
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses

# Enable TCP SYN sookies
#echo 1 > /proc/sys/net/ipv4/tcp_syncookies

$IPT -F INPUT
$IPT -F OUTPUT
$IPT -F FORWARD
$IPT -X

$IPT -A INPUT -i lo -j ACCEPT
$IPT -A OUTPUT -o lo -j ACCEPT

# Filter table policies

$IPT -P INPUT ACCEPT
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD ACCEPT

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
小俣光之(Mitsuyuki Komata)
日本シー・エー・ディー株式会社
   TEL:03-3565-3011(直)・2011(代)  FAX:03-3565-3611
E-Mail: email@hidden
Office-URL: http://www.ncad.co.jp/
Private-URL: http://www.ncad.co.jp/~komata/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
----- Original Message ----- 
From: <email@hidden>
To: <email@hidden>
Sent: Monday, October 09, 2006 4:58 PM
Subject: [Armadillo:01287] Re: armadillo230のIPアドレス設定について(追記)


>
> ご回答ありがとうございます。
> 現在試しているのですが、br0の設定をコメントアウトし、ブリッジbr0もアクティブにしないで起動すると、ifconfigで確認するとeth0だけIPア
ドレスがstaticで割り振れてました。
> ifup eth1を行うとeth0にもIPを割り振られているのが確認できました。
>
> けれど・・・
> 各インタフェイス(eth0、eth1)とも同じネットワーク内では通信可能なのですが、ルーティングなどはどのように行えばいいのでしょうか?
> routeコマンドで経路設定かなと思い、やってはみたのですが、設定が悪かったのかおかしくなりました。
> 他のLINUXではIPフォワーディング機能も有効にする必要があるのでしょうか?
> それとも、ブリッジ機能を使ってルーティングを行うのでしょうか?
>
> 実際にルータとして起動したときのメモなどがあればお教え願えればと思います。
> よろしくお願いします。
>
> 環境としてはこんな感じです
>
> armadillo eth0 192.168.2.230
>       eth1 192.168.3.230
> PC1       192.168.2.1 default gateway→192.168.2.230 
> PC2       192.168.3.1 default gateway→192.168.3.230
>
>
>
> <email@hidden> wrote:
> > こんばんは。
> >
> > 下記のbr0の記述を消すか、コメントアウトしてやってみてください。
> >
> > > auto br0
> > > iface br0 inet static
> > > address 192.168.1.230
> > > netmask 255.255.255.0
> > > broadcast 192.168.1.255
> > > gateway 192.168.1.254
> >
> > 私も230をルーターとして使っていますがとても快適ですよ!
> >
> > 230で2ポートですが、さらに8ポートくらいまでの製品があればインテリジェント・スイッチの自作も出来たりして楽しそうですね。
> >
> > _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> > 小俣光之(Mitsuyuki Komata)
> > 日本シー・エー・ディー株式会社
> >    TEL:03-3565-3011(直)・2011(代)  FAX:03-3565-3611
> > E-Mail: email@hidden
> > Office-URL: http://www.ncad.co.jp/
> > Private-URL: http://www.ncad.co.jp/~komata/
> > _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> > ----- Original Message ----- 
> > From: <email@hidden>
> > To: <email@hidden>
> > Sent: Sunday, October 08, 2006 6:49 PM
> > Subject: [Armadillo:01285] armadillo230のIPアドレス設定について(追記)
> >
> >
> > > すみません。
> > > 先ほどの/etc/config/interfaceは間違いでした
> > > 実際の/etc/config/interfaceはこのような感じです
> > >
> > > auto lo
> > > iface lo inet loopback
> > >
> > > auto eth0
> > > iface eth0 inet static
> > > adderess 192.168.1.230
> > > netmask 255.255.255.0
> > > broadcast 192.168.1.255
> > > gateway 192.168.1.254
> > >
> > > auto eth1
> > > iface eth1 inet static
> > > address 192.168.11.230
> > > netmask 255.255.255.0
> > > broadcast 192.168.11.255
> > > gateway 192.168.11.254
> > >
> > > auto br0
> > > iface br0 inet static
> > > address 192.168.1.230
> > > netmask 255.255.255.0
> > > broadcast 192.168.1.255
> > > gateway 192.168.1.254
> > >
> > > ご存知であれば、返答やアドバイスなど宜しくお願いします
> > > _______________________________________________
> > > armadillo mailing list
> > > email@hidden
> > > http://lists.atmark-techno.com/mailman/listinfo/armadillo
> >
> > _______________________________________________
> > armadillo mailing list
> > email@hidden
> > http://lists.atmark-techno.com/mailman/listinfo/armadillo
> >
> _______________________________________________
> armadillo mailing list
> email@hidden
> http://lists.atmark-techno.com/mailman/listinfo/armadillo




armadillo メーリングリストの案内