In my office I want to connect my Ubuntu 18.04 laptop to ethernet. All my colleagues are using Windows 10 laptops without any problems, I am the only guy with an Ubuntu laptop.
The DHCP server returns a default gateway of 192.168.2.0. But my laptop does not accept this gateway. When I try to add the default gateway I get the following error message:
sudo route add default gw 192.168.2.0 dev eth0
SIOCADDRT: Network is unreachableOutput from dhclient:
sudo dhclient -v eth0
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit
Listening on LPF/eth0/28:f1:0e:0a:de:34
Sending on LPF/eth0/28:f1:0e:0a:de:34
Sending on Socket/fallback
DHCPREQUEST of 192.168.2.169 on eth0 to 255.255.255.255 port 67 (xid=0x6bb234ba)
DHCPACK of 192.168.2.169 from 192.168.2.0
RTNETLINK answers: File exists
bound to 192.168.2.169 -- renewal in 14325 seconds.Wireshark capture of dhcp ACK packet:
Frame 6: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: Lancom_2a:35:48 (xx:xx:xx:xx:xx:xx), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 192.168.2.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 67, Dst Port: 68
Bootstrap Protocol (ACK) Message type: Boot Reply (2) Hardware type: Ethernet (0x01) Hardware address length: 6 Hops: 0 Transaction ID: 0x4b1a125c Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) 0... .... .... .... = Broadcast flag: Unicast .000 0000 0000 0000 = Reserved flags: 0x0000 Client IP address: 0.0.0.0 Your (client) IP address: 192.168.2.169 Next server IP address: 192.168.2.0 Relay agent IP address: 0.0.0.0 Client MAC address: Dell_0a:de:34 (28:f1:0e:0a:de:34) Client hardware address padding: 00000000000000000000 Server host name not given Boot file name not given Magic cookie: DHCP Option: (53) DHCP Message Type (ACK) Length: 1 DHCP: ACK (5) Option: (54) DHCP Server Identifier Length: 4 DHCP Server Identifier: 192.168.2.0 Option: (1) Subnet Mask Length: 4 Subnet Mask: 255.255.255.0 Option: (3) Router Length: 4 Router: 192.168.2.0 Option: (6) Domain Name Server Length: 4 Domain Name Server: 192.168.2.0 Option: (15) Domain Name Length: 6 Domain Name: intern Option: (28) Broadcast Address Length: 4 Broadcast Address: 192.168.2.255 Option: (51) IP Address Lease Time Length: 4 IP Address Lease Time: (30000s) 8 hours, 20 minutes Option: (255) End Option End: 255 Padding: 000000000000000000000000Output of command ipconfig /all on a windows laptop connected to the same network:
Connection-specific DNS Suffix . : intern Description . . . . . . . . . . . : Intel(R) Ethernet Connection (2) I219-LM Physical Address. . . . . . . . . : xx-xx-xx-xx-xx-xx DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IPv4 Address. . . . . . . . . . . : 192.168.2.9(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : Freitag, 30. August 2019 09:15:13 Lease Expires . . . . . . . . . . : Freitag, 30. August 2019 23:59:39 Default Gateway . . . . . . . . . : 192.168.2.0 DHCP Server . . . . . . . . . . . : 192.168.2.0 DNS Servers . . . . . . . . . . . : 192.168.2.0 NetBIOS over Tcpip. . . . . . . . : Enabled 11 1 Answer
Well you wont be able to add 192.168.2.0 as a GW if this is a /24 network. In /24 this is network address. Broadcast is at 192.168.2.255. If the router is using this as it's IP then you must have DHCP misconfigured. You probably want a /23 network in this case.
4