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.

On my server, I want to duplicate all the traffic to an other host. I use iptables with TEE module:

iptables -t mangle -A PREROUTING -i eth0 -j TEE --gateway IP_SERVER2

I check the rule: iptables -t mangle -L

=> The rule is here but it doesn't work... The other server receive nothing.

When I do a tcpdump: tcpdump dst IP_SERVER2 => 0 packets received by filter

I tried to enable /proc/sys/net/ipv4/ip_forward, /proc/sys/net/ipv4/conf/all/accept_redirects, and /proc/sys/net/ipv4/conf/all/send_redirects. I changed to 1 the net.ipv4.ip_forward option in /etc/sysctl.conf, it still doesn't work.

Have you got an idea what's wrong?

share|improve this question
    
would this help? serverfault.com/questions/179968/… –  Daniel t. Jan 27 '13 at 5:04
add comment

1 Answer

up vote 0 down vote accepted

IP_SERVER2 needs to be on your local network according to iptables manpages.

share|improve this answer
    
Really? Ok I understand better now... –  user155731 Jan 28 '13 at 9:12
    
Have you an idea how to duplicate packets on another network? –  user155731 Jan 28 '13 at 9:46
    
I am not sure why iptables has such a limitation, but the only way I can think of is to log the packets (probably just tcpdump - see -G option) and ship them in files to your external network. –  donatello Jan 28 '13 at 20:57
    
I've done a vpn connection between the two servers (in order to be in the same private network) and now the duplication works great. Thanks you. –  user155731 Jan 31 '13 at 8:25
add comment

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.