Skip to content

connectivity: Disable Reverse Path Filtering for ping #6375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qiankehan
Copy link
Contributor

For the guest with multiple interfaces, the asymmetric routing may send the ICMP packets from one interface and receive them by another interface. For example:
# ping 1.1.1.1 -I enp7s0
PING 1.1.1.1 (1.1.1.1) from 192.168.122.252 enp7s0: 56(84) bytes of data

Capturing on 'enp1s0'
1 0.000000000 1.1.1.1 → 192.168.122.252 ICMP 98 Echo (ping) reply id=0x0007, seq=1295/3845, ttl=52
2 0.511943887 1.1.1.1 → 192.168.122.252 ICMP 98 Echo (ping) reply id=0x000c, seq=29/7424, ttl=52

If the rp_filter1 is enabled, Linux will refuse the replied ICMP packets and cause packets loss.

For the guest with multiple interfaces, the asymmetric routing
may send the ICMP packets from one interface and receive them
by another interface. For example:
\# ping 1.1.1.1 -I enp7s0
PING 1.1.1.1 (1.1.1.1) from 192.168.122.252 enp7s0: 56(84) bytes of data

Capturing on 'enp1s0'
    1 0.000000000      1.1.1.1 → 192.168.122.252 ICMP 98 Echo (ping) reply    id=0x0007, seq=1295/3845, ttl=52
    2 0.511943887      1.1.1.1 → 192.168.122.252 ICMP 98 Echo (ping) reply    id=0x000c, seq=29/7424, ttl=52

If the rp_filter[1] is enabled, Linux will refuse the replied ICMP packets
and cause packets loss.

[1]: https://sysctl-explorer.net/net/ipv4/rp_filter/

Signed-off-by: Han Han <[email protected]>
@qiankehan
Copy link
Contributor Author

Test result on v11.4.0-70-g07a8be20c1
(1/1) type_specific.io-github-autotest-libvirt.virtual_network.connectivity_check.ethernet_interface.managed_no.positive_test.tap.two_ifaces.smaller_mtu_multi_ifaces.non_root_user: STARTED
(1/1) type_specific.io-github-autotest-libvirt.virtual_network.connectivity_check.ethernet_interface.managed_no.positive_test.tap.two_ifaces.smaller_mtu_multi_ifaces.non_root_user: PASS (87.57 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /var/log/avocado/job-results/job-2025-06-16T02.30-02eef8f/results.html
JOB TIME : 89.71 s

@qiankehan
Copy link
Contributor Author

@dzhengfy @nanli1 Please help to review it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant