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(永久停用防火墙)

你可能感兴趣的:(linux网络ip配置)