I have followed Linux From Scratch 8.2. I have a laptop with an ethernet port with a plugged-in ethernet cable that I'm trying to use to ping google and get a response. I have a network interface with the name enp0s25, and my default gateway address is 192.168.178. I am trying to use the IP address 192.168.1.2 (there is no specific reason I'm using this IP address - can I just pick one?).
During boot I get the message:
Setting up default gateway...RTNETLINK answers: Network unreachable
Now, ping doesn't work:
Code:
> ping -c 4 google.com
ping: unknown host
> ping 192.168.178.1
ping: sending packet: Network is unreachable
Although I can ping the default gateway after adding it:
Code:
> ip addr add 192.168.178.1 dev enp0s25
> ping -c 1 192.168.178.1
PING 192.168.178.1 (192.168.178.1): 56 data bytes
64 bytes from 192.168.178.1: icmp_seq=0 ttl=64 time=0.045 ms
--- 192.168.178.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.045/0.045/0.045/0.000 ms
> ping google.com
ping: unknown host
I am probably doing something wrong. In particular, I don't know if the IP address I'm picking is okay or not. Help is greatly appreciated.
/etc/sysconfig/ifconfig.enp0s25
Code:
ONBOOT=yes
IFACE=enp0s25
SERVICE=ipv4-static
IP=192.168.1.2
GATEWAY=192.168.178.1
PREFIX=24
BROADCAST=192.168.1.255
/etc/resolve.conf
Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
/etc/hostname
/etc/hosts
Code:
127.0.0.1 localhost
192.168.1.2 lgs.mydomain.org lfs