CentOS 7 Network Configuration and Troubleshooting Notes
Viewing TCP/IP Parameters in CentOS 7
To check TCP/IP settings, use either the CentOS GUI or terminal commands.
Accessing Settings via GUI:
Go to Applications > System Tools > Settings > Network.
Highlight the active network connection to view Ethernet Device settings. This interface provides a user-friendly way to manage network configurations.
When set to DHCP, the IP address is assigned automatically from an external server, simplifying the process of connecting to different networks without manual input.
Using Terminal Commands to View Settings:
The ifconfig command displays network adapter information, including IP address, netmask, and broadcast address.
Note: ifconfig has been deprecated in some systems, which may limit its use in future versions of Linux.
The ip command is preferred, offering more features and flexibility, requiring multiple sub-commands:
Use
ip -d addrfor detailed IP addresses associated with each interface, showing additional information such as state and associated protocols.Use
ip -d routefor the default gateway, revealing the routing table information crucial for determining packet paths.DNS lookup settings can be found in the file /etc/resolv.conf. This file is key for resolving domain names into IP addresses during web requests.
Example: DNS server notation is
nameserver 8.8.8.8(Google DNS), ensuring high availability and reliability when querying domain names.
Checking Network Resources in CentOS 7
Ping Command:
Use
pingto test communication between computers, useful for troubleshooting network connectivity.A successful ping returns how many bytes were sent and the response time, which can help assess network speed.
If the command fails, it indicates a problem (e.g. "Destination Host Unreachable"), prompting further investigation into network settings.
Example:
ping 192.168.1.1orping www.sun.com(using domain name) showcases the command’s versatility in testing both local and external connectivity.
Traceroute Command:
Use
tracerouteto see every hop in a network connection, thus providing insights into the path packets take to reach their destination.Displays paths through switches, routers, and firewalls, enabling identification of network bottlenecks or failures.
May display *** symbols when communication fails or is blocked, indicating points of failure.
Accessing Network Resources in CentOS 7
Accessing shared files in CentOS is similar to Windows 10, making it easy for users familiar with both systems to navigate.
Mounting a Share:
Create a directory for the mount point, which serves as the local access point for the remote share.
Use the mount command with the share's UNC path and the destination directory, establishing the connection to the shared resource itself.
Example Command:
mount -t cifs //server/share /mnt/point -o username=user,password=passillustrates how to specify authentication details and network locations.After the share is mounted, change to the mount directory and view files using command
ls, allowing seamless access to shared resources.Alternatively, use File Browser to view mounted file entries visually, which provides an accessible interface for file management.
Be aware that if the computer sharing files shuts down, the directory may appear empty until it's remounted, which is critical to note for continuous access to shared data.