Discussion:
[PLUG] Set up default gateway in kernel routing table
Rich Shepard
2018-09-27 16:44:59 UTC
Permalink
Having been a while since I last set routes I've lost a step when setting
the default gateway.

The routing table has both loopback and LAN routes. Now I need to set the
default gateway and the kernel tells me there's a SIOCADDRT (address) error.

In slackware's rc.inet1.conf interface configuration file the default
gateway is set on 192.168.55.4. Using this command:

route add default gw 192.168.55.4

returns the above error that the network is unreachable.

The route man page example has a host name for the gateway and I've tried
that, too, with the same result.

What have I missed here?

On a curious, somewhat related issue, while there's only one Ethernet port
on the motherboard ifconfig sees it as eth1 rather than eth0.

Rich
Louis Kowolowski
2018-09-27 16:52:13 UTC
Permalink
The gateway has to relate to an subnet that is configured on an interface.
If you want to make the default route 192.168.55.4, one interface (physical, or logical) must be on the 192.168.xxx.xxx subnet, where 192.168.55.4 is included.
For example, if the subnet is 192.168.55.0/24, then your interface would need also be in the 192.168.55.0/24 block. If the gateway is .4, and there are no other hosts/devices, your computer's interface could be configured with any IP between 192.168.55.1-3, 192.168.55.5-254.
Post by Rich Shepard
Having been a while since I last set routes I've lost a step when setting
the default gateway.
The routing table has both loopback and LAN routes. Now I need to set the
default gateway and the kernel tells me there's a SIOCADDRT (address) error.
In slackware's rc.inet1.conf interface configuration file the default
route add default gw 192.168.55.4
returns the above error that the network is unreachable.
The route man page example has a host name for the gateway and I've tried
that, too, with the same result.
What have I missed here?
On a curious, somewhat related issue, while there's only one Ethernet port
on the motherboard ifconfig sees it as eth1 rather than eth0.
Rich
_______________________________________________
PLUG mailing list
http://lists.pdxlinux.org/mailman/listinfo/plug
--
Louis Kowolowski ***@cryptomonkeys.org
Cryptomonkeys: http://www.cryptomonkeys.com/

Making life more interesting for people since 1977
Rich Shepard
2018-09-27 17:51:19 UTC
Permalink
Post by Louis Kowolowski
The gateway has to relate to an subnet that is configured on an interface.
If you want to make the default route 192.168.55.4, one interface
(physical, or logical) must be on the 192.168.xxx.xxx subnet, where
192.168.55.4 is included. For example, if the subnet is 192.168.55.0/24,
then your interface would need also be in the 192.168.55.0/24 block. If
the gateway is .4, and there are no other hosts/devices, your computer's
interface could be configured with any IP between 192.168.55.1-3,
192.168.55.5-254.
Thought I wrote this. The network is 192.168.0.0. This host is
192.168.55.7, and the netmask is 255.255.255.0.

The kernel routing table on my current desktop is:

# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default router1.appl-ec 0.0.0.0 UG 1 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
192.168.0.0 * 255.255.0.0 U 0 0 0 eth0

I'm trying to set the default gateway on the new desktop which already has
the loopback and network routes as above (except on that host the interface
is eth1).

Rich
Rich Shepard
2018-09-27 17:55:56 UTC
Permalink
Post by Rich Shepard
Thought I wrote this. The network is 192.168.0.0. This host is
192.168.55.7, and the netmask is 255.255.255.0.
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default router1.appl-ec 0.0.0.0 UG 1 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
192.168.0.0 * 255.255.0.0 U 0 0 0 eth0
Just tried again:

route add default gw 192.168.55.4 eth1

and get the SIOCADDRT: network not reachable

error.

From the new desktop I can ping the old desktop, but not the router.

