Loading...

2010-05-05

Ubuntu Tips: How To Disable IPv6 in Ubuntu 10.04

Ubuntu 10.04 Lucid Lynx 関連の小技をひとつ。

Reference: How To Disable IPv6 In Ubuntu 10.04 Lucid Lynx:
Posted by Andrew | 03 May, 2010

I'm not sure if IPv6 in Ubuntu 10.04 Lucid Lynx is still causing issues with the Internet connection being slow and so on, but in case it does here's how to disable it.


◆ Ipv6 はデフォルトで有効になっている。チェックするには、端末を起動して、次のコマンドを与えるとよい。
To check if IPv6 is disabled, run the following command:


 baian@lucid-lynx:~$
 cat /proc/sys/net/ipv6/conf/all/disable_ipv6
  0
  0 means it's enabled and 1 - disabled.

This tweak is thanks to an old comment from Stonecut (this way you don't have to edit the GRUB).

◆ 基本的に、Ubuntu 10.04 Lucid Lynx で IPv6 を無効にするためには、/etc/sysctl.conf を編集して、以下に記述した数行を追記するとよい。

Basically, to disable IPv6 in Ubuntu 10.04 Lucid Lynx, you have to add the following lines to /etc/sysctl.conf:


 baian@lucid-lynx:~$ sudo vi /etc/sysctl.conf

# To disable IPv6 in Ubuntu 10.04 Lucid Lynx,
# add the following lines; 
 net.ipv6.conf.all.disable_ipv6 = 1
 net.ipv6.conf.default.disable_ipv6 = 1
 net.ipv6.conf.lo.disable_ipv6 = 1
     ※ typo: Above command line; $ pfexec ; correction -->> $ sudo
        mod.date: Aug/22/2011 06:37 JST.   
◆ 上述の /etc/sysctl.conf の編集作業を コマンドラインで操作するには、端末を開いて以下のスクリプトをコピー&ペーストすればよい。
To do it from the command line, paste this in a terminal:

 baian@lucid-lynx:~$ 
 echo '#disable ipv6' | sudo tee -a /etc/sysctl.conf
 echo 'net.ipv6.conf.all.disable_ipv6 = 1' | sudo tee -a /etc/sysctl.conf
 echo 'net.ipv6.conf.default.disable_ipv6 = 1' | sudo tee -a /etc/sysctl.conf
 echo 'net.ipv6.conf.lo.disable_ipv6 = 1' | sudo tee -a /etc/sysctl.conf


◆ ここで一旦システムを再起動して、本稿のはじめに記述した IPv6 チェックコマンドを与えて、IPv6 が無効になっていることを確認する。
Then reboot and check if IPv6 has been disabled with the command in the beginning of the post.


 baian@lucid-lynx:~$
  cat /proc/sys/net/ipv6/conf/all/disable_ipv6
 1 
  ※ ここで、IPv6 は無効化された。(返り値= 1)
  0 means it's enabled and 1 - disabled.

If for some reason IPv6 still shows up as enabled in Ubuntu 10.04 Lucid Lynx, you can use the method described in THIS post.

This tweak (and others) will go into Ubuntu 10.04 Start script (I don't know why I didn't think of this before).

  • To disable the DNS by IPv6 with Firefox 3.6.3 on Ubuntu 10.04 Lucid Lynx
Ubuntu 10.04 をインストール直後の FireFoxのブラウジングが異様に遅い・・・DNSの名前解決がやたら遅い。
どうやらIPv6での接続を試みて、失敗するとIPv4の接続に切り替えているようだ。

◇ 回避策として、
  1. FireFox のアドレスバーに「about:config」と入力してエンター。
    「動作保証対象外になります」という警告ダイアログのあるページが表示されるので、設定を変更する場合は「細心の注意を払って使用する」ボタンをクリックする。
  2. 設定の一覧画面が表示される。フィルター(F) 窓に IPv6 と入力する。「network.dns.disableIPv6」という設定名が検索表示される。
  3. 表示された「network.dns.disableIPv6」という設定名をダブルクリックして、値を「True」に変更する。
    こうすることで、IPv6 での名前解決が無効となり、最初から IPv4 での名前解決を行うことになる。
  4. FireFox を再起動する。多少なりとも軽快になったようだ。・・・おまじないか・・・


これも参考まで:Ubuntu 日本語フォーラム【HowTo】Firefoxを高速化する設定

1 Comments::

Baian said...

Sorry typo:
baian@lucid-lynx:~$ pfexec vi /etc/sysctl.conf

correction - >>>

baian@lucid-lynx:~$ sudo vi /etc/sysctl.conf