• Contact Us
  • Home
  • About Us
  • News
    • Entertainment
    • Trending
  • IT
    • Code
    • Cloud
    • Linux
    • Splunk
  • Login
  • Register
Upgrade
CloudiBee
  • Contact Us
  • Home
  • About Us
  • News
    • Entertainment
    • Trending
  • IT
    • Code
    • Cloud
    • Linux
    • Splunk
No Result
View All Result
  • Contact Us
  • Home
  • About Us
  • News
    • Entertainment
    • Trending
  • IT
    • Code
    • Cloud
    • Linux
    • Splunk
No Result
View All Result
CloudiBee
No Result
View All Result
Home Linux

How to configure Static routing in Linux

cloudibee by cloudibee
August 15, 2020
in Linux
0
0
SHARES
14.5k
VIEWS
Share on FacebookShare on Twitter

Static routes will be added usually through “route add” or “ip route” command. However, “route add” command configures routing on the runtime and doesn’t persist the configuration after a reboot. To make it persistent across reboots, you have to add it to /etc/sysconfig/network-scripts/route-<interface-file> . For example, static routes for the eth0 interface would be stored in the /etc/sysconfig/network-scripts/route-eth0 file. Here are the Steps to configure static routing in Linux.

Table of Contents

  • To add static route using “route add” in command line:
  • To add static route using “ip route” command:
  • Adding Persistent static route:
    • You might also like
    • Linux Change Password Command: Change password expiry in Linux
    • Top Open Source Email Servers

To add static route using “route add” in command line:

# route add -net 192.168.100.0 netmask 255.255.255.0 gw 192.168.10.1 dev eth0

To add static route using “ip route” command:

# ip route add 192.168.100.0/24 via 192.168.10.1 dev eth1

Adding Persistent static route:

You need to edit /etc/sysconfig/network-scripts/route-eth0 file to define static routes for eth0 interface. This configuration will be persistent even after the server is rebooted.

You might also like

Linux Change Password Command: Change password expiry in Linux

April 7, 2021
Email Servers

Top Open Source Email Servers

September 7, 2021
GATEWAY0=192.168.10.1 NETMASK0=255.255.255.0 ADDRESS0=192.168.100.0
GATEWAY1=10.64.34.1 NETMASK1= 255.255.255.240 ADDRESS1=10.64.34.10

Save and close the file. Restart networking:

# service network restart

There are various ways to verify the routing table in Linux. Few commands are listed below:

# route –n
# netstat –nr
# ip route show
Previous Post

Disabling TLS 1.0 on nginx web servers

Next Post

Disabling TLS 1.0 on Apache Linux Server

cloudibee

cloudibee

Related Posts

Linux

Linux Change Password Command: Change password expiry in Linux

by cloudibee
April 7, 2021
Email Servers
Linux

Top Open Source Email Servers

by cloudibee
September 7, 2021
Linux

How to Determine Redhat Versions Command

by cloudibee
May 27, 2022
Linux

How-to Linux List Processes in 3 Simple Commands

by cloudibee
May 27, 2022
Linux

What is Cron Job in Linux?

by cloudibee
May 27, 2022
Next Post

Disabling TLS 1.0 on Apache Linux Server

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Premium Content

Carpathia Cloud Orchestration | IT Industry Analyst Firm, Neovise

May 27, 2022
Flowers

Gift Flowers as a Token of Appreciation

July 26, 2022

The Spamhaus Project

October 19, 2020

Browse by Category

  • Business
  • Cloud
  • Code
  • Debt
  • Entertainment
  • finance
  • Game
  • Health
  • IT
  • Lifestyle
  • Linux
  • Marketing
  • Misc
  • News
  • SEO
  • Services
  • Splunk
  • Sports
  • Tech
  • Technology
  • Tipes
  • Tips
  • Uncategorized

Browse by Tags

algorithm Apache Apache2 AWS Bash bash history Bind Blacklists Buffer C C++ CentOS Cerner chage Cloud Cloud Computing Cloud jobs Cloud Storage Cloud Suite Commands Compliance Cron job Debian Directory DMS DNS Docker Dovecot drop cache Email servers Enteprise Cloud Enterprise External FAT32 Format kernel Linux linux kernel Nirvanix passwd Sendmail SSH SSL Terminal Ubuntu

About CloudiBee

cloudibee logo


CloudiBee is an open-source for people who love technology. Here we will be sharing lots of technical information over the web so that a lot of people visit us and gain some knowledge. We are a completely open to all platform. We assure you that you can easily get any info and updated news about the tech world from us. Let's begin with us!

Hot Topic

Debt Collection & Debt Collection Scams

by Swati
August 8, 2022
0
Debt Collection Scams

With inflation at record levels, many consumers are having trouble juggling all their bills. And some are even missing payments....

Read more

Recent News

Business

The main reasons for the startup fails. How to avoid failure?

July 21, 2022
Business

Hacks for packing wine glasses so they don’t break

July 21, 2022
Business

5 tips to ensure that your movers are always on time.

July 21, 2022

CloudiBee. © 2021. All Rights Reserved

No Result
View All Result
  • Contact Us
  • Home
  • About Us
  • News
    • Entertainment
    • Trending
  • IT
    • Code
    • Cloud
    • Linux
    • Splunk

CloudiBee. © 2021. All Rights Reserved

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In