cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Etc


Reference














.

os:linux:network:routing.html



Linux:Netowrk

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 



os/linux/network/routing.html.txt ยท Last modified: 2017/05/30 by admin

Page Tools