I change my server's ip from dynamic to static. After I change the file in /etc/network/interfaces with the following code, my server lost connection to internet.
Here's my new network interfaces:
auto eth0
iface eth0 inet static
address 192.168.254.120
netmask 255.255.255.0
network 192.168.254.0
broadcast 192.168.254.255
gateway 192.168.254.1
So after, i restart the networking service my ip in ifconfig change to 192.168.254.120 but when i try to ping any site or my other pc, it doesnt work. I will put here my original ifconfig info just in case someone will ask.
ifconfig
eth0
inet addr: 192.168.254.109
Bcast: 192.168.254.255
Mask: 255.255.255
I hope someone can help me change my server to static ip. Thanks.
Best Answer
I suggest the following /etc/network/interfaces file:
Now get the sytem to read and use the changes:
Check that you can reach the internet: