特殊:Badtitle/NS100:NetworkConfigurationCommandLine

来自Ubuntu中文
Wikibot留言 | 贡献2008年10月20日 (一) 00:09的版本
跳到导航跳到搜索
可打印版本不再受到支持且可能有渲染错误。请更新您的浏览器书签并改用浏览器默认打印功能。

{{#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].