Brainscape_Lynda.com-Linux-Network_Configuration_Flash_Cards_CSV Flashcards

1
Q

Which networking tools are now considered obsolete?

A

The ‘ifconfig’ tools

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

What two commands have replaced ifconfig?

A

ip or iproute

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

What popular tool can be used across distros?

A

NetworkManager

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

What is the ip command to see all network devices on the system?

A

ip addr’

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

When using the ip command, how can you tell which is the mac address?

A

It is listed after the ‘link/ether’ header

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

When using the ip command, how can you tell which is the ip address in use?

A

It is listed after the ‘inet’ header for each network device

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

When using the ip command, how can you tell if DHCP is being used to get the ip address?

A

The work ‘dynamic’ will be on the same line as the ‘inet’ header

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

What is the ip command to see only ipv4 network information?

A

ip -4 addr’

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

When using the ip command, how can you see how long your DHCP lease has before it expires?

A

The number of seconds is listed after the ‘valid_lft’ header

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

What is the ‘shortest’ ip command you can use to show only ipv4 address information for network devices on the system?

A

ip -4 a’

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

When looking at the ip information, how can you tell if the network device is connected to a physical network?

A

It will have ‘LOWER UP’ in the angle brackets. This means the lower protocols are working on the networking device.

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

Using the ip command, what is the syntax to take a network device completely offline?

A

sudo ip link set [network device name] down

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

Using the ip command, what is the syntax to bring a network device completely online?

A

sudo ip link set [network device name] up

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

What is the syntax to use the ethtool command to see more information about a network device?

A

ethtool [network device name]

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

What does PNIN stand for?

A

Predictable Network Interface Names

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

What software system brought in ‘Predictable Network Interface Names’?

A

systemd

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

What is the difference between ‘Predictable Network Interface Names’ and older ways of naming network devices on Linux systems?

A

The Predictable Network Interface Names are based on the ‘location’ of the network device in the system and should not change. The older method named them by which network device was found first, second, etc. and that could lead to the names changing unexpectedly.

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

Using the PNIN name of ‘enp0s3’, what does the first two characters specify?

A

The ‘type’ of network device.

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

What are two common ‘types’ as pertains to the PNIN naming?

A
  1. en = Ethernet 2. wl = Wireless
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Using the PNIN name of ‘enp0s3’, what does the third and fourth characters specify?

A

The ‘bus’ the network device is connected to. ‘p0’ is PCI bus 0.

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

What two common busses would a network device be connected to and how would these be represented in PNIN naming?

A
  1. p = PCI 2. u = USB. The number following would be the number for the bus.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Using the PNIN name of ‘enp0s3’, what does the last two characters specify?

A

The ‘slot’ the network device is plugged into. ‘s3’ is Slot 3.

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

What is one way you can tell if NetworkManager is running on your Linux system?

A

sudo systemctl status NetworkManager

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

What is the syntax to install NetworkManager if it is not installed on a CentOS system?

A

sudo yum install NetworkManager

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

What command would you run to see what network devices are being managed by NetworkManager?

A

nmcli device. Look under the ‘STATE” column.

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

What is the syntax to restart the network service on a CentOS machine?

A

sudo systemctl restart network

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

How do you set a network device on CentOS so it is ‘managed’ by NetworkManager?

A

You don’t. By default, all network devices are managed by Network Manager unless you specifically configure them NOT to be managed.

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

Once CentOS and RHEL, what is the path to where the network device configuration files are located?

A

/etc/sysconfig/network-scripts

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

There will always be one network device that is not being managed by NetworkManager, which is it?

A

The loopback device (lo)

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

What is the naming convention of the network device configuration files on CentOS and RHEL?

A

ifcfg-[PNIN name] = ifcfg-enp0s3 (for example)

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

How would you configure a network device to NOT be managed by NetworkManager?

A
  1. Edit the network device’s configuration file in the /etc/sysconfig/network-scripts directory. 2. Add ‘NM_CONTROLLED=no’ to the file. 3. Restart the network service.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

