- 论坛徽章:
- 0
|
Q. Can you explain how to setup network parameters such as IP address, subnet, dhcp etc using /etc/network/interfaces file?
A. /etc/network/interfaces file contains network interface configuration information for the both Ubuntu and Debian Linux. This is where you configure how your system is connected to the network.
Defining physical interfaces such as eth0Lines beginning with the word "auto" are used to identify the physical interfaces to be brought up when ifup is run with the -a option. (This option is used by the system boot scripts.) Physical interface names should follow the word "auto" on the same line. There can be multiple "auto" stanzas. ifup brings the named inter faces up in the order listed. For example following example setup eth0 (first network interface card) with 192.168.1.5 IP address and gateway (router) to 192.168.1.254:iface eth0 inet staticaddress 192.168.1.5netmask 255.255.255.0gateway 192.168.1.254
Setup interface to dhcpTo setup eth0 to dhcp, enter:auto eth0iface eth0 inet dhcp
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/8059/showart_2026318.html |
|