Guest User!

You are not Sophos Staff.

[7.250] Gateway Policy Route stop to work [NOTABUG]

My Gateway Policy route for ftp stops to works without a reason.
My configuration:
2Mbit SDSL (Def GW)
16MBit ADSL (no daily disconnect, static ip)

i route ftp traffic to the ADSL Line, after a night FTP stop to work,
disabling/enabling Police Route resolves this problem.
(Policyroute for HTTP still work)

Not sure where i have to look if this error occurs....

Gregor Kemter
  • @da_merlin

    Here we go Part #2

    Stats after enabling FTP-Policyrouting and before 24:00


    borgqueen:/home/login # ip rule
    0:      from all lookup local 
    1:      from all fwmark 0x1 lookup 1 
    32765:  from 192.168.254.0/24 to 192.168.11.0/24 lookup 42 
    32765:  from 192.168.254.0/24 to 10.133.168.128/25 lookup 42 
    32765:  from 192.168.254.0/24 to 192.168.15.0/24 lookup 42 
    32765:  from all iif lo lookup 42 
    32766:  from all lookup main 
    32767:  from all lookup default 

    ...
    borgqueen:/home/login # ip route show table 1
    default via 213.148.133.72 dev ppp0 

    ..
    borgqueen:/home/login # iptables -L -v -n -t mangle
    Chain PREROUTING (policy ACCEPT 24M packets, 14G bytes)
     pkts bytes target     prot opt in     out     source               destination         
      25M   14G POLICY_ROUTING_PRE  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

    Chain INPUT (policy ACCEPT 4745K packets, 1799M bytes)
     pkts bytes target     prot opt in     out     source               destination         
    6590K 2524M MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0           MARK set 0x0 
    6590K 2524M AFC_DETECT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

    Chain FORWARD (policy ACCEPT 18M packets, 12G bytes)
     pkts bytes target     prot opt in     out     source               destination         

    Chain OUTPUT (policy ACCEPT 6753K packets, 2595M bytes)
     pkts bytes target     prot opt in     out     source               destination         
    6752K 2594M POLICY_ROUTING_OUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

    Chain POSTROUTING (policy ACCEPT 19M packets, 11G bytes)
     pkts bytes target     prot opt in     out     source               destination         
      24M   14G MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0           MARK set 0x0 
      24M   14G AFC_DETECT  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

    Chain AFC_DETECT (2 references)
     pkts bytes target     prot opt in     out     source               destination         
    7569K 1633M RETURN     all  --  *      *       127.0.0.0/8          127.0.0.0/8         
     173K  202M RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spt:4444 dpts:1:65535 ADDRTYPE match src-type LOCAL 
      308 53600 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spt:22 dpts:1:65535 ADDRTYPE match src-type LOCAL 
     113K   10M RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spts:1:65535 dpt:4444 ADDRTYPE match dst-type LOCAL 
      494 35316 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spts:1:65535 dpt:22 ADDRTYPE match dst-type LOCAL 
    1683K 1075M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           CONNMARK match 0x10000/0x10000 
    4033K 1901M NFQUEUE    all  --  *      *       192.168.254.0/24     0.0.0.0/0           NFQUEUE num 1 bypass 
    1857K 1213M NFQUEUE    all  --  *      *       0.0.0.0/0            192.168.254.0/24    NFQUEUE num 1 bypass 
    1005K  617M NFQUEUE    all  --  *      *       0.0.0.0/0            0.0.0.0/0           ADDRTYPE match dst-type LOCAL NFQUEUE num 1 bypass 
     924K  132M NFQUEUE    all  --  *      *       0.0.0.0/0            0.0.0.0/0           ADDRTYPE match src-type LOCAL NFQUEUE num 1 bypass 
      14M 9674M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

    Chain POLICY_ROUTING_OUT (1 references)
     pkts bytes target     prot opt in     out     source               destination         
        0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           MARK match !0x0 
        0     0 MARK       all  --  eth3   *       192.168.177.0/24     0.0.0.0/0           MARK match 0x0 MARK set 0x1 
     6623  978K MARK       tcp  --  *      *       213.148.150.210      0.0.0.0/0           tcp spts:1:65535 dpt:80 MARK match 0x0 MARK set 0x1 
       37  5565 MARK       tcp  --  *      *       213.148.150.210      0.0.0.0/0           tcp spts:1:65535 dpt:443 MARK match 0x0 MARK set 0x1 
        0     0 MARK       tcp  --  eth1   *       192.168.254.0/24     0.0.0.0/0           tcp spts:1024:65535 dpts:20:21 MARK match 0x0 MARK set 0x1 

    Chain POLICY_ROUTING_PRE (1 references)
     pkts bytes target     prot opt in     out     source               destination         
     6002 1556K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           MARK match !0x0 
     211K 8518K MARK       all  --  eth3   *       192.168.177.0/24     0.0.0.0/0           MARK match 0x0 MARK set 0x1 
        0     0 MARK       tcp  --  *      *       213.148.150.210      0.0.0.0/0           tcp spts:1:65535 dpt:80 MARK match 0x0 MARK set 0x1 
        0     0 MARK       tcp  --  *      *       213.148.150.210      0.0.0.0/0           tcp spts:1:65535 dpt:443 MARK match 0x0 MARK set 0x1 
        0     0 MARK       tcp  --  eth1   *       192.168.254.0/24     0.0.0.0/0           tcp spts:1024:65535 dpts:20:21 MARK match 0x0 MARK set 0x1 

    Chain SANITYCHECK_FORWARD (0 references)
     pkts bytes target     prot opt in     out     source               destination         

    Chain SANITYCHECK_IN (0 references)
     pkts bytes target     prot opt in     out     source               destination   



    Tomorrow, after ftp stops to work, i will post the result.

    Gregor Kemter
  • after  a lot of test , finaly i figure it out :

    The policy routes dont stop to work.
    My problem with ftp policy route is :
    ftp connect works,
    but all ftp commands like ls are very slow.
    So i got a timeout retrieving directorylist from ftp.

    The funny thing is:
    (For testing i use ftp.astaro.de)
    i have a separate lan segment with 192.168.177.0/24 and a policy route:
    192.168.177.0. -> 192.168.177.1 -> any -> any -> Target DSL_GW
    This one works perfect

    192.168.254.0 -> 192.168.254.254 -> ftp -> any -> Target DSL_GW
    This one works, but need ~ 5-10sec to retrieve directorycontent after ftp connect
    Here i try to split the rules for ftp-data and ftp-control but same result.

    I also check the DSL Line without astaro on a standalone PC, ftp works like a charm.

    Gregor Kemter
  • ftp-data means port 20, but modern clients and servers don't use that port for data connections any more, since it may require "superuser" privileges on many operating systems.

    Set your client to always use passive mode. If it supports using a fixed source port range for outgoing passive connections, you can route that range.
  • ftp-data means port 20, but modern clients and servers don't use that port for data connections any more, since it may require "superuser" privileges on many operating systems.

    Set your client to always use passive mode. If it supports using a fixed source port range for outgoing passive connections, you can route that range.



    I change the Question:

    what is the best practice with ASG 7.3 and FTP Proxy enabled/disabled, to route outgoing ftp-traffic over a secondary dsl interface ?

    Gregor Kemter