Log in console after install Docker on RedHat (Azure) - azure

After install Docker 18.x on RedHat 7.5 (hosted at Azure), some process is writing the log below to console each 1 minute. How do I disable it, please? Thanx for all!
INFO ExtHandler Updated NIC state
[
{
"name": "lo",
"link": " mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\"
"link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 addrgenmode eui64 numtxqueues 1 "
"numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 "
},
{
"name": "docker0",
"link": " mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default \"
" link/ether 02:42:7d:f0:24:58 brd ff:ff:ff:ff:ff:ff promiscuity 0 \ bridge forward_delay 1500 hello_time "
"200 max_age 2000 ageing_time 30000 stp_state 0 priority 32768 vlan_filtering 0 vlan_protocol 802.1Q bridge_id "
"8000.2:42:7d:f0:24:58 designated_root 8000.2:42:7d:f0:24:58 root_port 0 root_path_cost 0 topology_change 0 "
"topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer "
"16.78 vlan_default_pvid 1 vlan_stats_enabled 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping "
"1 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 4 mcast_hash_max 512 "
"mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval "
"26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval "
"3125 mcast_stats_enabled 0 mcast_igmp_version2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 "
"addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 "
},
{
"name": "eth0",
"link": " mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ "
"link/ether 00:0d:3a:11:4e:57 brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64 numtxqueues 64 numrxqueues
""64 gso_max_size 62780 gso_max_segs 65535 "
}
]

Related

Route between two Redhat Linux VMs to access Private Network

