Skip to content

Instantly share code, notes, and snippets.

@yorickvP
Last active July 28, 2020 17:09
Show Gist options
  • Save yorickvP/e394adbd773e8237d5db4ca1d0579b9d to your computer and use it in GitHub Desktop.
Save yorickvP/e394adbd773e8237d5db4ca1d0579b9d to your computer and use it in GitHub Desktop.
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
link/sit 0.0.0.0 brd 0.0.0.0
3: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN group default qlen 1
link/tunnel6 :: brd ::
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 92:a5:98:0e:9e:02 brd ff:ff:ff:ff:ff:ff
inet 192.168.178.54/24 brd 192.168.178.255 scope global dynamic noprefixroute eth0
valid_lft 3198sec preferred_lft 2748sec
inet6 2a02:a212:2200:4c00:ed8f:c753:4d3e:9d/64 scope global temporary dynamic
valid_lft 604394sec preferred_lft 85840sec
inet6 2a02:a212:2200:4c00:90a5:98ff:fe0e:9e02/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 1110603sec preferred_lft 505803sec
inet6 fe80::90a5:98ff:fe0e:9e02/64 scope link
valid_lft forever preferred_lft forever
$ python3
Python 3.7.6 (default, Dec 18 2019, 19:23:55)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('/proc/device-tree/soc/usb@7e980000/usb1@1/usbether@1/local-mac-address', 'rb').read()
>>> list(map(hex, f))
['0xb8', '0x27', '0xeb', '0xc8', '0x18', '0x0']
>>>
$ lsusb
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ ls -l /proc/device-tree/soc/usb@7e980000/usb1@1/usbether@1
total 0
-r--r--r-- 1 root root 12 Jul 28 18:56 compatible
-r--r--r-- 1 root root 6 Jul 28 18:56 local-mac-address
-r--r--r-- 1 root root 9 Jul 28 18:56 name
-r--r--r-- 1 root root 4 Jul 28 18:56 reg
$ lsmod
Module Size Used by
cfg80211 466944 0
8021q 28672 0
nls_iso8859_1 16384 1
nls_cp437 16384 1
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
xt_comment 16384 2
ip6table_nat 16384 0
nf_nat_ipv6 16384 1 ip6table_nat
iptable_nat 16384 0
nf_nat_ipv4 16384 1 iptable_nat
nf_nat 20480 2 nf_nat_ipv6,nf_nat_ipv4
nf_conntrack_ipv6 20480 2
nf_defrag_ipv6 20480 1 nf_conntrack_ipv6
nf_conntrack_ipv4 20480 2
nf_defrag_ipv4 16384 1 nf_conntrack_ipv4
xt_conntrack 16384 2
nf_conntrack 94208 6 nf_conntrack_ipv6,nf_conntrack_ipv4,nf_nat_ipv6,xt_conntrack,nf_nat_ipv4,nf_nat
ip6t_rpfilter 16384 1
ipt_rpfilter 16384 1
ip6table_raw 16384 1
iptable_raw 16384 1
xt_pkttype 16384 2
nf_log_ipv6 16384 1
nf_log_ipv4 16384 1
nf_log_common 16384 2 nf_log_ipv6,nf_log_ipv4
xt_LOG 16384 2
xt_tcpudp 16384 11
ip6table_filter 16384 1
ip6_tables 24576 5 ip6table_filter,ip6table_raw,ip6table_nat
sch_fq_codel 20480 2
iptable_filter 16384 1
tun 32768 0
ip_tables 24576 4 iptable_filter,iptable_raw,iptable_nat
x_tables 24576 13 xt_comment,ipt_rpfilter,xt_LOG,xt_pkttype,ip_tables,ip6t_rpfilter,iptable_filter,xt_tcpudp,iptable_raw,ip6table_filter,ip6table_raw,xt_conntrack,ip6_tables
dm_mod 106496 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment