Skip to content

Instantly share code, notes, and snippets.

@duncan-brown
Last active December 5, 2019 20:47
Show Gist options
  • Save duncan-brown/b854b862dae7a6d504016c090ca2f2c2 to your computer and use it in GitHub Desktop.
Save duncan-brown/b854b862dae7a6d504016c090ca2f2c2 to your computer and use it in GitHub Desktop.

Following https://access.redhat.com/solutions/30564

Edit the file /etc/iproute2/rt_tables and add routes for the four different NICs:

#
# reserved values
#
255	local
254	main
253	default
0	unspec
#
# local
#
#1	inr.ruhep
100     roster
101     dcc
102     mail
103     services

To configure manually, run the commands:

ip route add 128.230.146.0/24 dev ens256 src 128.230.146.13 table dcc
ip route add table dcc default via 128.230.146.1 dev ens256
ip route add 128.230.146.0/24 dev ens224 src 128.230.146.12 table roster
ip route add table roster default via 128.230.146.1 dev ens224
ip route add 128.230.146.0/24 dev ens161 src 128.230.146.15 table mail
ip route add table mail default via 128.230.146.1 dev ens161
ip route add 128.230.146.0/24 dev ens160 src 128.230.146.17 table services
ip route add table services default via 128.230.146.1 dev ens160
ip rule add table roster from 128.230.146.12
ip rule add table dcc from 128.230.146.13
ip rule add table mail from 128.230.146.15
ip rule add table services from 128.230.146.17
sysctl net.ipv4.conf.default.arp_filter=1

To persist across reboots, install

yum -y install net-tools bind-utils NetworkManager-config-routing-rules
systemctl enable NetworkManager-dispatcher.service
start NetworkManager-dispatcher.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment