Loading...
Linux Interview QuestionsUncategorized

IP Configuration

1. What is an IP address?
A) A unique numerical identifier assigned to a device on a network.

2. What is a Public IP address?
A) Public IP is an address assigned by an ISP that is globally unique and can be accessed over the Internet.
It identifies your device or server on the internet.

3. What is a Private IP address?
A) A Private IP is used within a local network (LAN/WAN).
It is not routable on the internet directly and requires NAT (Network Address Translation) to communicate outside.

4. What is a Gateway in networking?
A) A gateway is a device (usually a router) that acts as a bridge between two networks.
It allows devices in one network (like your local LAN) to communicate with devices in another network (like the Internet).

5. What is the difference between static and dynamic IP addressing?
A)

  • Static IP is manually assigned and permanent, used for servers.
  • Dynamic IP is automatically assigned by DHCP and can change, used for client devices

6. What is the difference between IPv4 and IPv6?
A) IPv4 = 32-bit (e.g., 192.168.1.1), IPv6 = 128-bit (e.g., 2001:db8::1).

7. How do you check IP configuration in Linux?
A)

ip addr show

# or

ifconfig

8. How do you assign a static IP temporarily in Linux?
A)

ip addr add 192.168.1.10/24 dev eth0

9. How do you remove an IP address from an interface?
A) ip addr del 192.168.1.10/24 dev eth0

10. How do you make a static IP permanent?
A) Edit network config files (/etc/sysconfig/network-scripts/ifcfg-eth0 in RHEL, /etc/netplan/*.yaml in Ubuntu).

11. How do you view routing information?
A)

ip route show

12. How do you configure multiple IPs on the same NIC?
A)

ip addr add 192.168.1.20/24 dev eth0
ip addr add 192.168.1.21/24 dev eth0

13. What is subnetting and why is it used?
A) Subnetting = splitting a network into smaller parts for efficiency, performance, and security.

14. What is the difference between TCP and UDP?
A)TCP(Transmission Control Protocol) is connection-oriented, reliable, and ensures packet order; used for HTTP/SSH.
UDP(User Datagram Protocol) is connectionless, faster, unreliable, and used for DNS, VoIP, or streaming

15. ping is working, but ssh is failing by hostname. Why?
A) The hostname may resolve to the wrong IP or SSH might be blocked.  Check name resolution (getent hosts)(nslookup <hostname>), ensure SSH is running on the server(systemctl status sshd), and verify firewall/SELinux rules.

16. What is the use of ping and traceroute commands?
A) Ping checks connectivity and response time between devices, while traceroute shows the path and hops taken to reach a destination for troubleshooting.

17. How do you test connectivity to another host?
A)

ping <IP>

18. A server has no internet access. What do you check?
A) Verify:

  • IP address
  • Subnet mask
  • Default gateway
  • DNS config
  • Firewall rules

19. How do you configure DNS servers in Linux?
A) Add entries in /etc/resolv.conf:

nameserver 8.8.8.8
nameserver 1.1.1.1

20. What is network bonding?
A) Network bonding means combining two or more network interfaces (NICs) into a single logical interface.
Purpose: high availability (failover) and/or increased bandwidth (load balancing).

21.How do you configure static IP addresses?
A) To configure a static IP, I either edit the network configuration files (/etc/sysconfig/network-scripts/ifcfg-* on RHEL, or Netplan YAML on Ubuntu) or
use tools like nmcli. I set the IP, gateway, and DNS, then restart networking and verify with ip addr and ping

Leave a Reply

Your email address will not be published. Required fields are marked *