CentOS6.5网络设置及设置同步时间

来源:互联网 发布:sql 参数 编辑:程序博客网 时间:2024/06/04 19:55
ifconfig eth0 192.168.136.128 #先设置一个临时ip 方便远程

通过Ctrl+Alt+F2进入命令行界面
登陆账号后输入以下代码

vi  /etc/sysconfig/network-scripts/ifcfg-eth0 #编辑配置文件,添加修改以下内容ONBOOT=yes  #开启自动启用网络连接BOOTPROTO=static   #启用静态IP地址IPADDR=192.168.136.128  #设置IP地址NETMASK=255.255.255.0  #设置子网掩码GATEWAY=192.168.136.2   #设置网关DNS1=192.168.136.2 #设置主DNSIPV6INIT=no  #禁止IPV6

按Esc后输入 :wq #保存退出,接着输入以下命令

service ip6tables stop   #停止IPV6服务chkconfig ip6tables off  #禁止IPV6开机启动service yum-updatesd stop   #关闭系统自动更新,该命令可能不存在chkconfig yum-updatesd off  #禁止开启启动,该命令可能不存在service network restart  #重启网络连接ifconfig  #查看IP地址#route add default gw 192.168.136.2  dev eth0 #设置默认网关yum install -y ntp #安装ntpservice ntpd start #启动ntpd服务chkconfig ntpd on #设置ntpd为开机启动
0 0
原创粉丝点击