5.3.4. The network interface served by the DHCP
After prepairing the system by Section 5.2.1, “The DHCP connection with the Ethernet”, the network interface served by the DHCP is configured by creating the configuration entry in the "/etc/network/interfaces
" file as the following.
allow-hotplug eth0 iface eth0 inet dhcp hostname "mymachine"
When the Linux kernel detects the physical interface eth0
, the allow-hotplug
stanza causes ifup
to bring up the interface and the iface
stanza causes ifup
to use DHCP to configure the interface.
5.3.5. The network interface with the static IP
The network interface served by the static IP is configured by creating the configuration entry in the "/etc/network/interfaces
" file as the following.
allow-hotplug eth0 iface eth0 inet static address 192.168.11.100 netmask 255.255.255.0 broadcast 192.168.11.255 gateway 192.168.11.1 dns-domain lan dns-nameservers 192.168.11.1
When the Linux kernel detects the physical interface eth0
, the allow-hotplug
stanza causes ifup
to bring up the interface and the iface
stanza causes ifup
to use the static IP to configure the interface.
Here, I assumed the following.
- IP address range of the LAN network:
192.168.11.0
-192.168.11.255
- IP address of the gateway:
192.168.11.1
- IP address of the PC:
192.168.11.100
- The
resolvconf
package: installed - The domain name: "
lan
" - IP address of the DNS server:
192.168.11.1
When the resolvconf
package is not installed, DNS related configuration needs to be done manually by editing the "/etc/resolv.conf
" as the following.
nameserver 192.168.11.1 domain lan
Caution | |
---|---|
The IP addresses used in the above example are not meant to be copied literally. You have to adjust IP numbers to your actual network configuration. |
댓글 없음:
댓글 쓰기