centosÔõôÉèÖÃÍø¹Ø
Òª½« centos ÉèÖÃΪÍø¹Ø£¬Ðè¾ÙÐÐÒÔÏ°취£º1. ÉèÖÃÍøÂç½Ó¿Ú£¬Ìí¼Ó gateway Öµ£»2. ÉèÖÃĬÈÏÍø¹Ø£¬Ö¸¶¨ dns ÐÅÏ¢£»3. Æô¶¯ÍøÂçЧÀÍ£»4. ²âÊÔÍø¹ØÅþÁ¬£»5. ÉèÖ÷À»ðǽ£¨¿ÉÑ¡£©ÒÔÔÊÐíÁ÷Á¿Í¨¹ýÍø¹Ø¡£
ÔõÑùÔÚ CentOS ÖÐÉèÖÃÍø¹Ø
Òª½« CentOS ϵͳÉèÖÃΪÍø¹Ø£¬ÐèÒªÖ´ÐÐÒÔÏ°취£º
1. ÉèÖÃÍøÂç½Ó¿Ú
±à¼ÍøÂçÉèÖÃÎļþ /etc/sysconfig/network-scripts/ifcfg-**interface_name**¡£
½«ÒÔÏÂÐÐÌí¼Óµ½ÎļþÖУº
GATEWAY=**gateway_address**
µÇ¼ºó¸´ÖÆ
ÆäÖÐ gateway_address ÊÇÍø¹ØµÄ IP µØµã¡£
2. ÉèÖÃĬÈÏÍø¹Ø
±à¼Îļþ /etc/resolv.conf¡£
Ìí¼ÓÒÔÏÂÐУº
search **domain** nameserver **dns_address**
µÇ¼ºó¸´ÖÆ
ÆäÖÐ domain ÊÇÓòÃû³Æ£¨¿ÉÑ¡£©£¬dns_address ÊÇ DNS ЧÀÍÆ÷µÄ IP µØµã¡£
ÉúÑIJ¢¹Ø±ÕÎļþ¡£
3. Æô¶¯ÍøÂçЧÀÍ
ÔËÐÐÒÔÏÂÏÂÁ
systemctl restart network
µÇ¼ºó¸´ÖÆ
»òÕߣ¬ÖØÐÂÆô¶¯ÏµÍ³¡£
4. ²âÊÔÍø¹Ø
ʵÑé ping Ò»¸öÍⲿ IP µØµã£¬ÀýÈç 8.8.8.8¡£
ÈôÊÇ¿ÉÒÔ ping ͨ£¬ÔòÍø¹ØÒÑÀÖ³ÉÉèÖá£
5. ÉèÖ÷À»ðǽ£¨¿ÉÑ¡£©
ÈôÊÇÆôÓÃÁË·À»ðǽ£¬ÔòÐèÒªÔÊÐíÍøÂçÁ÷Á¿Í¨¹ýÍø¹Ø¡£
ÔËÐÐÒÔÏÂÏÂÁ
firewall-cmd --add-masquerade --permanent firewall-cmd --reload
µÇ¼ºó¸´ÖÆ
ÏÖÔÚ£¬ÄúµÄ CentOS ϵͳӦ¸ÃÒÑÉèÖÃΪÍø¹Ø£¬¿ÉÒÔ½«ÍøÂçÁ÷Á¿Â·Óɵ½ÆäËû×°±¸¡£
ÒÔÉϾÍÊÇcentosÔõôÉèÖÃÍø¹ØµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