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 a serious problem with my server ubuntu 13.

I have two ADSL lines and an internal network as follows.

i.imgur.com/v4ddHXf.png (URL IMG)

IP redirections made ​​two because there are two older servers that use those ip.

192.168.2.6 To redirect 192.168.3.2 192.168.2.7 To redirect 192.168.3.2

I use


    #Antiguo Servidor de Archivos
    iptables -t nat -A PREROUTING -s 192.168.2.0/24 -i eth1 -d 192.168.2.7 -p tcp --match multiport --dport 445,135 -j DNAT --to-destination 192.168.3.2:445,135
    #Antiguo Servidor de Antivirus
    iptables -t nat -A PREROUTING -s 192.168.2.0/24 -i eth1 -d 192.168.2.7 -p tcp --match multiport --dport 2221:2224 -j DNAT --to-destination 192.168.3.3:2221-2224
    #Antiguo Servidor DB Marcador y S10
    iptables -t nat -A PREROUTING -s 192.168.2.0/24 -i eth1 -d 192.168.2.6 -p tcp --dport 1433 -j DNAT --to-destination 192.168.3.2:1433
    iptables -t nat -A PREROUTING -s 192.168.2.0/24 -i eth1 -d 192.168.2.6 -p udp --dport 1434 -j DNAT --to-destination 192.168.3.2:1434

But I also want the port 25 R2 (Router 2) 192.168.0.1 and active rp_filter 1 out.

I use


#Active rp_filter
for f in /proc/sys/net/ipv4/conf/*/rp_filter ; do echo 0 > $f ; done

iptables -t mangle -A PREROUTING -p tcp --dport 25 -s 192.168.2.0/24 -j MARK --set-mark 2
iptables -t mangle -A PREROUTING -p tcp --dport 25 -s 192.168.3.0/24 -j MARK --set-mark 2
iptables -t mangle -A PREROUTING -p tcp --dport 25 -s 192.168.4.0/24 -j MARK --set-mark 2
iptables -t mangle -A PREROUTING -p tcp --dport 25 -s 192.168.6.0/24 -j MARK --set-mark 2

When active rp_filter not work redirect ip 192.168.2.7 to 192.168.3.2 is lost but found port 25 to line 2.

Script IPTABLES

pastebin.ca/2516701 (URL LINK)

Script IPROUTE

pastebin.ca/2516702 (URL LINK)

What is solution please?

share|improve this question

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.