35.1 centos7.4-模板机-10.0.0.201


centos7.4-模板机-10.0.0.201
D:\vmware_centos\centos7.4-模板机-10.0.0.201

  

[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[root@centos7 ~]# uname -rm
3.10.0-693.el7.x86_64 x86_64
[root@centos7 ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.201 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::be4a:5ed:b580:ea27 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c0:aa:ff txqueuelen 1000 (Ethernet)
RX packets 145 bytes 14559 (14.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 122 bytes 17273 (16.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.1.201 netmask 255.255.255.0 broadcast 172.16.1.255
inet6 fe80::820d:9902:8546:4c96 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c0:aa:09 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 13 bytes 954 (954.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@centos7 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:c0:aa:ff brd ff:ff:ff:ff:ff:ff
inet 10.0.0.201/24 brd 10.0.0.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::be4a:5ed:b580:ea27/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:c0:aa:09 brd ff:ff:ff:ff:ff:ff
inet 172.16.1.201/24 brd 172.16.1.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::820d:9902:8546:4c96/64 scope link
valid_lft forever preferred_lft forever

[root@centos7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=3e2d4e5c-eaaa-4bec-8f41-a68d1d930b21
DEVICE=eth0
ONBOOT=yes
IPV6_PRIVACY=no
IPADDR=10.0.0.201
PREFIX=24
GATEWAY=10.0.0.254
DNS1=223.5.5.5
[root@centos7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth1
UUID=76751da0-c8cf-4eaa-bcd7-97ad436500fa
DEVICE=eth1
ONBOOT=yes
IPADDR=172.16.1.201
PREFIX=24
IPV6_PRIVACY=no

[root@centos7 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search 4-node
nameserver 10.0.0.254 #这样写是让网关自己找dns 它肯定能找到一个好使的。
[root@centos7 ~]# ping www.baidu.com
PING www.a.shifen.com (183.232.231.173) 56(84) bytes of data.
64 bytes from 183.232.231.173 (183.232.231.173): icmp_seq=1 ttl=128 time=41.9 ms
64 bytes from 183.232.231.173 (183.232.231.173): icmp_seq=2 ttl=128 time=41.4 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 41.422/41.663/41.904/0.241 ms


[root@centos7 ~]# yum -y install vim lrzsz bash-completion telnet nmap
[root@centos7 ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@centos7 ~]# setenforce 0
[root@centos7 ~]# getenforce
Permissive

[root@centos7 ~]# systemctl stop firewalld.service
[root@centos7 ~]# systemctl disable firewalld.service
[root@centos7 ~]# rpm -qa net-tools iproute
iproute-3.10.0-87.el7.x86_64
net-tools-2.0-0.22.20131004git.el7.x86_64

[root@centos7 ~]# ls /etc/udev/rules.d/
[root@centos7 ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth0{,.bak}
[root@centos7 ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth1{,.bak}
[root@centos7 ~]# ls /etc/sysconfig/network-scripts/ifcfg-eth*
/etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
/etc/sysconfig/network-scripts/ifcfg-eth0.bak /etc/sysconfig/network-scripts/ifcfg-eth1.bak
[root@centos7 ~]# sed -rn '/UUID|HWADDR/p' /etc/sysconfig/network-scripts/ifcfg-eth*
UUID=3e2d4e5c-eaaa-4bec-8f41-a68d1d930b21
UUID=3e2d4e5c-eaaa-4bec-8f41-a68d1d930b21
UUID=76751da0-c8cf-4eaa-bcd7-97ad436500fa
UUID=76751da0-c8cf-4eaa-bcd7-97ad436500fa
[root@centos7 ~]# sed -ri '/UUID|HWADDR/d' /etc/sysconfig/network-scripts/ifcfg-eth0
[root@centos7 ~]# sed -ri '/UUID|HWADDR/d' /etc/sysconfig/network-scripts/ifcfg-eth1
[root@centos7 ~]# sed -rn '/UUID|HWADDR/p' /etc/sysconfig/network-scripts/ifcfg-eth0
[root@centos7 ~]# sed -rn '/UUID|HWADDR/p' /etc/sysconfig/network-scripts/ifcfg-eth1
[root@centos7 ~]# halt //以后当模板,不能乱动!

posted @ 2018-03-28 11:55  bkycrmn  阅读(170)  评论(0)    收藏  举报