Skip to content
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

eth0 can't be pinged on the same subnet #1023

Closed
tieguoevan opened this issue Oct 9, 2017 · 5 comments
Closed

eth0 can't be pinged on the same subnet #1023

tieguoevan opened this issue Oct 9, 2017 · 5 comments

Comments

@tieguoevan
Copy link

Description

eth0 can't be pinged on the same subnet

The reason is that there is no connected routing in interfaces.j2

Steps to reproduce the issue:

  1. eth0 configured as 10.65.254.240/24
  2. Connected device failed to ping from 10.65.254.222 to 10.65.254.240
@stcheng
Copy link
Contributor

stcheng commented Oct 12, 2017

could you provide the output of ip route show?

@tieguoevan
Copy link
Author

root@str-s8900-54xc-01:/home/admin# ip route
10.0.0.56/31 dev PortChannel01  proto kernel  scope link  src 10.0.0.56
10.0.0.58/31 dev PortChannel02  proto kernel  scope link  src 10.0.0.58
10.0.0.60/31 dev PortChannel03  proto kernel  scope link  src 10.0.0.60
10.0.0.62/31 dev PortChannel04  proto kernel  scope link  src 10.0.0.62
10.65.230.0/24 dev eth0  proto kernel  scope link  src 10.65.230.240
240.127.1.0/24 dev docker0  proto kernel  scope link  src 240.127.1.1

I think the problem is this line in interfaces.j2
https://github.com/Azure/sonic-buildimage/blob/e27fd4648958633bef45523e09486a9b790fec31/files/image_config/interfaces/interfaces.j2#L30
configure a default route and its nexthop is the gataway. But in our environment, there is no gateway.
We add line to fix this problem locally.
up ip {{ '-4' if prefix | ipv4 else '-6' }} route add {{ prefix | network }}/{{ prefix | prefixlen }} dev eth0 table default

@stcheng
Copy link
Contributor

stcheng commented Oct 13, 2017

correct me if i'm wrong, if the eth0 is configured with 10.65.254.240/24, will this route to the subnet be added automatically in the kernel?

@lguohan
Copy link
Collaborator

lguohan commented Nov 7, 2017

yes, this is a bug. The reason is that we are using the route table default to route the packet when source IP is the management IP. Check below. We need to add the subnet route to the table default.

admin@str-a7050-acs-1:~$ ip rule   
0:      from all lookup local 
32764:  from all to 10.20.6.16 lookup default 
32765:  from 10.3.147.241 lookup default 
32766:  from all lookup main 
32767:  from all lookup default 
admin@str-a7050-acs-1:~$ ip route show table default
default via 10.3.146.1 dev eth0 

@prsunny
Copy link
Contributor

prsunny commented Nov 10, 2017

PR raised - #1142

lguohan added a commit to lguohan/sonic-buildimage that referenced this issue Aug 5, 2020
* 9700e45 2020-08-03 | [show/config]: combine feature and container feature cli (sonic-net#1015) (HEAD, origin/master, origin/HEAD) [lguohan]
* c9d3550 2020-08-03 | [tests]: fix drops_group_test failure on second run (sonic-net#1023) [lguohan]
* dfaae69 2020-08-03 | [lldpshow]: Fix input device is not a TTY error (sonic-net#1016) [Arun Saravanan Balachandran]
* 216688e 2020-08-02 | [tests]: rename sonic-utilitie-tests to tests (sonic-net#1022) [lguohan]
* c0c3cce 2020-07-30 | [config/config_mgmt.py]: Fix typo and enable test for tablesWithOutYang() (sonic-net#1012) [Praveen Chaudhary]
* c6c5be1 2020-07-30 | [show] Fix for 'trunk' PortChannel reported as 'routed' port (sonic-net#1002) [shlomibitton]
* ef9ac2a 2020-07-29 | importing json needed for DPB CLI (sonic-net#1010) [Sangita Maity]
* aa1b072 2020-07-23 | [config] Add Initial draft of Breakout Mode subcommand (sonic-net#766) [Sangita Maity]
lguohan added a commit that referenced this issue Aug 5, 2020
1. remove container feature table
2. do not generate feature entry if the feature is not included
   in the image
3. rename ENABLE_* to INCLUDE_* for better clarity
4. rename feature status to feature state
5. [submodule]: update sonic-utilities

* 9700e45 2020-08-03 | [show/config]: combine feature and container feature cli (#1015) (HEAD, origin/master, origin/HEAD) [lguohan]
* c9d3550 2020-08-03 | [tests]: fix drops_group_test failure on second run (#1023) [lguohan]
* dfaae69 2020-08-03 | [lldpshow]: Fix input device is not a TTY error (#1016) [Arun Saravanan Balachandran]
* 216688e 2020-08-02 | [tests]: rename sonic-utilitie-tests to tests (#1022) [lguohan]

Signed-off-by: Guohan Lu <lguohan@gmail.com>
abdosi pushed a commit that referenced this issue Aug 9, 2020
1. remove container feature table
2. do not generate feature entry if the feature is not included
   in the image
3. rename ENABLE_* to INCLUDE_* for better clarity
4. rename feature status to feature state
5. [submodule]: update sonic-utilities

* 9700e45 2020-08-03 | [show/config]: combine feature and container feature cli (#1015) (HEAD, origin/master, origin/HEAD) [lguohan]
* c9d3550 2020-08-03 | [tests]: fix drops_group_test failure on second run (#1023) [lguohan]
* dfaae69 2020-08-03 | [lldpshow]: Fix input device is not a TTY error (#1016) [Arun Saravanan Balachandran]
* 216688e 2020-08-02 | [tests]: rename sonic-utilitie-tests to tests (#1022) [lguohan]

Signed-off-by: Guohan Lu <lguohan@gmail.com>
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this issue Feb 25, 2021
1. remove container feature table
2. do not generate feature entry if the feature is not included
   in the image
3. rename ENABLE_* to INCLUDE_* for better clarity
4. rename feature status to feature state
5. [submodule]: update sonic-utilities

* 9700e45 2020-08-03 | [show/config]: combine feature and container feature cli (sonic-net#1015) (HEAD, origin/master, origin/HEAD) [lguohan]
* c9d3550 2020-08-03 | [tests]: fix drops_group_test failure on second run (sonic-net#1023) [lguohan]
* dfaae69 2020-08-03 | [lldpshow]: Fix input device is not a TTY error (sonic-net#1016) [Arun Saravanan Balachandran]
* 216688e 2020-08-02 | [tests]: rename sonic-utilitie-tests to tests (sonic-net#1022) [lguohan]

Signed-off-by: Guohan Lu <lguohan@gmail.com>
stepanblyschak pushed a commit to stepanblyschak/sonic-buildimage that referenced this issue May 10, 2021
a few tests in drops_group_test fails on second run.
The reason is that /tmp/dropstat is not cleaned, the first
run leave some state in the folder which cause the subsequent
run to fail.

The fix is the always clean up the folder.

Signed-off-by: Guohan Lu <lguohan@gmail.com>
taras-keryk pushed a commit to taras-keryk/sonic-buildimage that referenced this issue Jul 22, 2022
* SAI submodule update

- d0f3333 Tunnel Scoped TC MAP and Remarking (sonic-net#1413) (sonic-net#1451)
- 62364a3 Add two more API as RPC for warmboot testing (sonic-net#1421) (sonic-net#1437)
- 426fad1 Make saithriftv compatible with thrift 0.14.1 (sonic-net#1433)

Signed-off-by: bingwang <bingwang@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants