1. 程式人生 > >linux網路ip配置

linux網路ip配置

NAT:把物理機為路由器進行上網 橋接:通過使用物理機網絡卡 具有單獨ip

配置網路:/etc/sysconfig/network-scripts/(一般為第一個)ifcfg-eth0 ONBOOT(是否隨機器啟動網絡卡服務)=yes NM—CONTROLLED(是否交由networkmanager服務管理【yes or no】)=yes BOOTPROTO(有什麼協議分配ip地址【預設dhcp】) =static IPADDR:ip地址 NETMASK:子網掩碼(255.255.255.0) GATEWAY:閘道器(172.17.25.254) DNS1:(8.8.8.8 OR 114.114.114.114)

centos6 service(centos6.0管理所有服務) :start | stop | restart network (網路服務) iptables (防火牆) service iptables stop(暫時停止防火牆) chkconfig iptables off (永久停用防火牆) vim /etc/selinux/config(另一個linux的防火牆SELINUX=disabled) setenforce 0(零時失效)

centos7 systemctl start|stop|restart 服務名稱 systemctl stop firewalld(停用防火牆)(正確無提示資訊) systemctl disable firewalld(永久停用防火牆)