On Debian-based systems, how do you configure a network device to be managed?

A
  1. Edit the /etc/NetworkManager/NetworkManager.conf file 2. Under the [ifupdown] stanza, change managed to ‘true’. 3. Restart the network (sudo systemctl restart NetworkManager)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What are your options to changing network settings when using NetworkManager?

A

Either use the GUI tools or the CLI tools

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

What is the syntax to start the NetworkManager GUI from the CLI?

A

nm-connection-editor

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

What is the difference between a network Device and a network Connection?

A

The network device is the ‘hardware’ device that connects to the network. The network connection is a ‘profile’ that contains a collection of settings that can be applied to a network device.

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

Can you have more than one connection profile per network device?

A

Yes. But only one can be active at any one time.

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

In NetworkManager, what is the ‘default’ name for a connection profile?

A

It uses the same name as the PNIN name of the network device (which can be confusing).

38
Q

What is the syntax to show the connection profile for a particular device.

A

nmcli connection show [connection profile name]

39
Q

What is the syntax to edit a connection in NetworkManager?

A

nmcli con edit [connection profile name]. You can shorten ‘connection’ and ‘edit’ as long as they are unique.

40
Q

Once you are in the edit mode in NetworkManager so you can edit a connection profile, how do you rename a profile?

A
  1. Type ‘set connection.id [new name]. 2 Save your work with ‘save’. 3. Quit the edit mode with ‘quit’
41
Q

When you change a connection profile name, do you need to restart NetworkManager or the network service?

A

No.

42
Q

If you are in edit mode in Network Manager, what two commands can help you understand the different options you can edit?

A

Use ‘print’ and ‘describe’ to see more information about options that can be edited.

43
Q

How do you set a connection profile to be used automatically in Network Manager?

A
  1. Edit the connection profile. 2. Type ‘set connection.autoconnect yes’. 3. Confirm the change with ‘yes’. 4. Quit edit mode.
44
Q

What is the syntax to take down a connection (if you make a change that requires it to be taken down then brought back up, for example)?

A

nmcli con down [connection profile name]

45
Q

What is the syntax to bring up a connection (if you make a change that requires it to be taken down then brought back up, for example)?

A

nmcli con up [connection profile name]

46
Q

How do you setup a connection profile (in Network Manager) to use DHCP to get its address (from the CLI)?

A
  1. Edit the connection profile. 2. Type ‘set ipv4.method auto’ to change it to DHCP. 3. Save your changes with ‘save’. 4. Quit edit mode with ‘quit’.
47
Q

What is the syntax to create a new connection profile from the CLI?

A

nmcli con add con-name [connection profile name] ifname [PNIN name] type ethernet.

48
Q

If you create a new connection profile, does it get an ip address by default?

A

Yes. All new profiles will be set to use DHCP by default.

49
Q

Using Network Manager, how do you switch the connection profile from one to another?

A

Run ‘nmcli con up [connection profile name] on the one you want active and it will ‘take over’.

50
Q

When you use the GUI for NetworkManager to put a static ip address on a connection profile, does the new ip address get used as soon as you save your changes?

A

No. You need to down and up the connection profile for it to work.

51
Q

What is the list of steps to set a static ip address on a connection profile from the CLI, using NetworkManager?

A
  1. Edit the connection profile. 2. Remove the current ipv4 ip address by typing ‘remove ipv4.addresses’. 3. Add a new ip address by typing ‘set ipv4.addresses [ip address/mask]’. 4. Add a gateway by typing ‘set ipv4.gateway [gw_ip_addr]’. 5. Add a DNS server by typing ‘set ipv4.dns [dns_ip_addr]’. 6. Save your changes by type ‘save’. 7. Quit by typing ‘quit’. 8. Down and up the connection profile and it should use the new ip address.
52
Q

What is the syntax to set a static ip address from the CLI all on one line (if you were going to script it), using NetworkManager?

A

