Ubuntuでブリッジ接続

クロスケーブルを使いましょうwww

eth0とeth1をブリッジ接続しようとして、
/etc/network/interfacesで設定したら、

Don't seem to have all the variables for eth0/inet.
Failed to bring up eth0.
Don't seem to have all the variables for eth1/inet.
Failed to bring up eth1.

あうあうあ〜

どうやら、「static」にすると
記述すべき項目がねぇぞぉと怒られる。
(ググったらstaticの人多いけど。。。)

なので、修正する〜
その前に、

# sysctl -p
 net.ipv4.ip_forward=1
#
# apt-get install bridge-utils


修正前

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 0.0.0.0

auto eth1
iface eth1 inet static
address 0.0.0.0

auto br0
iface br0 inet static
address 192.168.255.254
netmask 255.255.255.0
bridge_ports eth0 eth1
gateway 192.168.255.1
broadcast 192.168.255.255
network 192.168.255.0
dns-nameservers 192.168.255.1

修正後

auto eth0
iface eth0 inet manual
up ifconfig eth0 0.0.0.0 up

auto eth1
iface eth1 inet manual
up ifconfig eth1 0.0.0.0 up

auto br0
iface br0 inet static
address 192.168.255.254
netmask 255.255.255.0
bridge_ports eth0 eth1
gateway 192.168.255.1
broadcast 192.168.255.255
network 192.168.255.0
dns-nameservers 192.168.255.1

これで無事、エラーもなくブリッジ接続できると思います。

*修正 2012/01/06
dns-nameserversを指定してもダメだそうです。。。
なので、

# vi /etc/resolve.conf
nameserver 192.168.255.1

LGA128さん、有難うございました。

使えない理由は
http://wiki.debian.org/NetworkConfiguration
resolvconf
が入ってないと使えないみたいです。
なので、普通にresolve.confに記述が楽ですね。

DHCPにしたいなら

iface br0 inet dhcp

これだけで、addressやらは記述しなくてOK

[tegaki]ネタ提供ありがとうw[/tegaki]

Ubuntuでブリッジ接続」への4件のフィードバック

  1. LGA128

    あ、ネタ取られたww
    なぜかbr0のdns-nameserversに指定しても反映されないんですよね。
    仕方なく /etc/resolv.conf に指定してますが。。

    返信
    1. ねころく 投稿作成者

      コメントありがとうございます

      記事修正しました。
      まぁresolve.confのほうが、
      なんとなく安心ですけどね。

      ディストリはDebianでしたっけ?

      返信
        1. ねころく 投稿作成者

          なるほど。

          GUIは使ったことないですねぇ。。。
          しかも、僕は10.04-LTS使ってますし。。

          返信

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Enter code * Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.