Linux配置IP地址
----------Centos/RHEL/SUSE:---------
vi /etc/syscnofig/network-script/ifcfg-eth0
IPADDR=10.0.0.1
NETMASK=255.0.0.0
GATEWAY=10.0.0.254
------------- ubuntu-------------
1、ubuntu系統修改IP地址:sudo gedit /etc/network/interfaces
auto eth0
iface eth0 inet static
address 219.218.122.168
netmask 255.255.255.0
gateway 219.218.122.254
2、ubuntu系統修改DNS: sudo gedit /etc/resolv.conf
nameserver 202.194.15.12
3、使網絡生效:sudo /etc/init.d/networking restart
Ubuntu8.04虛擬機更換host主機后開機無法加載網卡,提示:No such device
刪除緩存文件,重啟后解決。
sudo rm /etc/udev/rules.d/70-persistent-net.rules
reboot
Linux配置主機名
臨時,重啟小時
#hostname XXX
永久,需重啟后生效
# vi /etc/sysconfig/network
HOSTNAME=XXX