Solved

set default route for virtual IP address

Posted on 2010-11-12
8
1,199 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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
 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 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