Linux Networking 5 — Questions and Answers
Question 1: Which command brings a network interface down without removing its configuration?
- ip link set eth0 down (Correct answer)
- ip addr del eth0
- ifconfig eth0 remove
- nmcli eth0 stop
Correct answer: ip link set eth0 down
`ip link set <interface> down` disables the interface at the link layer while preserving its address configuration.
Question 2: What does the `/proc/net/if_inet6` file contain?
- IPv6 addresses assigned to network interfaces (Correct answer)
- IPv6 routing table entries
- DNS resolver cache for IPv6
- IPv6 firewall rules
Correct answer: IPv6 addresses assigned to network interfaces
`/proc/net/if_inet6` lists all IPv6 addresses currently assigned to network interfaces along with their prefix lengths and flags.
Question 3: Which `nftables` command lists all current rulesets?
- nft list ruleset (Correct answer)
- nft show rules
- nft -L all
- nft dump tables
Correct answer: nft list ruleset
`nft list ruleset` displays the complete nftables configuration including all tables, chains, and rules.
Question 4: What is a network namespace in Linux used for?
- Isolating network stack instances for containers or processes (Correct answer)
- Naming convention for network interfaces
- Grouping firewall rules by application
- Assigning DNS namespaces to services
Correct answer: Isolating network stack instances for containers or processes
Linux network namespaces create isolated copies of the entire network stack, enabling containers to have their own interfaces, routes, and firewall rules.
Question 5: Which command would display the MAC address of the `eth0` interface?
- ip link show eth0 (Correct answer)
- ip addr show eth0
- arp -i eth0
- netstat -i eth0
Correct answer: ip link show eth0
`ip link show <interface>` displays link-layer information including the hardware (MAC) address of the interface.
Question 6: What does the `-p` flag add to `netstat` or `ss` output?
- Shows the process name and PID owning each socket (Correct answer)
- Prints only TCP protocol sockets
- Displays port numbers instead of service names
- Filters output to passive (listening) sockets only
Correct answer: Shows the process name and PID owning each socket
The `-p` flag appends the process name and PID responsible for each socket, useful for identifying which application owns a connection.
Question 7: What is the function of the `bond0` interface type in Linux?
- Aggregates multiple physical interfaces for redundancy or throughput (Correct answer)
- Creates a virtual bridge between two subnets
- Bonds IPv4 and IPv6 stacks on a single interface
- Provides NAT bonding between private and public IPs
Correct answer: Aggregates multiple physical interfaces for redundancy or throughput
Linux bonding (bond0) combines multiple NICs into one logical interface, providing link aggregation for failover or increased bandwidth.
Which command brings a network interface down without removing its configuration?