I have two Redhat VMs as below, want to access VM1's private network "192.168.122.X" from VM2.
May i know is this possible ?
VM1 with below network
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 0 0 0 eth1
10.78.103.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.122.33 netmask 255.255.255.0 broadcast 192.168.122.255
inet6 fe80::5054:ff:feb9:de20 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:b9:de:20 txqueuelen 1000 (Ethernet)
RX packets 24179913 bytes 28549369321 (26.5 GiB)
RX errors 0 dropped 2119 overruns 0 frame 0
TX packets 5673508 bytes 769017163 (733.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.78.103.33 netmask 255.255.255.0 broadcast 10.78.103.255
inet6 fe80::5054:ff:feb3:4fc2 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:b3:4f:c2 txqueuelen 1000 (Ethernet)
RX packets 37582534 bytes 25923821763 (24.1 GiB)
RX errors 0 dropped 4185 overruns 0 frame 0
TX packets 28245404 bytes 10327246086 (9.6 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
VM2 with below network
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 0 0 0 eth0
10.64.88.128 0.0.0.0 255.255.255.128 U 0 0 0 eth0
ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.64.88.203 netmask 255.255.255.128 broadcast 10.64.88.255
inet6 fe80::250:56ff:feb9:a955 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:b9:a9:55 txqueuelen 1000 (Ethernet)
RX packets 31613507 bytes 3779816165 (3.5 GiB)
RX errors 0 dropped 872 overruns 0 frame 0
TX packets 4874585 bytes 3778397609 (3.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Get the first 3 lines of each ip address/ifconfig interface command Linux

I am trying to get the first 3 lines of ip address/ifconfig from some VMs - some of them are running on Ubuntu, some of them on CentOS.
For example:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001
inet 172.31.106.100 netmask 255.255.240.0 broadcast 172.31.111.255
inet6 fe80::10c5:1dff:fec0:803e prefixlen 64 scopeid 0x20<link>
ether 12:c5:1d:c0:80:3e txqueuelen 1000 (Ethernet)
RX packets 7483 bytes 7706844 (7.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2998 bytes 470781 (459.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 12100 bytes 3865475 (3.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12100 bytes 3865475 (3.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
From this block of lines, I would need to get just the following part:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001
inet 172.31.106.100 netmask 255.255.240.0 broadcast 172.31.111.255
inet6 fe80::10c5:1dff:fec0:803e prefixlen 64 scopeid 0x20<link>
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
The same should apply for an ip address command.
Is any way to achieve this using a Linux command?
Many thanks,
Romain
You may use sed to do that,
ifconfig | sed -En '/^[^[:space:]]/,+2p; /^[[:space:]]*$/p'
Brief explanation,
The pipeline result would be processed by sed
/^[^[:space:]]/,+2p: search and print the line which doesn't start with blank, and also print the following 2 lines
/^[[:space:]]*$/p: search and print the blank line

Unable to ssh into Beaglebone Black from Arch Linux

I have a Beaglebone Black (running on Debian) which I'm connecting to my laptop (running on Arch Linux) through usb. The laptop is able to read Beaglebone as a storage device. However, I am unable to connect to Beaglebone through the browser/ssh by accessing the following ip - 192.168.7.2.
ifconfig -a gives the following output-
enp0s20u2: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 54:4a:16:c1:f1:53 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.204 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 fe80::2ad2:44ff:fe8e:bd61 prefixlen 64 scopeid 0x20<link>
ether 28:d2:44:8e:bd:61 txqueuelen 1000 (Ethernet)
RX packets 40024 bytes 35440467 (33.7 MiB)
RX errors 0 dropped 30 overruns 0 frame 0
TX packets 17546 bytes 2112866 (2.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 2137 bytes 479657 (468.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2137 bytes 479657 (468.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.5.86 netmask 255.255.252.0 broadcast 10.10.7.255
ether b8:ee:65:ac:7c:65 txqueuelen 1000 (Ethernet)
RX packets 19264 bytes 18721516 (17.8 MiB)
RX errors 0 dropped 4 overruns 0 frame 0
TX packets 17238 bytes 2273813 (2.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s20u2 is the interface of Beaglebone and has no ip allotted to it (as per the documentation, its ip should be 192.168.7.2) and thus I am unable to ssh or browse into it.
Finally succeeded by running the following command on the laptop:
sudo dhclient <interface>
Now, I'm able to ssh/browse Beaglebone Black.

How can you obtain a queue field from netstat -i in Linux?

In Solaris, the output of 'netstat -i' gives something like the following:
root# netstat -i
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 8232 loopback localhost 136799 0 136799 0 0 0
igb0 1500 vulture vulture 1272272 0 347277 0 0 0
Note that there is a Queue field on the end.
In Linux, 'netstat -i' gives output with no Queue field:
[root#roseate ~]# netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 2806170 0 0 0 791768 0 0 0 BMRU
eth1 1500 0 0 0 0 0 0 0 0 0 BMU
eth2 1500 0 0 0 0 0 0 0 0 0 BMU
eth3 1500 0 0 0 0 0 0 0 0 0 BMU
lo 16436 0 1405318 0 0 0 1405318 0 0 0 LRU
I've figured out how to get collisions in Linux by adding the -e option, but is there a way to get the Queue in Linux?
The only reference to queue I ever saw in netstat on Linux was when using -s, but that's probably too garrulous for your use-case?
$ netstat -na | awk 'BEGIN { RecvQ=0; SendQ=0; } { RecvQ+=$2; SendQ+=$3; } END { print "RecvQ " RecvQ/1024; print "SendQ " SendQ/1024; }'
RecvQ 255.882
SendQ 0.0507812
For per interface, I have dirty way
[spatel#us04 ~]$ for qw in `/sbin/ifconfig | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}'`; do echo `/sbin/ip addr | grep $qw | awk '{print $7}'` : ; echo `netstat -na | grep $qw | awk 'BEGIN { RecvQ=0; SendQ=0; } { RecvQ+=$2; SendQ+=$3; } END { print "RecvQ " RecvQ/1024; print "SendQ " SendQ/1024; }'`; done
eth0 :
RecvQ 0 SendQ 0
eth2 :
RecvQ 0.0703125 SendQ 1.56738
:
RecvQ 0 SendQ 0
I ended up using
tc -s -d qdisc
[root#roseate ~]# tc -s -d qdisc
qdisc mq 0: dev eth2 root
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc mq 0: dev eth3 root
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc mq 0: dev eth0 root
Sent 218041403 bytes 1358829 pkt (dropped 0, overlimits 0 requeues 1)
rate 0bit 0pps backlog 0b 0p requeues 1
qdisc mq 0: dev eth1 root
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
which gives backlog bytes and packets.
Source

Unable to set speed limit using tc tbf

I am using tc to do QOS on an asterisk server. I want to prioritize voice and sip traffic but also cap all the rest to a fixed limit.
Here is my script:
#!/bin/bash
IFACE=eth1
UPSPEED=1.5mbit
tc qdisc del dev $IFACE root
tc qdisc add dev $IFACE root handle 1: prio priomap 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 0
tc qdisc add dev $IFACE parent 1:1 handle 10: sfq perturb 10
tc qdisc add dev $IFACE parent 1:2 handle 20: sfq perturb 10
tc qdisc add dev $IFACE parent 1:3 handle 30: tbf rate $UPSPEED burst 4kb mtu 1500 latency 100ms
tc filter add dev $IFACE protocol ip parent 1: prio 1 u32 match ip tos 0xb8 0xff flowid 1:1
tc filter add dev $IFACE protocol ip parent 1: prio 1 u32 match ip tos 0x60 0xff flowid 1:2
RTP and SIP traffic is well managed, being sent to the first and the second band. All other traffic is also well managed, being sent to the third band. However, for some reasons, If I download from the server, it is always at 10-16k/sec instead of the 185-190k (1.5mbit) specified in my script.
Worst, it seems that no matter how I change the tbf variables, the speed stays the same.
Using qdisc -s ls, I managed to find out that packets were dropped :
qdisc prio 1: bands 3 priomap 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 0
Sent 12610974 bytes 45683 pkt (dropped 1147, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 10: parent 1:1 limit 126p quantum 1514b perturb 10sec
Sent 7802180 bytes 36590 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 20: parent 1:2 limit 126p quantum 1514b perturb 10sec
Sent 181620 bytes 283 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc tbf 30: parent 1:3 rate 1500Kbit burst 4Kb lat 100.0ms
Sent 4627174 bytes 8810 pkt (dropped 1147, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
But I don't know why. Again, changed the tbf variables doesn't change anything, packets keep being dropped.
Please note that the mtu of eth1 is 1500.
Anyone?
Add mtu 100000 to your tc qdisc creation command. See this post for more info.
Quoting the post, in case it disappears:
Basically if your interface has TSO/GSO enabled (check using ethtool -k ethX), or you're using the loopback interface - then you'll probably hit a problem. It turns out that the loopback interface has GSO/TSO enabled as default, plus since it is a software interface its default mtu is 16384 (as compared to 1500 for normal Ethernet interface). This matters as the tbf queue checks the size of the incoming 'packets' - which in the case of GSO/TSO are much larger than a normal on-the-wire packet - instead they're up to 9 x iface's mtu. So for normal interfaces it's about 12K, but for loopback it is about 100k!
This appears to apply to Xen interfaces, too:
# ethtool -k eth0
Features for eth0:
rx-checksumming: on [fixed]
tx-checksumming: on
tx-checksum-ipv4: on
tx-checksum-unneeded: off [fixed]
tx-checksum-ip-generic: off [fixed]
tx-checksum-ipv6: off [fixed]
tx-checksum-fcoe-crc: off [fixed]
tx-checksum-sctp: off [fixed]
scatter-gather: on
tx-scatter-gather: on
tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: on # THIS IS TSO
tx-tcp-segmentation: on
tx-tcp-ecn-segmentation: off [fixed]
tx-tcp6-segmentation: off [fixed]
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: on # THIS IS GSO
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: off [fixed]
tx-vlan-offload: off [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: off [fixed]
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
netns-local: off [fixed]
tx-gso-robust: on [fixed]
tx-fcoe-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: on
loopback: off [fixed]
I had the same issue. Turning off segmentation offloading will solve the problem (and you won't need to pass mtu to tc anymore).
sudo ethtool -K eth1 tso off
sudo ethtool -K eth1 gso off
sudo ethtool -K eth1 gro off
sudo ethtool --offload eth1 rx off tx off

Resources