网络相关知识

1.DHCP配置IP
sudo vi /etc/network/interfaces
# The primary network interface use DHCP to find our address
auto eth0
iface eth0 inet dhcp
sudo /etc/init.d/networking restart 

2.配置静态IP

sudo vi /etc/network/interfaces
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.7
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
sudo /etc/init.d/networking restart 

3.配置DNS

sudo vi /etc/resolv.conf
search test.com
nameserver 192.168.1.10




你可能感兴趣的:(网络相关知识)