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

    xiaoxiao2021-04-19  87

    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 #设置主DNS IPV6INIT=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 #安装ntp service ntpd start #启动ntpd服务 chkconfig ntpd on #设置ntpd为开机启动
    转载请注明原文地址: https://ju.6miu.com/read-675706.html

    最新回复(0)