LINUXOR.SK ... open source notes ...

Email - route-eth0, relay servers

category: solutionz · date: 2019-12-31 · updated: 2026-10-02 · author: LALA

Email Solution · Config document · referenced from Relay servers

The static IPv4 routes of a relay server. The default route points out of the relay VLAN on eth1; these routes send everything with a private destination to the gateway of the internal VLAN on eth0 instead.

ItemValue
Path on the server/etc/sysconfig/network-scripts/route-eth0
Shown hereDC2-A-VCMSR001
Also onDC2-B-VCMSR001, the same three routes; the file there ends with one more empty line
Gateway10.12.19.46, the gateway of the internal VLAN 1168
Activated withthe network service, when eth0 comes up

The file

ini
# Route to internal networks
192.168.0.0/16 via 10.12.19.46
10.0.0.0/8 via 10.12.19.46
172.16.0.0/12 via 10.12.19.46

The three destinations are the three private address blocks of RFC 1918. The server's own addresses are anonymized into 10.12.x; the blocks are shown as they are in the file, because they are not addresses of the organisation.

Checked against RHEL 10.2

As builtToday
ifcfg-* files read by the network service, NM_CONTROLLED="no"The legacy network scripts were deprecated in RHEL 8; RHEL 9 does not contain the network-scripts package; in RHEL 10 support for the ifcfg format was removed
One file per interface under /etc/sysconfig/network-scriptsNetworkManager keyfiles under /etc/NetworkManager/system-connections/; on RHEL 9 nmcli connection migrate converts ifcfg profiles to keyfiles
route-eth0 with <prefix> via <gateway> linesStatic routes are properties of the connection, set for IPv4 with nmcli connection modify <connection> +ipv4.routes "<prefix> <gateway>"

Red Hat's advice today is not to write these profiles by hand at all, but to use nmcli, the network system role or the nmstate API. RHEL 7 itself left maintenance on 2024-06-30.

← solutionz