Linux Network Basics articles

The basic principle visit the Web site:
          ip address website name ==== ====> website> ip address of the appropriate server


Network infrastructure configuration:
1. Modify the host name:
a temporary method: [root @ zr666 ~] # hostname name
                  [root @ zr666 ~] # logout
permanent method: [root @ zr666 ~] # vi / etc / sysconfig / Network
                  NETWORKING = yes
                   HOSTNAME = zr666
      Tip: after modification, execution /etc/init.d/network restart or source / etc / sysconfig / network does not take effect
                 if you want to change this to a single file may need to restart the server
2. Description NIC configuration file : [root
@ zr666 ~] # CAT / etc / sysconfig / Network-scripts / the ifcfg-eth0
the DEVICE = "eth0"
BOOTPROTO = "dhcp"
HWADDR = "00: 0C: 29: 42: 02: 52"
IPV6INIT = "yes "
NM_CONTROLLED =" yes "
ONBOOT =" yes "
the TYPE =" Ethernet "
UUID =" 0d6217fa-Ac6a-40e2-ab74-6a3cf7f030f8 "
Configuration is complete restart card: /etc/init.d/network restart ----------------- make the card configuration to take effect immediately, without restarting the machine
under linux ban, enabled NIC:
ifconfig eth0 . Down
the ifconfig eth0 up
3. configure IP address changes:
configure alias ip: IP and mask with: [root @ zr666 ~] # ifconfig eth0: 0 192.168.86.1 netmask 255.255.255.0 up restart failure
4. modify the DNS
VI / etc /resolv.conf
# Generated by NetworkManager
Domain localdomain
Search localdomain
nameserver 192.168.86.2
try to configure / etc / sysconfig / Network-scripts / the ifcfg-eth0
5. configure the default gateway:
also went NIC configuration file gATEWAY = 1.1.1.1
command line modify gateway: provisional entry into force of the
deleted gateway [root @ zr666 ~] # route del default gw 1.1.1.1
Add the gateway [root @ zr666 ~] # route add default gw 1.1.1.1
first entry into force of the card file is the configuration file
of the second file to take effect is / etc / sysconfig / network
Command line temporarily to take effect: the Add default route gw 1.1.1.1
6. Check IP, gateway or routing, DNS configuration:
    Check the IP method: ifconfig # display all card information
    view network routing method: route -n
    view the DNS configuration: cat / etc /resblv.conf# commonly used method
    to view the DNS to access specific analysis process: dig site name
7. troubleshooting
If you win and Linux server can not connect to the network, describe the investigation method
          Tip: check the basic idea:
           a physical link is smooth
           b this set case machines ip, routing, DNS whether the target
           c to test the patency of the gateway or routing. Testing the first test and then measuring the gateway router one level
           patency d public IP ping test
            e patency test DNS, domain names can ping to see if the corresponding ip
Summary:
Basic Process 1. Graphic user access to websites
2.DNS What
3.DNS resolve illustrating the principles of


4.修改主机名
5.修改网卡,编辑网卡配置文件,重启网卡
6.配置默认网关
7.查看设备
8.查看网络状态
win下跟踪路由命令:tracert -d 域名
Linux下跟踪路由:traceroute   域名
8.网络检查
a.ping命令检查   
b.traceroute 跟踪路由
c.telnet 1.1.1.1  端口号  检查服务器端口有没有开启
   nmap 1.1.1.1 -p  端口
9.无法上网排错
10.网站服务器访问慢,打不开排错

 

Guess you like

Origin www.cnblogs.com/zrxuexi/p/11131647.html