nmcli con mod [connection profile name] ipv4.addresses [ip_addr/mask] ipv4.gateway [gw_ip_addr] ipv4.dns [dns_ip_addr] (Note: this modifies an existing connection profile, it does not create one at the same time. Also, you still need to down and up the connection profile for the new ip address to be used.)

53
Q

What is the syntax of the nmcli command when you type nmcli –help at the CLI?

A

nmcli [OPTIONS] OBJECT { COMMAND | help }

54
Q

What are the objects you can ‘operate’ on using the nmcli command?

A
  1. g[eneral] 2. n[etworking] 3. r[adio] 4. c[onnection] 5. d[evice] 6. a[gent] 7. m[onitor]
55
Q

What is the syntax to use the nmcli command to create a new connection profile and give it an ip address?

A

nmcli con add con-name [connection profile name] ipv4.addresses [ip_addr/mask] ipv4.gateway [gw_ip_addr] ipv4.dns [dns_ip_addr] ifname [PNIN name] type ethernet

56
Q

What is the nmcli command to see the available wireless networks?

A

nmcli d wifi list

57
Q

What is the nmcli command to add a connection profile to connect to a wireless network?

A

nmcli con add con-name [connection profile name] ifname [PNIN name] type wifi ssid ‘[wireless network name]’ (Note: I believe the single quotes are because the wireless network used in the demo had spaces in it.)

58
Q

What is the nmcli command to add the wifi network password to the connection profile?

A

nmcli con mod [connection profile name] wifi-sec.key-mgmt [wifi security protocol - wep, wpa-psk, etc.] wifi-sec.psk ‘[password for wifi network]’

59
Q

On a Debian-based system, what is the location and file that allows you to control networking?

A

/etc/network/interfaces

60
Q

If you have Network Manager installed and you add settings for a managed network device in the interfaces files, what happens?

A

Network Manager should treat that network device as unmanaged.

61
Q

There are two lines you can put in the interfaces file to allow the network device to connect to the network automatically, what are they?

A
  1. allow-hotplug [PNIN name] 2. auto [PNIN name]
62
Q

What is the line you put in the interfaces file (on a Debian-based system) to allow a network device to get a DHCP ip address?

A

iface [PNIN name] inet dhcp

63
Q

What are the two commands (in Debian-based systems) that use the interfaces file to control networking?

A
  1. ifup 2. ifdown
64
Q

What is the command (on a Debian-based system) to bring an interface down?

A

ifdown [PNIN name]

65
Q

What is the command (on a Debian-based system) to bring an interface up?

A

ifup [PNIN name]

66
Q

What four lines need to be added to the interfaces file (on a Debian-based system) to configure a network device with a static ip address?

A
  1. iface [PNIN name] inet static 2. address [ip_addr] 3. netmask [mask] 4. gateway [gw_ip_addr] 5. dns-nameservers [dns_ip_addr]
67
Q

What is one way to find your wifi network device in a Debian-based system?

A

Run ‘ip -a’ and look for a network device whose name begins with ‘wl’

68
Q

What lines would you add to the interfaces file set setup your wifi network adapter?

A
  1. allow-hotplug [PNIN name] 2. iface [PNIN name of wifi network device] inet dhcp 3. wpa-ssid [name of wifi network] 4. wpa-psk [“wifi passwod in double quotes’]
69
Q

What does the “HWADDR” key/value pair in the ifcfg-[PNIN name] file do?

A

This is the actual hardware (mac) address of the network device. It is used by Network Manager definitely identify the exact network device that should be associated with an ifcfg-* configuration file.

70
Q

How does Network Manager know to look at the /etc/sysconf/network-scripts directory in CentOS to see which network devices it should manage?

A

There is a stanza in the /etc/NetworkManager/NetworkManager.conf file that tells it to look in that directory for any ‘ifcfg-*’ files. The stanza is called [main] and the line beneath the stanza header is plugins=ifcfg-rh.

71
Q

What do plugins in Network Manager do?

A

They allow Network Manager to read and write data to files.

72
Q

What is another way to tell Network Manager whether to manage a network device in CentOS?

