Jump to content
Калькуляторы

Linux routing Траффик через разные интерфейсы

Честно говоря уже иссяк.

 

Стоит Linux 2.6.31-22-server

На нем стоит quagga (bgp).

 

Схема примерно такая:

2010-06-10_1929.png

 

Траффик идет с клиента, проходит eth0, затем eth2, ответный траффик идет через eth3 и на этом все. На других портах я его не вижу уже.

Фаерволл пустой, все маршруты тоже в порядке. Но почему-то именно траффик возвращающийся через другой порт исчезает. Когда вход и исход через один порт, то все нормально.

Будто какая-то настройка дропающая траффик, если он не выходил через этот интерфейс.

Share this post


Link to post
Share on other sites

И если там окажутся единички то

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

Share this post


Link to post
Share on other sites

или ещё можно выпендрится и попробовать туда вдуть 2 вместо 0

Share this post


Link to post
Share on other sites

Спасибо, помогло. =)

Share this post


Link to post
Share on other sites

На 0, на двойке не пробовал, так как не сразу нашел инфу.

 

 rp_filter - INTEGER
        2 - do source validation by reversed path, as specified in RFC1812
            Recommended option for single homed hosts and stub network
            routers. Could cause troubles for complicated (not loop free)
            networks running a slow unreliable protocol (sort of RIP),
            or using static routes.

        1 - (DEFAULT) Weaker form of RP filtering: drop all the packets
            that look as sourced at a directly connected interface, but
            were input from another interface.

        0 - No source validation.

Share this post


Link to post
Share on other sites

Ээээ.. у Вас какое-то не правильное описалово... вот официальное:

 

rp_filter - INTEGER

0 - No source validation.

1 - Strict mode as defined in RFC3704 Strict Reverse Path

Each incoming packet is tested against the FIB and if the interface

is not the best reverse path the packet check will fail.

By default failed packets are discarded.

2 - Loose mode as defined in RFC3704 Loose Reverse Path

Each incoming packet's source address is also tested against the FIB

and if the source address is not reachable via any interface

the packet check will fail.

 

Current recommended practice in RFC3704 is to enable strict mode

to prevent IP spoofing from DDos attacks. If using asymmetric routing

or other complicated routing, then loose mode is recommended.

 

The max value from conf/{all,interface}/rp_filter is used

when doing source validation on the {interface}.

 

Default value is 0. Note that some distributions enable it

in startup scripts.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this