Timetombs

泛义的工具是文明的基础,而确指的工具却是愚人的器物

66h / 117a
,更新于 2024-12-21T13:29:20Z+08:00 by   2255bb5

[Linux] CentOS

版权声明 - CC BY-NC-SA 4.0

1 Script File List

sh文件列表
# wget https://linianhui.github.io/linux/centos/network.static-ip.sh
# sudo bash centos.network.static-ip.sh 202

set -eux

IP=$1

ip a

cat /etc/sysconfig/network-scripts/ifcfg-eth0

cat <<-EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
# systemctl restart network
TYPE=Ethernet
NAME=eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.2.$IP
NETMASK=255.255.255.0
GATEWAY=192.168.2.1
PROXY_METHOD=none
BROWSER_ONLY=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
EOF

cat /etc/sysconfig/network-scripts/ifcfg-eth0


cat /etc/sysconfig/network

cat <<-EOF > /etc/sysconfig/network
# systemctl restart network
NETWORKING=yes
GATEWAY=192.168.2.1
DNS1=192.168.2.1
EOF

cat /etc/sysconfig/network

systemctl restart network

ip a
# wget https://linianhui.github.io/linux/centos/yum.163.sh
# sudo bash centos.yum.163.sh

set -eux

cat /etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

cat /etc/yum.repos.d/CentOS-Base.repo
上一篇 : [Linux] Ubuntu
下一篇 : [Linux] top