Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have server(CENTOS) with one NIC and it has multiple ip addresses let's say my ips are 192.168.1.10, and 192.168.1.11.

I would like to route route traffic from both ip's.

I am struggling solve this problem, can someone give me suggestions to resolve it?

Thanks, Sandeep

share|improve this question
    
Route it to where? –  Ignacio Vazquez-Abrams Feb 27 '12 at 5:18
    
And what will be your networks for this IP addresses? –  Jan Marek Feb 27 '12 at 5:51
    
I would like to route all outgoing traffic from either of these 2 ip's. Both ip's are in same subnet. –  Sandeep Feb 27 '12 at 6:49
    
I bet you asked for ip forwarding in a different way. echo 1 > /proc/sys/net/ipv4/ip_forward or edit /etc/sysctl.conf and add this line: net.ipv4.ip_forward = 1 –  Alan Kuras Feb 27 '12 at 8:22
    
There should be nothing special you need to do. The machine should route traffic that originates on any of its local IP addresses. –  David Schwartz Feb 27 '12 at 10:01

2 Answers 2

It is not too clear what you want to do, but you may need to look at source-based routing. This enables you to route your traffic to potentially several gateways based on the source IP address.

Another option may be related which is to use different source IPs from your application. This actually depends on your application and whether it supports bind function or not (look at man 2 bind). An example will be the use of telnet with -b option to choose the source IP.

share|improve this answer

I think you're trying to do routing on a stick, i.e. a route on single physical interface, usually that's done between two VLANs so if you're switch supports VLANs then follow this post courtesy of Lazy Geek: http://rbgeek.wordpress.com/2012/05/05/intervlan-routing-using-centos-with-1-interface/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.