1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ネットが遅い件

Last updated at Posted at 2022-06-16

おそらく10年以上使っていた無線ルーターを交換しました。

nなルーターだったのですが相性が悪かったのか、以前は10Mbpsくらいしかでなかったのですが、やっと20Mbpsくらいでるようになりました。

有線でも20MくらいなのでISPの制限なのかなと思って、ISPのページを見ると20Mなんてサービスはありません。以前は12Mだったのが40Mになっているようです。

40Mなのに20Mしかでないのは詐欺みたいなもんで、電話してクレームを入れようかとおもったのですが、ひょっとしてFreeBSDなfirewallがまずいと赤っ恥なので、ちょっと調べてみる事にしました。

firewallはipfw(nat)とnatdで構築しています。

fw.png

ISPのモデムに直接Win7をつなぐと30Mくらいでます。FreeBSDが悪い可能性が濃厚になってきました。

iperf3で調べると内内の通信でも20Mくらいしかでてません。

# /usr/local/bin/iperf3 -c 10.0.1.37
Connecting to host 10.0.1.37, port 5201
[  5] local 10.0.1.1 port 60451 connected to 10.0.1.37 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  4.45 MBytes  37.3 Mbits/sec    5   58.2 KBytes       
[  5]   1.00-2.00   sec  3.43 MBytes  28.8 Mbits/sec    3   96.7 KBytes       
[  5]   2.00-3.00   sec  3.53 MBytes  29.6 Mbits/sec    7   53.9 KBytes       
[  5]   3.00-4.00   sec  3.52 MBytes  29.5 Mbits/sec    6   38.2 KBytes       
[  5]   4.00-5.00   sec  3.49 MBytes  29.3 Mbits/sec    4   65.3 KBytes       
[  5]   5.00-6.00   sec  3.54 MBytes  29.7 Mbits/sec    6   59.6 KBytes       
[  5]   6.00-7.00   sec  3.52 MBytes  29.5 Mbits/sec    6   52.5 KBytes       
[  5]   7.00-8.00   sec  3.51 MBytes  29.5 Mbits/sec    6   48.2 KBytes       
[  5]   8.00-9.00   sec  3.51 MBytes  29.5 Mbits/sec    6   38.2 KBytes       
[  5]   9.00-10.00  sec  3.46 MBytes  29.0 Mbits/sec    5   62.5 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  36.0 MBytes  30.2 Mbits/sec   54             sender
[  5]   0.00-12.97  sec  35.8 MBytes  23.2 Mbits/sec                  receiver

iperf Done.

おそらくこれに引っかかっているのではないかと思いました。

同系機種は予備にあるのでテストしてみたところ、natdを使ったポートフォワードを行うとパフォーマンスが悪くなるようです。以下はipfwのnatだけで試した状態です。

# /usr/local/bin/iperf3 -c 10.0.1.37
Connecting to host 10.0.1.37, port 5201
[  5] local 10.0.1.1 port 47470 connected to 10.0.1.37 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.02   sec  16.9 MBytes   139 Mbits/sec    0   97.6 KBytes       
[  5]   1.02-2.07   sec  17.5 MBytes   140 Mbits/sec    0   97.6 KBytes       
[  5]   2.07-3.04   sec  16.2 MBytes   140 Mbits/sec    0   97.6 KBytes       
[  5]   3.04-4.02   sec  16.2 MBytes   140 Mbits/sec    0   97.6 KBytes       
[  5]   4.02-5.06   sec  17.5 MBytes   140 Mbits/sec    0   97.6 KBytes       
[  5]   5.06-6.04   sec  16.2 MBytes   140 Mbits/sec    0   97.6 KBytes       
[  5]   6.04-7.02   sec  16.2 MBytes   139 Mbits/sec    0   97.6 KBytes       
[  5]   7.02-8.07   sec  17.5 MBytes   140 Mbits/sec    0   97.6 KBytes       
[  5]   8.07-9.04   sec  16.2 MBytes   140 Mbits/sec    0   97.6 KBytes       
[  5]   9.04-10.01  sec  16.2 MBytes   140 Mbits/sec    0   97.6 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec   167 MBytes   140 Mbits/sec    0             sender
[  5]   0.00-12.80  sec   167 MBytes   109 Mbits/sec                  receiver

iperf Done.

natdはVPNのためのポートフォワードなのですが、必要なときは限られているので、そのときだけnatdを上げる事にしました。

ちょっと人権に近づいたかもしれません。

image.png

FreeBSDではnatdを使わなくてもipfwだけでポートフォワードができるのかもしれませんが、やり方がわかりません。

いろいろ調べていたらlibaliasがまずいってページがあったような気がします。

以前にも調べていて、その後natdを停電対策のため常時起動するようになったので、問題が起きていました。

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?