修改DNS
#修改对应网卡的DNS的配置文件
vi /etc/resolv.conf
#添加域名服务器
nameserver 223.5.5.5 #阿里的DNS
nameserver 223.6.6.6
nameserver 8.8.8.8 #google的DNS
nameserver 8.8.4.4
#如果resolv.conf文件Generated by NetworkManager
#在/etc/sysconfig/network-scripts/ifcfg-eth0添加DNS1、DNS2
设置网卡ip地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
文件说明
DEVICE=eth0 #网卡对应的设备别名
HWADDR=00:50:56:B6:C1:3A #网卡Mac地址
ONBOOT=yes #系统启动时是否激活此设备
BOOTPROTO=dhcp #网卡获得ip地址的方式
#dhcp 通过dhcp协议自动获取ip
#static 手动设置IP地址
修改配置
BOOTPROTO static
IPADDR="192.168.0.192"
NETMASK="255.255.255.0"
GATEWAY="192.168.0.1"
DNS1=233.5.5.5
DNS2=8.8.8.8
防火墙设置
vi /etc/sysconfig/iptables
#添加80端口访问权限
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
#添加ssh端口访问权限
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
service iptables restart #重启防火墙
重启网络
service network restart