特殊:Badtitle/NS100:NetworkConfigurationCommandLine:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第16行: | 第16行: | ||
The above example sets the MTU for device eth0 to 1492, the usual MTU for a PPPoE ISP connection. | The above example sets the MTU for device eth0 to 1492, the usual MTU for a PPPoE ISP connection. | ||
For a wireless device, you must replace 'ifconfig' with 'iwconfig' in the 'pre-up' command. | For a wireless device, you must replace 'ifconfig' with 'iwconfig' in the 'pre-up' command. | ||
This tip was found on | This tip was found on [http://glasnost.beeznest.org/articles/290]. | ||
---- | ---- | ||
[[category:CategoryCleanup]] [[category:CategoryNetworking]] [[category:CategoryWireless]] | [[category:CategoryCleanup]] [[category:CategoryNetworking]] [[category:CategoryWireless]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2008年10月20日 (一) 00:09的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/NetworkConfigurationCommandLine }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/af | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Afrikaans| [[::NetworkConfigurationCommandLine/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/ar | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|العربية| [[::NetworkConfigurationCommandLine/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/az | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|azərbaycanca| [[::NetworkConfigurationCommandLine/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/bcc | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|جهلسری بلوچی| [[::NetworkConfigurationCommandLine/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/bg | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|български| [[::NetworkConfigurationCommandLine/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/br | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|brezhoneg| [[::NetworkConfigurationCommandLine/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/ca | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|català| [[::NetworkConfigurationCommandLine/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/cs | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|čeština| [[::NetworkConfigurationCommandLine/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/de | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Deutsch| [[::NetworkConfigurationCommandLine/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/el | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Ελληνικά| [[::NetworkConfigurationCommandLine/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/es | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|español| [[::NetworkConfigurationCommandLine/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/fa | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|فارسی| [[::NetworkConfigurationCommandLine/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/fi | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|suomi| [[::NetworkConfigurationCommandLine/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/fr | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|français| [[::NetworkConfigurationCommandLine/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/gu | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|ગુજરાતી| [[::NetworkConfigurationCommandLine/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/he | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|עברית| [[::NetworkConfigurationCommandLine/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/hu | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|magyar| [[::NetworkConfigurationCommandLine/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/id | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Bahasa Indonesia| [[::NetworkConfigurationCommandLine/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/it | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|italiano| [[::NetworkConfigurationCommandLine/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/ja | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|日本語| [[::NetworkConfigurationCommandLine/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/ko | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|한국어| [[::NetworkConfigurationCommandLine/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/ksh | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Ripoarisch| [[::NetworkConfigurationCommandLine/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/mr | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|मराठी| [[::NetworkConfigurationCommandLine/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/ms | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Bahasa Melayu| [[::NetworkConfigurationCommandLine/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/nl | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Nederlands| [[::NetworkConfigurationCommandLine/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/no | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|norsk| [[::NetworkConfigurationCommandLine/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/oc | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|occitan| [[::NetworkConfigurationCommandLine/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/pl | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|polski| [[::NetworkConfigurationCommandLine/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/pt | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|português| [[::NetworkConfigurationCommandLine/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/ro | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|română| [[::NetworkConfigurationCommandLine/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/ru | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|русский| [[::NetworkConfigurationCommandLine/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/si | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|සිංහල| [[::NetworkConfigurationCommandLine/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/sq | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|shqip| [[::NetworkConfigurationCommandLine/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/sr | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|српски / srpski| [[::NetworkConfigurationCommandLine/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/sv | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|svenska| [[::NetworkConfigurationCommandLine/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/th | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|ไทย| [[::NetworkConfigurationCommandLine/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/tr | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Türkçe| [[::NetworkConfigurationCommandLine/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/vi | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|Tiếng Việt| [[::NetworkConfigurationCommandLine/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/yue | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|粵語| [[::NetworkConfigurationCommandLine/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/zh | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|中文| [[::NetworkConfigurationCommandLine/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/zh-hans | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|中文(简体)| [[::NetworkConfigurationCommandLine/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:NetworkConfigurationCommandLine | UbuntuHelp:NetworkConfigurationCommandLine | {{#if: | :}}NetworkConfigurationCommandLine}}/zh-hant | • {{#if: UbuntuHelp:NetworkConfigurationCommandLine|中文(繁體)| [[::NetworkConfigurationCommandLine/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:NetworkConfigurationCommandLine|:NetworkConfigurationCommandLine|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :NetworkConfigurationCommandLine/zh | | {{#ifexist: NetworkConfigurationCommandLine/zh | | {{#ifeq: {{#titleparts:NetworkConfigurationCommandLine|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:NetworkConfigurationCommandLine|1|-1|}} | zh | | }}
Howto Configure the Network device
The ifconfig
tool can set the IP-Address of your network device.
sudo ifconfig eth0 192.168.0.xxx
... or whatever you need as IP-Address.
The iwconfig
tool is for configuring WLAN devices.
Note: These commands will configure your device for the current session, but changes will be lost when you reboot.
Howto Permanently Configure the Network device
To permanently configure your network devices you need to edit the /etc/network/interfaces file. (Type 'man 5 interfaces' to see the manual for the available commands).
Howto Set MTU for a DHCP Connection
Although this is not documented in the manual for interfaces, MTU for a DHCP connected device can be set in the /etc/network/interfaces file. To do so you need to append the 'pre-up' command to the 'iface' section of the relevent interface. eg: iface eth0 inet dhcp pre-up /sbin/ifconfig $IFACE mtu 1492 The above example sets the MTU for device eth0 to 1492, the usual MTU for a PPPoE ISP connection. For a wireless device, you must replace 'ifconfig' with 'iwconfig' in the 'pre-up' command. This tip was found on [1].