Rich
Louis Kowolowski
2018-09-27 18:03:08 UTC
Permalink
Post by Rich Shepard
Post by Louis Kowolowski
The gateway has to relate to an subnet that is configured on an interface.
If you want to make the default route 192.168.55.4, one interface
(physical, or logical) must be on the 192.168.xxx.xxx subnet, where
192.168.55.4 is included. For example, if the subnet is 192.168.55.0/24,
then your interface would need also be in the 192.168.55.0/24 block. If
the gateway is .4, and there are no other hosts/devices, your computer's
interface could be configured with any IP between 192.168.55.1-3,
192.168.55.5-254.
Thought I wrote this. The network is 192.168.0.0. This host is
192.168.55.7, and the netmask is 255.255.255.0.
The IP 192.168.55.7 is NOT in the network 192.168.0.0/24 (mask of 255.255.255.0)
The only valid IPs in 192.168.0.0/24 are 192.168.0.1-255 (don't try to allocate .255, its used).
Post by Rich Shepard
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default router1.appl-ec 0.0.0.0 UG 1 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
192.168.0.0 * 255.255.0.0 U 0 0 0 eth0
I'm trying to set the default gateway on the new desktop which already has
the loopback and network routes as above (except on that host the interface
is eth1).
Rich
_______________________________________________
PLUG mailing list
http://lists.pdxlinux.org/mailman/listinfo/plug
--
Louis Kowolowski ***@cryptomonkeys.org
Cryptomonkeys: http://www.cryptomonkeys.com/

Making life more interesting for people since 1977
Rich Shepard
2018-09-27 18:26:52 UTC
Permalink
Post by Louis Kowolowski
The IP 192.168.55.7 is NOT in the network 192.168.0.0/24 (mask of
255.255.255.0) The only valid IPs in 192.168.0.0/24 are 192.168.0.1-255
(don't try to allocate .255, its used).
Louis,

Mea culpa for not noticing this! Thanks for pointing out the obvious to
me.

How do I delete the 192.168.0.0 route? Typing 'route del network
192.168.0.0 eth1' returns 'network: host name lookup failure'.

Regards,

Rich
Rich Shepard
2018-09-27 18:43:16 UTC
Permalink
Post by Rich Shepard
How do I delete the 192.168.0.0 route? Typing 'route del network
192.168.0.0 eth1' returns 'network: host name lookup failure'.
Part of the problem, or the entire problem, seems to be that eth1 has no
inet(4) address, only an inet6 address.

I don't know where this originates as /etc/rc.d/rc.inet1.conf has eth1
configured for 192.168.55.7 netmask 255.255.255.0, and the default gateway
is 192.168.55.4.

Rich
Rich Shepard
2018-09-27 18:48:43 UTC
Permalink
Post by Rich Shepard
Part of the problem, or the entire problem, seems to be that eth1 has no
inet(4) address, only an inet6 address.
I don't know where this originates as /etc/rc.d/rc.inet1.conf has eth1
configured for 192.168.55.7 netmask 255.255.255.0, and the default gateway
is 192.168.55.4.
I'll close this thread and move it to the slackware forum on LQ.

Rich
Rich Shepard
2018-09-27 19:03:35 UTC
Permalink
Post by Rich Shepard
I'll close this thread and move it to the slackware forum on LQ.
The system took awhile to delete the incorrect default route. Just now I
looked at the kernel routing table and found only the loopback route. Adding

route add -net 192.168.55.0 netmask 255.255.255.0
route add default gw 192.168.55.4

looks like it fixed this issue.

But, it still has no inet address, only an inet6 one. Sigh.

Thanks to both of you,

Rich
Louis Kowolowski
2018-09-27 19:19:33 UTC
Permalink
Post by Rich Shepard
Post by Louis Kowolowski
The IP 192.168.55.7 is NOT in the network 192.168.0.0/24 (mask of
255.255.255.0) The only valid IPs in 192.168.0.0/24 are 192.168.0.1-255
(don't try to allocate .255, its used).
Louis,
Mea culpa for not noticing this! Thanks for pointing out the obvious to
me.
How do I delete the 192.168.0.0 route? Typing 'route del network
192.168.0.0 eth1' returns 'network: host name lookup failure'.
I would expect something like:
route delete -net 192.168.x.y/z
where x is the 3rd octet, y is the 4th, and z is the subnet mask
if there is no risk to running things, you may also be able to issue a
route flush
this will remove all route entries. be careful.


--
Louis Kowolowski ***@cryptomonkeys.org
Cryptomonkeys: http://www.cryptomonkeys.com/

Making life more interesting for people since 1977
John Meissen
2018-09-27 16:54:06 UTC
Permalink
What's the IP address and netmask of the system you're trying to set this on?
Post by Rich Shepard
Having been a while since I last set routes I've lost a step when setting
the default gateway.
The routing table has both loopback and LAN routes. Now I need to set the
default gateway and the kernel tells me there's a SIOCADDRT (address) error.
In slackware's rc.inet1.conf interface configuration file the default
route add default gw 192.168.55.4
returns the above error that the network is unreachable.
The route man page example has a host name for the gateway and I've tried
that, too, with the same result.
What have I missed here?
On a curious, somewhat related issue, while there's only one Ethernet port
on the motherboard ifconfig sees it as eth1 rather than eth0.
Rich
_______________________________________________
PLUG mailing list
http://lists.pdxlinux.org/mailman/listinfo/plug
Rich Shepard
2018-09-27 17:47:36 UTC
Permalink
Post by John Meissen
What's the IP address and netmask of the system you're trying to set this on?
192.168.55.7 netmask 255.255.255.0
Russell Senior
2018-09-27 19:07:07 UTC
Permalink
Just a fwiw, DHCP. Static network configuration works too, if you know what
you are doing. However, the empirical evidence suggests you would benefit
from DHCP.
Post by Rich Shepard
Having been a while since I last set routes I've lost a step when setting
the default gateway.
The routing table has both loopback and LAN routes. Now I need to set the
default gateway and the kernel tells me there's a SIOCADDRT (address) error.
In slackware's rc.inet1.conf interface configuration file the default
route add default gw 192.168.55.4
returns the above error that the network is unreachable.
The route man page example has a host name for the gateway and I've tried
that, too, with the same result.
What have I missed here?
On a curious, somewhat related issue, while there's only one Ethernet port
on the motherboard ifconfig sees it as eth1 rather than eth0.
Rich
_______________________________________________
PLUG mailing list
http://lists.pdxlinux.org/mailman/listinfo/plug
Tomas Kuchta
2018-09-27 20:35:17 UTC
Permalink
I'd imagine that Rich is not using DHCP because he would like to be able to
identify the hosts on his network and doesn't feel like doing local
DNS/DHCP pair.

If my hunch is right, I would suggest using centralized DHCP IPv4 and
general network configuration for all hosts + let DHCP assign some defined
IPs based on their MAC.

That way, the user should see and manage the whole network configuration
for all hosts in one place and avoid annoyances like this one AND still
have stable/defined IPv4s.

This is just a suggestion to consider, given that this recurring type of
problem on the forum.

Tomas
Post by Russell Senior
Just a fwiw, DHCP. Static network configuration works too, if you know what
you are doing. However, the empirical evidence suggests you would benefit
from DHCP.
Post by Rich Shepard
Having been a while since I last set routes I've lost a step when setting
the default gateway.
The routing table has both loopback and LAN routes. Now I need to set the
default gateway and the kernel tells me there's a SIOCADDRT (address) error.
In slackware's rc.inet1.conf interface configuration file the default
route add default gw 192.168.55.4
returns the above error that the network is unreachable.
The route man page example has a host name for the gateway and I've tried
that, too, with the same result.
What have I missed here?
On a curious, somewhat related issue, while there's only one Ethernet port
on the motherboard ifconfig sees it as eth1 rather than eth0.
Rich
_______________________________________________
PLUG mailing list
http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
http://lists.pdxlinux.org/mailman/listinfo/plug
Rich Shepard
2018-09-27 22:08:24 UTC
Permalink
Post by Rich Shepard
In slackware's rc.inet1.conf interface configuration file the default
Louis, Tomas, Russell, et al.:

Fixed the issue.

The reason is that this motherboard does not find the eth0 interface, only
eth1. I'll probably never learn why, and this is the first time in > 20
years of linux I've seen this.

So, while I configured eth1 in /etc/rc.d/rc.inet1.conf, I did not realize
that I needed to make the inet1 daemon aware of the different default
interface.

Running '/etc/rc.d/rc.inet1 eth1_start' made the software happy and I can
now access the external world as well as other LAN hosts from the new
desktop host.

Rich

Loading...