I have this server for a while, and was present on other questions.
A while ago, I've changed the network and the gateway IP was changed too.
Since then, there is no internet on this machine.
I need access to the internet to update the machine and (sometimes) to install packages I need for development.
What I've tried:
route add default gw 192.168.1.1(https://unix.stackexchange.com/a/259046/133591)ip route replace default via 192.168.1.1(https://unix.stackexchange.com/a/199070/133591)ip route add default via 192.168.1.1 dev eth0(https://unix.stackexchange.com/a/259048/133591)Editing the file
/etc/network/interfaces, to look like below:# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 allow-hotplug eth0 #iface eth0 inet dhcp iface eth0 inet static address 192.168.1.205 netmask 255.255.255.0 gateway 192.168.1.1 broadcast 192.168.1.1
And this is the result of all my attempts:
root@webtest:~# route add default gw 192.168.1.1
SIOCADDRT: Network is unreachable
root@webtest:~# ip route replace default via 192.168.1.1
RTNETLINK answers: Invalid argument
root@webtest:~# ip route add default via 192.168.1.1 dev eth0
RTNETLINK answers: Invalid argument
root@webtest:~#
The most bizarre thing is the SIOCADDRT: Network is unreachable error, when I'm clearly connected using SSH, which used the network.
What else should I try? I don't even know what else to do.
My system is running Debian 8.2 x64, with a single interface network.
Note:
I have read How can I change the default gateway? and How to set the Default gateway (which is where I got all those tries from).
The accepted answer on How can I change the default gateway? is a FreeBDS-exclusive answer.
Running ip addr and ip route gives the following:
root@webtest:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:1a:92:47:00:b5 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.205/24 brd 192.168.1.1 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::21a:92ff:fe47:b5/64 scope link
valid_lft forever preferred_lft forever
root@webtest:~# ip route
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.205
root@webtest:~#
Edit 1:
After the change that @Johan Myréen suggested, the result is still the same.
Below is the updated ip addr with 2 pings:
root@webtest:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:1a:92:47:00:b5 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.205/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::21a:92ff:fe47:b5/64 scope link
valid_lft forever preferred_lft forever
root@webtest:~# ip route
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.205
root@webtest:~# ping google.com
ping: unknown host google.com
root@webtest:~# ping facebook.com
ping: unknown host facebook.com
root@webtest:~#