In ubuntu 8.10, gnome is used by default, and DHCP is used by default to automatically obtain IP addresses. Set the static IP address and restart it.
1. Set IP
Sudo gedit/etc/Network/interfaces
Auto Lo
Iface lo Inet loopback # Lo is the local loopback address: 127.1
Auto eth0
Iface eth0 Inet static
Address 192.168.1.152
Gateway 192.168.1.1
Netmask 255.255.255.0
Network 192.168.1.0
Broadcast 192.168.1.255 # Set the IP address of eth0
In this way, the IP address does not take effect immediately.
Sudo/etc/init. d/networking restart
2. At this time, you can ping the computer in the LAN. But cannot access the Internet because DNS is not set. The DNS information is saved in/etc/resolv. conf. Once changed, it takes effect immediately.
Sudo gedit/etc/resolv. conf
Nameserver 208.67.222.222
Nameserver 208.67.220.220
Now you can access the Internet.
Attached Nic settings commands:
View Nic information: ifconfig
Set a nic ip Address: ifconfig eth1 192.168.1.10 netmask 255.255.255.0
Restart the NIC to make the settings take effect: sudo/etc/init. d/networking restart
Change MAC address: ifconfig eth0 HW ether XX: xx
View route information: route-n