Solved

Static Route for Mandriva?

Posted on 2013-05-20
7
923 Views
Last Modified: 2013-06-24
I was wondering how do I put a static route into Mandriva? We have a software that runs off this OS on our network that is needing a static route. I'm into the console and everything, but I just need to know the commands on how to permanently add a static route.
0
Comment
Question by:Pancake_Effect
  • 3
  • 2
  • 2
7 Comments
 
LVL 14

Assisted Solution

by:comfortjeanius
comfortjeanius earned 250 total points
ID: 39182559
The correct way to add permanent static routes to a system besides setting the default gateway is to create a file /etc/sysconfig/network-scripts/route-eth0 (or whichever interface you want to route through). You can add as many routes as you would like per interface by simply incrementing the number at the end of each statement. Once saved a restart of the network services will force a read of this route file.
 The syntax of the file should look like this:
 ADDRESS0=x.x.x.x
 GATEWAY0=x.x.x.x
 NETMASK0=x.x.x.x
 ADDRESS1=x.x.x.x
 GATEWAY1=x.x.x.x
 NETMASK1=x.x.x.x


I hoped this helps
0
 
LVL 28

Assisted Solution

by:serialband
serialband earned 250 total points
ID: 39182563
Try this.

If you have eth0 enabled, edit the following corresponding file
/etc/sysconfig/network-scripts/route-eth0

Add the routes you need in the following format.
ADDRESS0=x.x.x.x
GATEWAY0=x.x.x.x
NETMASK0=x.x.x.x
ADDRESS1=x.x.x.x
GATEWAY1=x.x.x.x
NETMASK1=x.x.x.x

Open in new window

0
 
LVL 4

Author Comment

by:Pancake_Effect
ID: 39184656
The program that runs upon this OS, doesn't really have a easy way to create a file via the GUI. From my understanding it's a custom mandriva OS. The only GUI you are given is the program. The only tool I have is the system console, via their custom software.

So I don't think the above commands can work without a text editor?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 14

Assisted Solution

by:comfortjeanius
comfortjeanius earned 250 total points
ID: 39184889
How do you make configuration changes if you do not use a text editor?  You should be able to edit a configuration files.
0
 
LVL 28

Expert Comment

by:serialband
ID: 39184917
The vi and emacs editors both run command line.  If you don't know how to use either of those, you may have other notepad like editors such as pico or nano on your system.

If don't have access to those editors, then you can use the catecho and redirect (>, <, >>, << ) commands. There's also the age-old ed line editor, which vi is built upon, from the days of the line printers.

An alternative to using ed is to use these commands
To display the contents of the file.
cat /etc/sysconfig/network-scripts/route-eth0

To append a line to a file.
echo "ADDRESS0=x.x.x.x" >> /etc/sysconfig/network-scripts/route-eth0

To delete the last line in a file you could use sed
sed '$d' filename.txt
0
 
LVL 4

Author Comment

by:Pancake_Effect
ID: 39226282
I found that "Route add –net #.#.#.# netmask #.#.#.# gw #.#.#.# dev eth#" seems to be working for it so far anyways!
0
 
LVL 28

Accepted Solution

by:
serialband earned 250 total points
ID: 39229055
Is that permanent?  You need to put it in a file.

/etc/sysconfig/network-scripts/route-eth0 or whichever network interface and add the following.
ADDRESS0=x.x.x.x
GATEWAY0=x.x.x.x
NETMASK0=x.x.x.x
ADDRESS1=x.x.x.x
GATEWAY1=x.x.x.x
NETMASK1=x.x.x.x

https://www.linuxquestions.org/questions/linux-networking-3/permanently-add-static-route-16769/
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Is your computer hacked? learn how to detect and delete malware in your PC
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question