特殊:Badtitle/NS100:BridgingNetworkInterfaces
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/BridgingNetworkInterfaces }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/af | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Afrikaans| [[::BridgingNetworkInterfaces/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/ar | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|العربية| [[::BridgingNetworkInterfaces/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/az | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|azərbaycanca| [[::BridgingNetworkInterfaces/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/bcc | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|جهلسری بلوچی| [[::BridgingNetworkInterfaces/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/bg | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|български| [[::BridgingNetworkInterfaces/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/br | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|brezhoneg| [[::BridgingNetworkInterfaces/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/ca | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|català| [[::BridgingNetworkInterfaces/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/cs | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|čeština| [[::BridgingNetworkInterfaces/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/de | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Deutsch| [[::BridgingNetworkInterfaces/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/el | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Ελληνικά| [[::BridgingNetworkInterfaces/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/es | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|español| [[::BridgingNetworkInterfaces/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/fa | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|فارسی| [[::BridgingNetworkInterfaces/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/fi | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|suomi| [[::BridgingNetworkInterfaces/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/fr | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|français| [[::BridgingNetworkInterfaces/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/gu | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|ગુજરાતી| [[::BridgingNetworkInterfaces/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/he | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|עברית| [[::BridgingNetworkInterfaces/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/hu | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|magyar| [[::BridgingNetworkInterfaces/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/id | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Bahasa Indonesia| [[::BridgingNetworkInterfaces/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/it | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|italiano| [[::BridgingNetworkInterfaces/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/ja | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|日本語| [[::BridgingNetworkInterfaces/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/ko | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|한국어| [[::BridgingNetworkInterfaces/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/ksh | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Ripoarisch| [[::BridgingNetworkInterfaces/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/mr | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|मराठी| [[::BridgingNetworkInterfaces/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/ms | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Bahasa Melayu| [[::BridgingNetworkInterfaces/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/nl | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Nederlands| [[::BridgingNetworkInterfaces/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/no | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|norsk| [[::BridgingNetworkInterfaces/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/oc | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|occitan| [[::BridgingNetworkInterfaces/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/pl | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|polski| [[::BridgingNetworkInterfaces/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/pt | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|português| [[::BridgingNetworkInterfaces/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/ro | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|română| [[::BridgingNetworkInterfaces/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/ru | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|русский| [[::BridgingNetworkInterfaces/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/si | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|සිංහල| [[::BridgingNetworkInterfaces/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/sq | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|shqip| [[::BridgingNetworkInterfaces/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/sr | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|српски / srpski| [[::BridgingNetworkInterfaces/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/sv | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|svenska| [[::BridgingNetworkInterfaces/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/th | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|ไทย| [[::BridgingNetworkInterfaces/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/tr | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Türkçe| [[::BridgingNetworkInterfaces/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/vi | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|Tiếng Việt| [[::BridgingNetworkInterfaces/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/yue | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|粵語| [[::BridgingNetworkInterfaces/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/zh | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|中文| [[::BridgingNetworkInterfaces/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/zh-hans | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|中文(简体)| [[::BridgingNetworkInterfaces/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BridgingNetworkInterfaces | UbuntuHelp:BridgingNetworkInterfaces | {{#if: | :}}BridgingNetworkInterfaces}}/zh-hant | • {{#if: UbuntuHelp:BridgingNetworkInterfaces|中文(繁體)| [[::BridgingNetworkInterfaces/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:BridgingNetworkInterfaces|:BridgingNetworkInterfaces|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :BridgingNetworkInterfaces/zh | | {{#ifexist: BridgingNetworkInterfaces/zh | | {{#ifeq: {{#titleparts:BridgingNetworkInterfaces|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:BridgingNetworkInterfaces|1|-1|}} | zh | | }}
I struggled to find the right information, so I think this might be useful! If you want to write to me directly, my e-mail is on my wiki page at Ubuntu:HervéFache.
Also, consider this article: [1] on the same subject.
Installing bridge utilities
You will need the bridge utilities for that, which all you need to do is install the bridge-utils package.
apt-get install bridge-utils
Setting up bridge utilities
With no further ado, this is my /etc/network/interfaces file:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback address 127.0.0.1 netmask 255.0.0.0 # This is a list of hotpluggable network interfaces. # They will be activated automatically by the hotplug subsystem. auto eth0 auto ath0 auto br0 # The internet network interface iface eth0 inet dhcp # The wireless side of the bridge iface ath0 inet manual wireless-essid MY_ESSID wireless-key ********** wireless-mode master # The local network bridge iface br0 inet static bridge_ports ath0 eth1 address 192.168.0.2 netmask 255.255.255.0
The explanation is as simple as this file: the system is going to start eth0 (the internet side network interface), ath0 (the wireless network interface) and br0 (the bridge). ath0 being 'manual' and not 'static' or 'dhcp', no IP will be assigned to it, but I need the 'auto' to set the wireless parameters. eth1 is set up automatically as part of the bridge setup.
Note: the bridge takes time to come up. Be patient!
Before you start complaining, you should know that in fact, this does not work for me. For some reason, the atheros wireless interface goes back down in the process. I tried very hard to find a way to bring it back up, and the only one I could rely on was to add this in /etc/rc.local, just before the line containing 'exit 0':
ifconfig ath0 up
This is an ugly hack, but at least it does bring ath0 up...
Note for Edgy users: the madwifi driver does not support setting the mode this way, and even using the required tool did not provide me a working access point.