networking - centos · 09/01/2018 · • mandrake/mandriva: network and internet configuration...
TRANSCRIPT
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.
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
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:
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 networkenable network IPv6
tên máy tính
default gateway c a máy tínhủ
so sánh v i giá tr ớ ịtrong /etc/hosts
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.
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
ip command
• Assigning IP addresses to interfaces• Setting up routes to the internet and to other
networks• Displaying TCP/IP configurations• …
ifconfig command
• Display details of all interfaces including disabled interfaces
# ifconfig -a• Disable an Interface
# ifconfig eth0 down• Enable an Interface
# ifconfig eth0 up
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
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
ifup, ifdown command
• Lệnh ifup dùng để enable một interface.• Lệnh ifdown dùng để disable một interface.
netstat command
• Checking the host configuration• Routing information can be displayed with
the -nr option
• ip route show
traceroute command
• Check the route that packets follow to a network host
• On some systems, traceroute has been renamed to tracepath