Linux basic course - Networking fundamentals

Hi Team,

I have a doubt when adding a default route to the host. I had a lab session in networking where i have to add a default route via eth0. When i checked eth0 is – when i add this im getting error nexthop is invalid. I did a route as well eth0 ip is but in the solution it is showing as – didnt get this point. I dont see this ip anywhere is this the switch or router ip ?

The IP address that you mentioned is actually a network address for the subnet, assuming a subnet mask of (or /24 in CIDR notation). Network addresses are used to identify subnets and cannot be assigned to hosts (including routers and switches) as their IP addresses.

In that case, how can we identify the router’s ip address correctly. Since is a network address and is a broadcast ip. Within this subnet range there can be many devices. If I need to identify the router’s ip address correctly how to do that? like in the solution it shows → does router always has the first ip in the subnet range or how does it work ?

The router could be anywhere on the subnet, though typically it is at .1 or .254.