[size=medium][color=blue]为网卡配置静态IP地址
sudo gedit /etc/network/interfaces
新增一下内容
auto eth0
iface eth0 inet static
address 192.168.1.188
gateway 192.168.1.1
netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
sudo ifconfig eth0 down
sudo ifconfig eth0 up
设置主机名称(hostname) --可选
查看当前主机的主机名称:
sudo /bin/hostname
设置当前主机的主机名称:
sudo /bin/hostname newname
系统启动时,它会从/etc/hostname来读取主机的名称.
配置DNS
sudo gedit /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1
sudo /etc/init.d/networking restart[/color][/size]
sudo gedit /etc/network/interfaces
新增一下内容
auto eth0
iface eth0 inet static
address 192.168.1.188
gateway 192.168.1.1
netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
sudo ifconfig eth0 down
sudo ifconfig eth0 up
设置主机名称(hostname) --可选
查看当前主机的主机名称:
sudo /bin/hostname
设置当前主机的主机名称:
sudo /bin/hostname newname
系统启动时,它会从/etc/hostname来读取主机的名称.
配置DNS
sudo gedit /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1
sudo /etc/init.d/networking restart[/color][/size]