[Go]ubuntu Server Internet configuration
Http://blog.sina.com.cn/s/blog_6c9d65a101011pyt.html
Today my Ubuntu server does not go to the net, so reconfigure it, just to tidy up a bit:
One, view network configuration status ifconfig-a Two, configure DHCP client modification:/etc/network/interface file Auto loiface lo inet loop back
Auto Eth0
iface eth0 inet DHCPEth0 is the connection settings, according to the actual situation set, I do not go to the net today because Eth0 became eth1 three, configure static Ipsudo Vim/etc/network/interface auto Eth0iface eth0 inet Staticaddress 192.168.1.4netmask 255.255.255.0gateway 192.168.1.1//This is the configuration IP address, 硽 code, gateway. Iv. Configuration effective reboot the network to sudo/etc/init.d/networking Restart can also restart the NIC: sudo ifdown eth0sudo ifup eht0 If you log in from the remote, the Ifdown eth0 will break the connection. V. Temporarily change the configuration in the recovery interface after the IP address system restarts sudo ifconfig eth0 192.168.1.3 VI, set the default gateway (1) Modify the/etc/network/interface profile auto Eth0address 192.168.1.4netmask 255.255.255.0
Gateway 192.168.1.1(2) Use the command settings to delete the default gateway sudo route del default GW 192.168.1.1//192.168.1.1 is the original gateway that can route view Gateway add Gateway sudo route add default GW 192.1 68.1.2,547, modify the computer (host) name (1) view hostname (2) Modify sudo hostname newcomputername This is only temporary modification, if permanent modification can modify the configuration file sudo vim/etc/ Hostname Modify the host name inside. Eight, set the address of the DNS server Sudi vi/etc/resolv.confnameserver 202.98.5.68nameserver 202.98.0.68nameserver 192.168.1.1 a maximum of 3 DNS servers can be set
[Go]ubuntu Server Internet configuration