Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-21-2005, 06:18 AM   #1
Registered: Sep 2004
Posts: 43

Rep: Reputation: 15
static routes using route-eth0 file

I've got two ethernet interfaces eth0 and 1. I'm using eth1 for pppoe connection with a modem, and eth0 for dsl connection to a router. I have setup a static routing to my isp's smtp server using eth0 in the config file /etc/sysconfig/network-scripts/route-eth0: via # test to see if this route populate into routing table n it does. via # does not populate into routing table at all

What happens is that the second route does not popylate into routing table but first one does. Do I have to specify the static route by ip instead of domain name for this to work? This is my current routing table:

Destination Gateway Genmask Flags Metric Ref Use Iface * UH 0 0 0 ppp0 UG 0 0 0 eth0 * U 0 0 0 eth0 * U 0 0 0 eth0
default UG 0 0 0 ppp0

I know I can put this route into /etc/rc.local by doing:
route add -host gw dev eth0

I just wanna know if the route-eth0 will support using domain names instead of IP's.

Old 08-22-2005, 12:49 PM   #2
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
At the time that eth0 is being activated, do you have a route for dns queries to resolve the mail server?

If not, add xtra's url to your /etc/hosts and try again..

Also have a look at for the split routing setup.. Chapters 4 & 5
Old 09-08-2007, 10:10 AM   #3
LQ Newbie
Registered: Sep 2007
Posts: 1

Rep: Reputation: 0
destination route using hostname

It is not possible, because the package iproute2 used in network scripts, does not support routing by destination using hostnames.

In Centos 4.5
#ip route add via
#Error: an inet prefix is expected rather than "".
#PING ( 56(84) bytes of data
#ip route add via
ip route ls|grep 66.35 via dev eth0

Hever Costa Rocha


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I config static routes? mikezang Linux - Networking 4 10-31-2005 11:29 AM
Max Static Routes? roundst Linux - Networking 2 07-28-2005 03:51 AM
automatic static routes? eantoranz Linux - Networking 5 07-19-2005 09:30 PM
Static routes file error message jhimes Linux - Networking 0 09-29-2004 12:26 AM
What is eth0.route file? ebreiter Linux - Networking 1 09-09-2004 06:35 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration