首页 > 代码库 > Network_config.sh
Network_config.sh
#!/bin/bash service iptables stop chkconfig iptables off sed -i ‘/SELINUX=enforcing/s/^/#/‘ /etc/selinux/config sed -i ‘/#SELINUX=enforcing/a SELinux=disabled‘ /etc/selinux/config cp /etc/sysconfig/network /etc/sysconfig/network.bak rm /etc/sysconfig/network cat >> /etc/sysconfig/network << "EOF" NETWORKING=yes HOSTNAME=oracle11g.local #开启NTP客户端时启用 #NTPSERVERARGS=iburst GATEWAY=192.168.1.1 EOF echo "192.168.1.128 oracle11g oracle11g.local" >> /etc/hosts cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak rm /etc/sysconfig/network-scripts/ifcfg-eth0 sed -n ‘/HWADDR=/p‘ /etc/sysconfig/network-scripts/ifcfg-eth0.bak >> /etc/sysconfig/network-scripts/ifcfg-eth0 sed -n ‘/UUID=/p‘ /etc/sysconfig/network-scripts/ifcfg-eth0.bak >> /etc/sysconfig/network-scripts/ifcfg-eth0 cat >> /etc/sysconfig/network-scripts/ifcfg-eth0 << "EOF" DEVICE=eth0 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none IPADDR=192.168.1.128 PREFIX=24 GATEWAY=192.168.1.1 DNS1=192.168.1.1 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth0" EOF sed -i ‘/Red Hat Enterprise Linux Server release 6.5 (Santiago)/s/^/#/‘ /etc/redhat-release sed -i ‘a Red Hat Enterprise Linux Server release 5.0 (Tikanga)‘ /etc/redhat-release
Network_config.sh
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。