发布时间:2017-02-08 15:30:29编辑:丝画阁阅读(1119)
修改IP地址
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 物理设备名
HWADDR=D8:CB:8A:13:4C:59 MAC地址,通过ifconfig获得DNS2=114.114.114.114
修改网关地址
vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=yimeikang
GETEWAY=192.168.0.1
修改DNS
vim /etc/resolv.conf
nameserver 192.168.1.1
nameserver 114.114.114.114
2.4:重启网卡
# service network restart
25
/etc/rc.d/rc.local最后加上 ifup eth0 /et/rc.d/rc.local脚本是在所有其他初始化脚本执行完毕后执行.
防火墙开放端口
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
关键字:
本站部分内容来源网络及网友上传,本站未必能一一鉴别其是否为公共版权或其版权归属,如果您认为侵犯您的权利,本站将表示非常抱歉!
请您速联系本站,本站一经核实,立即删除。删文删帖联系【2789291421@qq.com】