I was using fixed IP addresses but am having to use DHCP now, and the problem is now happening that if I select the USE DHCP
option for the network, I don't get the gateway IP address.
Lines starting with // are comments - just to clarify.
// With DHCP active.
me@me-desktop:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 eno1
192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eno1
// Note here 4 lines given back. (above)
me@me-desktop:~$ ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.146 netmask 255.255.255.0 broadcast 192.168.0.255
ether 94:c6:91:11:55:10 txqueuelen 1000 (Ethernet)
RX packets 78160 bytes 32127382 (32.1 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 61451 bytes 9398783 (9.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xdc200000-dc220000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 17637 bytes 1350767 (1.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17637 bytes 1350767 (1.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
me@me-desktop:~$ ping 8.8.8.8
ping: connect: Network is unreachable
me@me-desktop:~$
// With Static IP set.
me@me-desktop:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 100 0 0 eno1
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 eno1
192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eno1
// Note here 5 lines given and there is a DEFAULT GATEWAY line.
me@me-desktop:~$ ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.6 netmask 255.255.255.0 broadcast 192.168.0.255
ether 94:c6:91:11:55:10 txqueuelen 1000 (Ethernet)
RX packets 87697 bytes 33731832 (33.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 64112 bytes 9669285 (9.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xdc200000-dc220000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 17998 bytes 1376581 (1.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17998 bytes 1376581 (1.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
me@me-desktop:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=11.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=10.9 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 10.866/11.175/11.485/0.309 ms
Kind of makes using DHCP difficult at best.
How do I get DHCP to work correctly? Thanks in advance.
dhcpdump
(apt-get install dhcpdump
) and start in terminal 1dhcpdump -i eno1
. Execute in a seconed terminaldhclient -i eno1
. You will see some output of dhcpdump. Is a line lineOPTION: 3 ( 4) Routers xx.xx.xx.xx
included? If not your dhcp server is misconfigured else your client.networkctl staus eno1
andip route
.