Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I saw a tutorial about redirecting client requests to a specific port to a VM inside the server using IPTables.

Is there a way to redirect client requests for foo.com to a VM using only IPTables?

or should I go for squid proxy server?

share|improve this question

1 Answer 1

If foo.com is the only web server listening on that IP, it should be relatively easy, since you would just redirect all port 80 traffic.

If there are other web servers for that IP, you can use string matching in iptables:

http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.html#ss3.18

but note the caveat in the documentation, about how a proxy would be a better choice.

share|improve this answer
    
thanks :D btw, do you know any easy-to-follow tutorial for this? –  user269334 May 22 '12 at 0:23
    
Ubuntu has fairly extensive community documentation. For example: help.ubuntu.com/community/IptablesHowTo –  cjc May 22 '12 at 1:30

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.