Armadilloフォーラム

iptablesのMASQUERADEでエラー

andywolfee

2015年6月8日 18時14分

はじめまして

Armadillo IoTを使ってLAN -> 3Gのルーティング機能を試しておりますが、
iptablesにてマスカレード設定する際に下記のエラーが出てうまくいきません。

#iptables -t nat -A POSTROUTING -o usb0 -s192.168.0.0/24 -j MASQUERADE
iptables v1.4.14: Couldn't load target `MASQUERADE':No such file or directory

下記記事のパッチを当ててあります。
https://armadillo.atmark-techno.com/forum/armadillo/1283

カーネルコンフィグNetwork Optionにて、関連する設定を下記のように有効にしカーネル、ユーザランドを作成、書き込んでいます。

[*] Network packet filtering framework (Netfilter) --->
 [*] Advanced netfilter configuration
  Core Netfilter Configuration --->
    <*> Netfilter connection tracking support

  IP: Netfilter Configuration --->
   <*> IPv4 connection tracking support (required for NAT)
   <*> IP tables support (required for filtering/masq/NAT)
   <*> Packet filtering
    <*> REJECT target support
   <*> Full NAT
    <*> MASQUERADE target support

関連する下記のリンクを参考に、カーネル作成後にユーザランドの再作成などやってみましたが、うまくいきません。
http://armadillo.atmark-techno.com/faq/iptables-target-not-found
http://armadillo.atmark-techno.com/howto/debian-router-2

Armadillo IoTでのルーティング機能設定で、どこか抜け落ちている手順、設定などありましたら、ご教授、宜しくお願いいたします。

コメント

andywolfee

2015年6月8日 18時30分

使用中のカーネルバージョンを追記いたします。現在サイトからダウンロードできる最新版をそれぞれ使用しています。

Linuxカーネル v2.6.26-at25
ユーザーランド v20150424

以上よろしくおねがいします。

> はじめまして
>
> Armadillo IoTを使ってLAN -> 3Gのルーティング機能を試しておりますが、
> iptablesにてマスカレード設定する際に下記のエラーが出てうまくいきません。
>
> #iptables -t nat -A POSTROUTING -o usb0 -s192.168.0.0/24 -j MASQUERADE
> iptables v1.4.14: Couldn't load target `MASQUERADE':No such file or directory
>
> 下記記事のパッチを当ててあります。
> https://armadillo.atmark-techno.com/forum/armadillo/1283
>
> カーネルコンフィグNetwork Optionにて、関連する設定を下記のように有効にしカーネル、ユーザランドを作成、書き込んでいます。
>
> [*] Network packet filtering framework (Netfilter) --->
>  [*] Advanced netfilter configuration
>   Core Netfilter Configuration --->
>     <*> Netfilter connection tracking support
>
>   IP: Netfilter Configuration --->
>    <*> IPv4 connection tracking support (required for NAT)
>    <*> IP tables support (required for filtering/masq/NAT)
>    <*> Packet filtering
>     <*> REJECT target support
>    <*> Full NAT
>     <*> MASQUERADE target support
>
> 関連する下記のリンクを参考に、カーネル作成後にユーザランドの再作成などやってみましたが、うまくいきません。
> http://armadillo.atmark-techno.com/faq/iptables-target-not-found
> http://armadillo.atmark-techno.com/howto/debian-router-2
>
> Armadillo IoTでのルーティング機能設定で、どこか抜け落ちている手順、設定などありましたら、ご教授、宜しくお願いいたします。
>

andywolfee

2015年6月9日 14時11分

本件に付きまして解決しました。
menuconfigユーザランド設定で、下記の設定が抜けていました。

Network Applications --->
 [*] MASQUERADE

設定後、エラーが出なくなったこと確認しました。
お騒がせいたしました。

>使用中のカーネルバージョンを追記いたします。現在サイトからダウンロードできる最新版をそれぞれ使用しています。
>
> Linuxカーネル v2.6.26-at25
> ユーザーランド v20150424
>
> 以上よろしくおねがいします。
>
>
> > はじめまして
> >
> > Armadillo IoTを使ってLAN ->3Gのルーティング機能を試しておりますが、
> >iptablesにてマスカレード設定する際に下記のエラーが出てうまくいきません。
> >
> > #iptables -t nat -A POSTROUTING -o usb0 -s192.168.0.0/24 -j MASQUERADE
> > iptables v1.4.14: Couldn't load target `MASQUERADE':No such file ordirectory
> >
> > 下記記事のパッチを当ててあります。
> > https://armadillo.atmark-techno.com/forum/armadillo/1283
> >
> > カーネルコンフィグNetworkOptionにて、関連する設定を下記のように有効にしカーネル、ユーザランドを作成、書き込んでいます。
> >
> > [*] Network packet filtering framework (Netfilter) --->
> >  [*] Advanced netfilter configuration
> >   Core Netfilter Configuration --->
> >    <*> Netfilter connection tracking support
> >
> >   IP: Netfilter Configuration --->
> >    <*> IPv4 connection tracking support (required for NAT)
> >    <*> IP tables support (required for filtering/masq/NAT)
> >    <*> Packet filtering
> >     <*> REJECT target support
> >    <*> Full NAT
> >     <*> MASQUERADE target support
> >
> >関連する下記のリンクを参考に、カーネル作成後にユーザランドの再作成などやってみましたが、うまくいきません。
> > http://armadillo.atmark-techno.com/faq/iptables-target-not-found
> > http://armadillo.atmark-techno.com/howto/debian-router-2
> >
> > ArmadilloIoTでのルーティング機能設定で、どこか抜け落ちている手順、設定などありましたら、ご教授、宜しくお願いいたします。
> >

at_hanada

2015年6月9日 14時11分

花田です。

解決したというとで良かったです(対応遅れてすみませんでした)。

> iptables v1.4.14: Couldn't load target `MASQUERADE':No such file or directory

このエラーメッセージの場合、/lib/xtables下のファイルにターゲット共有ライブラリが見つからない…ということです。

> Network Applications --->
>  [*] MASQUERADE

これをenableにすることで、/lib/xtables/libipt_MASQUERADE.soがインストールされ解決された…という理屈になります。
(Atmark DistではROM容量を節約するため、こういった共有ライブラリやアドオンファイルを、任意にインストール選択可能にしていることがあります。アプリケーションによりエラーメッセージ表示のされ方は異なりますが、「No such file or directory」の場合は今回のものに類似したケースであることも多いです)