Table of Contents

Routing - How to Configure Routing in Linux



RHEL/CentOS

Configuration Files

/etc/sysconfig/network

(abbr)
GATEWAY=192.168.10.1
(abbr)

/etc/sysconfig/static-routes

any net 10.50.5.0 netmask 255.255.255.0 gw 192.168.0.1
any net 192.168.1.0 netmask 255.255.0.0 gw 192.168.0.1
any host 192.168.2.1 gw 192.168.0.1




Debian/Ubuntu

/etc/network/if-up.d/static-routes

#!/bin/sh
/sbin/route add -net 10.50.0.0 gw 192.168.10.1 netmask 255.255.0.0 dev eth0
/sbin/route add -host 10.50.0.10 gw 192.168.10.1 eth0