Skip to content

Commit 3380383

Browse files
committed
centos ip script
1 parent e35697c commit 3380383

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scripts/centosip.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
ip=$1
4+
hostname=$2
5+
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
6+
DEVICE=eth0
7+
BOOTPROTO=static
8+
ONBOOT=yes
9+
TYPE=Ethernet
10+
HOSTNAME=$hostname
11+
IPADDR=$ip
12+
PREFIX=24
13+
GATEWAY=172.20.10.1
14+
DNS1=9.9.9.9
15+
DNS2=1.1.1.1
16+
EOF
17+

0 commit comments

Comments
 (0)