Hi, a basic question. How do I know the network interface used...getting the bel . . .

Subba:
Hi, a basic question. How do I know the network interface used…getting the below when I do ifconfig -a…dont see any interface file in /etc/network…also couldnt find anything regarding eth0 and eth1 in ‘ip link’ command. As per the lab test, answer is eth1

root@controlplane:~# ifconfig -a
cni0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1400
inet 10.244.0.1 netmask 255.255.255.0 broadcast 10.244.0.255
ether 76:48:12:69:f7:7b txqueuelen 1000 (Ethernet)
RX packets 3217 bytes 262168 (262.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3382 bytes 320671 (320.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.12.0.1 netmask 255.255.255.0 broadcast 172.12.0.255
ether 02:42:c2:65:51:11 txqueuelen 0 (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

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450
inet 10.7.80.3 netmask 255.255.255.0 broadcast 10.7.80.255
ether 02:42:0a:07:50:03 txqueuelen 0 (Ethernet)
RX packets 5663 bytes 587579 (587.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4407 bytes 2027914 (2.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.48 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:ac:11:00:30 txqueuelen 0 (Ethernet)
RX packets 201 bytes 37422 (37.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 129 bytes 11862 (11.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Mohamed Ayman:
if you enter ip link will show you interfaces. you should see the interface and virtual and localhost. the interface responsible for communication between nodes is the interface you can check it by IP link , you should see the name is ens3
master $ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 02:42:ac:11:00:62 brd ff:ff:ff:ff:ff:ff3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default link/ether 02:42:17:78:93:fd brd ff:ff:ff:ff:ff:ff

Subba:
I dont see anything with ens3. Since I dont see ens3 or /etc/network/interfaces file, I assume I should select the interface which has the same IP as the node…not sure if this assumption is correct

root@controlplane:~# ip link
1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; 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
2: docker0: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP&gt; mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 02:42:87:d2:fa:c9 brd ff:ff:ff:ff:ff:ff
3: flannel.1: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1400 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/ether 22:97:d8:aa:2f:71 brd ff:ff:ff:ff:ff:ff
4: cni0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1400 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 6a:0a:9b:ad:fb:5f brd ff:ff:ff:ff:ff:ff
5: veth57129f65@if3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1400 qdisc noqueue master cni0 state UP mode DEFAULT group default
link/ether 6a:1f:f6:b1:9e:80 brd ff:ff:ff:ff:ff:ff link-netnsid 2
6: vethe19df41a@if3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1400 qdisc noqueue master cni0 state UP mode DEFAULT group default
link/ether fe:1b:6d:a2:69:9d brd ff:ff:ff:ff:ff:ff link-netnsid 3
90068: eth0@if90069: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1450 qdisc noqueue state UP mode DEFAULT group default
link/ether 02:42:0a:09:06:03 brd ff:ff:ff:ff:ff:ff link-netnsid 0
90070: eth1@if90071: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UP mode DEFAULT group default
link/ether 02:42:ac:11:00:11 brd ff:ff:ff:ff:ff:ff link-netnsid 1

Mayur Sharma:
@Subba I follow this,

kubectl get nodes -o wide

Note the Internal IP and then grep in ifconfig or ip link.
The corresponding interface is our answer.