Solved

Static Route for Mandriva?

Posted on 2013-05-20
7
900 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
New! My Passport Wireless Pro Wi-Fi Mobile Storage

Portable wireless storage to offload, edit, and stream anywhere.

High-capacity, wireless mobile storage designed to accompany professional photographers and videographers in the field to easily offload, edit and stream captured photos and high-definition videos.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now