Solved

set default route for virtual IP address

Posted on 2010-11-12
8
1,195 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now