Bài giảng Quản trị Linux cung cấp những kiến thức cơ bản về networking - CentOS. Những nội dung chính được trình bày trong chương này gồm có: network configuration and information, network configuration commands. Mời các bạn cùng tham khảo.
Trang 1Đặng Thanh Bình
Networking - CentOS
Trang 2• Network configuration and information
• Network configuration commands
Trang 3
NETWORK
CONFIGURATION AND INFORMATION
Trang 4Config Of Network Interfaces
• Ubuntu configuration is done selecting
System->Administration->Networking.
• RedHat/CentOS: redhat-config-network
– has both a graphical and a text mode interface.
Configuration Wizard
• GNOME systems: gnome-network-preferences.
• KDE systems: knetworkconf.
Trang 5Network Interface Names
• lo or the local loop is linked with the internal 127.0.0.1 address
• eth0: a standard network interface card
• ppp0: the modem
Trang 6Network Configuration Files
• /etc/hosts
Trang 7Network Configuration Files
• /etc/resolv.conf
• /etc/nsswitch.conf
name services For Internet use, it is important
Trang 8Network Configuration Files
Trang 9Network Configuration Files
active khi boot.
Trang 10Network Configuration Files
– Port 0 – 1024: là những port đã được dành riêng.
– Port > 1024: port được định nghĩa thêm vào tùy theo nhu cầu của ứng dụng
Trang 11
NETWORK
CONFIGURATION COMMANDS
Trang 12ip command
• Assigning IP addresses to interfaces
• Setting up routes to the internet and to other networks
• Displaying TCP/IP configurations
• …
Trang 13ip command
Trang 14ifconfig command
• Displaying network interface information
Trang 16ifconfig command
• Assign ip-address to an Interface
# ifconfig eth0 192.168.2.2
• Change Subnet mask of the interface eth0.
# ifconfig eth0 netmask 255.255.255.0
• Change Broadcast address of the interface eth0.
# ifconfig eth0 broadcast 192.168.2.255
• Assign ip-address, netmask and broadcast at the same time to interface eht0.
# ifconfig eth0 192.168.2.2 netmask 255.255.255.0
broadcast 192.168.2.255
Trang 17ifconfig command
• Change MTU
interface is able to handle in one transaction
default is 1500
# ifconfig eth0 mtu NUMBER
Trang 18ifup, ifdown command
• Lệnh ifup dùng để enable một interface
• Lệnh ifdown dùng để disable một interface
Trang 19netstat command
• Checking the host configuration
• Routing information can be displayed with the -nr option
• ip route show
Trang 20host command
• Display information on hosts or domains
• Simlar to dig command
Trang 21ping command
• To check if a host is alive
Trang 23whois command
• Specific domain name information can be queried using the whois command