一:(此种方式修改ip,重启系统后ip恢复原设置)
sudo ifconfig eth0 192.168.2.1 netmask 255.255.255.0
sudo route add default gw 192.168.2.254
sudo /etc/init.d/networking restart
二:
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