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 created a new interface eth0:1 and assigned ip address using DHCP server. Now, i want my applications to use the internet of this new interface created. I am doing this because in out Institute, we have bandwidth limit on each IP address.

Now, i want to do something like:

if I try to use localhost:3129 as a proxy, this traffic gets forwarded to eth0:1 interface. How can I do so?

So that by using localhost:3129, i can actually use my interface eth0:1.. I only figured out this method because not many applications today have an option of binding to a particular interface.

share|improve this question

2 Answers 2

up vote 2 down vote accepted
iptables -t nat -I PREROUTING -p tcp --dport 3129 -d 1.2.3.4 -j REDIRECT --to-port 3128

But your statement that "not many applications today have an option of binding to a particular interface" does not match with my experience -- most applications I have deployed have an option to do this.

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.