Solved

set default route for virtual IP address

Posted on 2010-11-12
8
1,196 Views
Last Modified: 2012-05-10
Is there a way to set a default route for a virtual IP on a linux box?
0
Comment
Question by:mw-hosting
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 9

Expert Comment

by:avilov
ID: 34123768
did you try to specify
GATEWAY=

in ifcfg.ethx.y?  (x is a yor phisical interface where virtual IP is configured and y is VLAN # for that virtual IP)
0
 
LVL 12

Expert Comment

by:mccracky
ID: 34123974
If you tell us how you set the virtual IP it would help us answer your question.  If you are using the sysconfig files, you just need to put in the GATEWAY parameter like mentioned above.
0
 

Author Comment

by:mw-hosting
ID: 34124043
I did it via Webmin.
0
 
LVL 9

Expert Comment

by:avilov
ID: 34124094
if you can telnet/ssh to that server. the file you need to change is in


/etc/sysconfig/network-scripts  

directory

the file name will be like ifcfg.ethx.y?  (x is a yor phisical interface where virtual IP is configured and y is VLAN # for that virtual IP)
0
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.

 
LVL 12

Expert Comment

by:mccracky
ID: 34124900
in webmin is there a place to set the Gateway?
0
 

Author Comment

by:mw-hosting
ID: 34124996
Just netmask, broadcast, MTU.
0
 
LVL 16

Accepted Solution

by:
The--Captain earned 500 total points
ID: 34125373
None of the above is going to work, unless of course you are talking about adding the *same* gateway to your virtual IP, which would make no sense (because it's completely unecessary).  

If you want to use a *different* gateway for your virtual IP (which is the only thing that makes sense), you need to implement policy routing to use a different default route based upon your source IP.

Something like this:

ip route add ExternalNet/ExternalCIDR dev eth0 src MyVirtualIP table MyNewTable
ip route add default via MyNewDefaultGw table MyNewTable
ip route add 127.0.0.0/8 dev lo table MyNewTable
ip rule add from MyVirtualIP table MyNewTable

That might not be exactly it, but you get the idea...

Cheers,
-Jon
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 34281482
Thanks for the recognition.  Linux rules in so many ways, but the main reason I love it is because it is so flexible - it can do almost *anything* as far as networking is concerned (and far more than any other OS or IOS of which I know) if you just know how to configure it (and tcpdump, strace, and gdb are at the ready to diagnose anything the logs won't tell you ;-)

In any case, I'm glad to see you using linux as a router - too few people do <cisco rant deleted>

-Jon
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

22 Experts available now in Live!

Get 1:1 Help Now