A
  1. Add the plugins=keyfile plugin to the NetworkManager.conf file (in the [main] stanza). 2. Create a [keyfile] stanza 3. Add the following line in the [keyfile] stanza: unmanaged-devices=mac:[mac of network device to NOT manage];mac[mac of another network device to NOT manage (if needed)]
73
Q

What is the proper way to disable NetworkManager on CentOS 7 and newer?

A
  1. Stop NetworkManager (systemctl stop NetworkManager). 2. Disable NetworkManager (systemctl disable NetworkManager). 3. Reboot the system (there are still some binaries that continue to run until the server is rebooted).
74
Q

What lines do you need to set or add to configure a static ip address in ifcfg-* configuration file?

A
  1. Set BOOTPROTO=none Add the following to the file: IPADDR=[ip_addr], NETMASK=[mask], GATEWAY=[gw_ip_addr], DNS1=[ip_addr], DNS2=[ip_addr]
75
Q

In an Ethernet configuration file, what does the BOOTPROTO setting do?

A

It determines whether the system should look for a boot server when booting up to get an ip address.

76
Q

What are the supported settings for the BOOTPROTO setting?

A
  1. none 2. bootp 3. dhcp
77
Q

In an Ethernet configuration file, what does the DEVICE setting do?

A

This lists the network device this configuration file is associated with.

78
Q

In an Ethernet configuration file, what does the DHCP_HOSTNAME setting do?

A

This option is used only if the DHCP server requires the client to specify a hostname before receiving an ip address.

79
Q

In an Ethernet configuration file, how do you specify which DNS servers to use?

A

Enumerate each DNS server by putting a DNSx=[dns_server_ip_addr] option on each line. DNSx refers to DNS1, DNS2, etc.

80
Q

In an Ethernet configuration file, what does the HWADDR setting do?

A

This is the mac address of the network device this configuration file pertains to. The mac address is in the xx:xx:xx:xx:xx:xx format. This ensure the configuration file is always applied to the correct network device since the mac address is ‘burned into’ the network device.

81
Q

In an Ethernet configuration file, what does the IPADDR setting do?

A

This is where you specify the ip address the system should use.

82
Q

In an Ethernet configuration file, what does the NETMASK setting do?

A

This is how you specify what subnet mask to use with the IPADDR entered.

83
Q

In an Ethernet configuration file, what does the ONBOOT setting do?

A

This specifies whether the device should be activated at boot-time.

84
Q

What are the two options you can use with the ONBOOT setting in the Ethernet configuration file?

A
  1. yes = this device should be activated at boot-time 2. no = this device should NOT be activated at boot-time.
85
Q

What is the command to generate a UUID for a network device (to put into the Ethernet configuration file, for example)?

A

uuidget [PNIN name]

86
Q

In an Ethernet configuration file, what does the UUID setting do?

A

Network Manager uses UUID’s to identify network devices and this entry in a ifcfg-* file is ONLY used by Network Manager. If you are not using Network Manager, this settings is NOT required.

87
Q

What options should be in your Ethernet configuration file to allow a network device to get an ip address via DHCP?

A

DEVICE=[PNIN name], TYPE=Ethernet, ONBOOT=yes, IPV4_FAILURE_FATAL=yes, BOOTPROTO=dhcp

88
Q

What options should be in your Ethernet configuration file to allow a network device to get a static ip address?

A

DEVICE=[PNIN name], TYPE=Ethernet, ONBOOT=yes, IPV4_FAILURE_FATAL=yes, BOOTPROTO=none, IPADDR=[ip_addr], NETMASK=[mask], GATEWAY=[gw_ip_addr]

89
Q

What is the syntax to change the hostname using nmcli?

A

nmcli general hostname [new_hostname]

90
Q

What is the syntax to change the hostname using systemd?

A

hostnamectl set-hostname [new_hostname]

91
Q

What are iptable rules called?

A

chains’

92
Q

What are the two most common rules that you will work with in iptables?

A

Input’ and ‘Output’ rules or chains