?
Solved

Static Route for Mandriva?

Posted on 2013-05-20
7
Medium Priority
?
1,001 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 14

Assisted Solution

by:comfortjeanius
comfortjeanius earned 1000 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 30

Assisted Solution

by:serialband
serialband earned 1000 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
Tutorial: Introduction to Managing a Linux Server

In this tutorial on systemd, we will explore:
-OS/Distro Adoption
-chkconfig and Other Legacy Commands
-Summary and Key Commands

 
LVL 14

Assisted Solution

by:comfortjeanius
comfortjeanius earned 1000 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 30

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 30

Accepted Solution

by:
serialband earned 1000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This program is used to assist in finding and resolving common problems with wireless connections.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

762 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