Configure Networking and Hostname Resolution Statically or Dynamically Flashcards

1
Q

Add/delete ip-address to specified interface

A

ip addr add/del 192.168.0.100/24 dev eth0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Show ip-address for specified interface

A

ip addr show eth0

ip addr show dev eth0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Test availability of destination host
Test the same but with specified number of packets
Test the same using ipv4 proto
Test the same using ipv6 proto

A

ping 192.168.0.35
ping -c 10 192.168.0.35
ping -4 -c 10 198.168.0.35
ping -6 -c 10 ::1 or ping6 -c 10 ::1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Display all hops a packet will traverse to get the destination
The same but instead of using icmp use tcp packets
The same but using ipv6 proto

A

traceroute google.com
traceroute -T 8.8.8.8
traceroute -6 ::1/ traceroute6 ::1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Display all hops a packet will traverse to get the destination using UDP instead of icmp by default

A

tracepath google.com

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Display network status and states listening on tcp, udp protos
Display the same and show process id listening on these ports
Display routing table
Display all listening and non-listening sockets (established), show numerical addr instead symbolic host

A

netstat -tul
netstat -tulp
netstat -r
netstat -an

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Modern tool to display network status and states

A

ss

P.S. (no support to show routing table i.e. -r switch)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Show link statistics

A

ip -s link show eth0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Show current device status on the system

A

ls /sys/class/net

nmcli dev status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Run UI tool for managing connections

The same text based interface

A

nm-connection-editor

nmtui

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Connection config location

A

/etc/sysconfig/network-scripts/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Add new connection

A

nmcli con add con-name “backup” type ethernet ip4 192.168.0.122/24 gw4 192.168.0.1 ifname eth0 autoconnect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Get host name

A

hostname

hostnamectl status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Set host name which will survive after reboot

A

hostnamectl set-hostname Host1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Set dns to 8.8.8.8 for connection eth0
Set additional dns server to 4.4.0.0 for eth0
Remove dns entry=8.8.8.8 for eth0 connection

A

nmcli con mod “eth0” ipv4.dns 8.8.8.8
nmcli con mod “eth0” +ipv4.dns 4.4.0.0.
nmcli con mod “eth0” -ipv4.dns 8.8.8.8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Set eth0 to connect on boot

A

cat /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=no
nmcli con mod eth0 connection.autoconnect yes=>
cat /etc/sysconfig/network-scripts/ifcfg-eth0:
ONBOOT=yes