Bài giảng Quản trị Linux - Chủ đề 9: Networking-CentOS

pdf 23 trang phuongnguyen 3250
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Quản trị Linux - Chủ đề 9: Networking-CentOS", để tải tài liệu gốc về máy bạn click vào nút DOWNLOAD ở trên

Tài liệu đính kèm:

  • pdfbai_giang_quan_tri_linux_chu_de_8_networking_centos.pdf

Nội dung text: Bài giảng Quản trị Linux - Chủ đề 9: Networking-CentOS

  1. Đặng Thanh Bình Networking - CentOS
  2. Contents • Network configuration and information • Network configuration commands
  3. NETWORK CONFIGURATION AND INFORMATION
  4. Config 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. • Mandrake/Mandriva: Network and Internet Configuration Wizard • GNOME systems: gnome-network-preferences. • KDE systems: knetworkconf.
  5. Network 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
  6. Network Configuration Files • /etc/hosts
  7. Network Configuration Files • /etc/resolv.conf – Configure access to a DNS server • /etc/nsswitch.conf – Define the order in which to contact different name services. For Internet use, it is important that dns shows up in the "hosts" line:
  8. Network Configuration Files • /etc/sysconfig/network – Định nghĩa các cấu hình network cơ bản cho máy tính. enable network enable network IPv6 tên máy tính so sánh vớ i giá tr ị trong /etc/hosts default gateway củ a máy tính
  9. Network Configuration Files • ifcfg-eth[n] – Each network card has a configuration file in /etc/sysconfig/network-scripts/ifcfg-eth[n]. – n: start from 0. – Loopback card config file ifcfg-lo tên card mạ ng gán IP tĩnh, hoặ c DHCP active khi boot.
  10. Network Configuration Files • /etc/services – File /etc/services gồm một danh sách network port và các service sử dụng những port này. – Khi định nghĩa một service mới, người quản trị phải định nghĩa một cặp service name và port number vào file /etc/services. – 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
  11. NETWORK CONFIGURATION COMMANDS
  12. ip command • Assigning IP addresses to interfaces • Setting up routes to the internet and to other networks • Displaying TCP/IP configurations •
  13. ip command
  14. ifconfig command • Displaying network interface information
  15. ifconfig command • Display details of all interfaces including disabled interfaces # ifconfig -a • Disable an Interface # ifconfig eth0 down • Enable an Interface # ifconfig eth0 up
  16. ifconfig 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
  17. ifconfig command • Change MTU – MTU is the maximum number of octets the interface is able to handle in one transaction – For Ethernet the Maximum transmission unit by default is 1500 # ifconfig eth0 mtu NUMBER
  18. ifup, ifdown command • Lệnh ifup dùng để enable một interface. • Lệnh ifdown dùng để disable một interface.
  19. netstat command • Checking the host configuration • Routing information can be displayed with the -nr option • ip route show
  20. host command • Display information on hosts or domains • Simlar to dig command
  21. ping command • To check if a host is alive
  22. traceroute command • Check the route that packets follow to a network host • On some systems, traceroute has been renamed to tracepath
  23. whois command • Specific domain name information can be queried using the whois command