个人工具

“UbuntuHelp:NetworkConfigurationCommandLine”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/NetworkConfigurationCommandLine}} {{Languages|UbuntuHelp:NetworkConfigurationCommandLine}} === Howto Configure the Network device === The <code><...)
 
第2行: 第2行:
 
{{Languages|UbuntuHelp:NetworkConfigurationCommandLine}}
 
{{Languages|UbuntuHelp:NetworkConfigurationCommandLine}}
 
=== Howto Configure the Network device ===
 
=== Howto Configure the Network device ===
 
 
The <code><nowiki>ifconfig</nowiki></code> tool can set the IP-Address of your network device.
 
The <code><nowiki>ifconfig</nowiki></code> tool can set the IP-Address of your network device.
 
* <code><nowiki>sudo ifconfig eth0 192.168.0.xxx</nowiki></code> ... or whatever you need as IP-Address.
 
* <code><nowiki>sudo ifconfig eth0 192.168.0.xxx</nowiki></code> ... or whatever you need as IP-Address.
 
 
The <code><nowiki>iwconfig</nowiki></code> tool is for configuring WLAN devices.
 
The <code><nowiki>iwconfig</nowiki></code> 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.
 
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 ===
 
=== Howto Permanently Configure the Network device ===
 
 
To permanently configure your network devices you need to edit the /etc/network/interfaces file.
 
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).
 
(Type 'man 5 interfaces' to see the manual for the available commands).
 
 
 
=== Howto Set MTU for a DHCP Connection ===
 
=== 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.
 
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:  
 
eg:  
 
iface eth0 inet dhcp
 
iface eth0 inet dhcp
 
pre-up /sbin/ifconfig $IFACE mtu 1492
 
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.
 
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 [http://glasnost.beeznest.org/articles/290].
 
This tip was found on [http://glasnost.beeznest.org/articles/290].
 
 
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 20:47的版本

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