open-switch / opx-nas-common Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://openswitch.net
Home Page: https://openswitch.net
We've observed that none of the standard Linux APIs/commands are able to list/see physical interfaces, once the management interface (eth0
) is moved to a network namespace to isolate the management plane from data/control plane. This is observed both on physical and virtual OPX. Below are the details taken from a physical box.
Interface file
root@s2:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
post-up ip netns add management; sleep 1
post-up ip link set eth0 netns management; sleep 1
post-up ip netns exec management ip link set dev eth0 up
post-up ip netns exec management dhclient eth0
post-up ip netns exec management /usr/sbin/sshd -o PidFile=/run/sshd-management.pid
%for a in range(1,10):
auto e101-00${a}-0
iface e101-00${a}-0
mtu 9184
%endfor
%for b in range(10,33):
auto e101-0${b}-0
iface e101-0${b}-0
mtu 9184
%endfor
Standard ip commands can't see e101-*
interfaces
root@s2:~# ip netns list
management
root@s2:~# ip link show
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether ec:f4:bb:fc:d0:d8 brd ff:ff:ff:ff:ff:ff
root@s2:~# ip netns exec management ip link show
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether ec:f4:bb:fc:d0:d8 brd ff:ff:ff:ff:ff:ff
root@s2:~# ip netns exec default ip link show
Cannot open network namespace "default": No such file or directory
Standard files also can't see the physical interfaces. We also have a C++ program listening to netlink events and that too can't see any physical interface.
import pyroute2
>>> pyroute2.netns.listnetns()
['mgmt']
>> [i.get_attr('IFLA_IFNAME') for i in pyroute2.IPRoute().get_links()]
['lo', 'eth0']
root@s2:~# ls -l /sys/class/net/
total 0
lrwxrwxrwx 1 root root 0 Oct 10 19:26 eth0 -> ../../devices/pci0000:00/0000:00:04.0/0000:08:00.0/net/eth0
lrwxrwxrwx 1 root root 0 Oct 10 19:26 lo -> ../../devices/virtual/net/lo
root@s2:~# cat /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth0: 23529133624 362771305 0 0 0 0 0 30 102510922 169106 0 0 0 0 0 0
System info
root@s2:~# cat /etc/OPX-release-version
OS_NAME="OPX-Base-Dell"
OS_VERSION="2.1.0"
PLATFORM="S6000-ON"
ARCHITECTURE="x86_64"
INTERNAL_BUILD_ID="OpenSwitch Base Blue Print 1.0.0"
BUILD_VERSION="2.1.0(26)"
BUILD_DATE="2017-07-14T23:29:12+0000"
INSTALL_DATE="2017-07-31T15:59:27+0000"
root@s2:~# opx-show-version
OS_NAME="OPX-Base-Dell"
OS_VERSION="2.1.0"
PLATFORM="S6000-ON"
ARCHITECTURE="x86_64"
INTERNAL_BUILD_ID="OpenSwitch Base Blue Print 1.0.0"
BUILD_VERSION="2.1.0(26)"
BUILD_DATE="2017-07-14T23:29:12+0000"
INSTALL_DATE="2017-07-31T15:59:27+0000"
SYSTEM_UPTIME= 9 weeks, 1 day, 2 hours, 25 minutes
SYSTEM_STATE= running
UPGRADED_PACKAGES=no
However we are able to see these interfaces from following places. But we need a way to enumerate the interfaces directly (not extract from other non-interface specific tools. Plus vtysh
seems to have no way to get interfaces in json/xml format)
root@s2:~# lldpctl
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface: e101-030-0, via: LLDP, RID: 29, Time: 4 days, 06:22:02
Chassis:
ChassisID: mac 34:17:eb:f4:4e:cd
SysName: l3
SysDescr: Debian GNU/Linux 8 (jessie) Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-14) x86_64
MgmtIP: 10.1.103.1
Capability: Bridge, on
Capability: Router, on
Capability: Wlan, off
Capability: Station, off
Port:
PortID: mac 34:17:eb:f4:4e:fd
PortDescr: NAS## 0 109
-------------------------------------------------------------------------------
Interface: e101-029-0, via: LLDP, RID: 30, Time: 4 days, 06:21:32
...
root@s2:~# vtysh -c "show interface"
Interface e101-001-0 is up, line protocol is up
Link ups: 18 last: 2017/10/06 21:44:58.97
Link downs: 18 last: 2017/10/06 21:39:49.77
PTM status: disabled
vrf: Default-IP-Routing-Table
index 10 metric 0 mtu 9184 speed 10
flags: <UP,BROADCAST,RUNNING,MULTICAST>
Type: Ethernet
HWaddr: ec:f4:bb:fc:d0:d9
inet6 fe80::eef4:bbff:fefc:d0d9/64
Interface Type Other
ND advertised reachable time is 0 milliseconds
ND advertised retransmit interval is 0 milliseconds
ND router advertisements sent: 472430 rcvd: 471962
ND router advertisements are sent every 10 seconds
ND router advertisements lifetime tracks ra-interval
ND router advertisement default router preference is medium
Hosts use stateless autoconfig for addresses.
Neighbor address(s):
inet6 fe80::3617:ebff:fef6:62fd/128
Interface e101-002-0 is up, line protocol is up
...
On OPX 2.3.0, seeing these logs continuously in normal operation. Does it indicate any issue?
May 31 04:08:16 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
May 31 04:08:16 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
May 31 04:08:21 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
May 31 04:08:21 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
May 31 04:08:21 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
May 31 04:08:21 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
May 31 04:08:23 leaf-1 opx_nas_daemon[549]: [INTERFACE:INTF-C], Failed to get if_info
May 31 04:08:23 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
May 31 04:08:23 leaf-1 opx_nas_daemon[549]: [INTERFACE:INTF-C], Failed to get if_info
May 31 04:08:23 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
May 31 04:08:24 leaf-1 opx_nas_daemon[549]: [INTERFACE:INTF-C], Failed to get if_info
May 31 04:08:24 leaf-1 opx_nas_daemon[549]: [INTERFACE:NAS-COM-INT-GET], Get request handler not present
I'm using OPX with Dell S6000.
Seems CPS is not returning the result?
admin@OPX:~$ opx-switch-shell "l3 egress show"
Traceback (most recent call last):
File "/usr/bin/opx-switch-shell", line 34, in <module>
print str(l[0]['change']['data']['base-switch/diag_shell/output/result'])
KeyError: 'base-switch/diag_shell/output/result'
admin@OPX:~$ dpkg -l | grep -w opx-nas-common
ii opx-nas-common 1.0.1 amd64 This package contains common utilities for the network abstraction component.
Hi,
i‘m using the dell 4248fbl-on wich has an ext tcam for fib and acl. How can I monitor the usage? I wasn’t able to find a command at opx-shell to monitor the asic and tcam.
Greets,
Stefan
I can't get L3 route get to work. It always fails with prefix len is out of range.
root@OPX:~# opx-switch-shell "L3 route get ip=89.0.0.1 mask=24"
Code 0x213A088 (fail):
Text : SOC_SAND_PP_IPV4_SUBNET_PREF_OUT_OF_RANGE_ERR
the ipv4 prefix len is out of range
ipv4 prefix length range 0-32.
Procedure id: 0x109D (Mod: SOC_SAND module, Proc: SOC_SAND_PP_IPV4_SUBNET_VERIFY)
0:arad_pp_frwrd_ipv4_vrf_route_get_verify: soc_sand function returned error
0:arad_pp_frwrd_ipv4_vrf_route_get_verify: Function returned an error (var_a=0, var_b=0)
0:soc_ppd_frwrd_ipv4_vrf_route_get: soc_sand function returned error
0:soc_ppd_frwrd_ipv4_vrf_route_get: Function returned an error (var_a=0, var_b=0)
<nounit>:handle_sand_result: SOC_SAND Error Code 0x0 (fail):
Text : SOC_SAND_PP_IPV4_SUBNET_PREF_OUT_OF_RANGE_ERR
the ipv4 prefix len is out of range
ipv4 prefix length range 0-32.
Procedure id: 0x19474 (Mod: ARAD PP module, Proc: Unknown_procedure)
0:_bcm_ppd_frwrd_ipv4_vrf_route_get: Internal error
0:_bcm_ppd_frwrd_ipv4_vrf_uc_route_get: get vrf route failed
Route get returned: Internal error
SAI.0>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.