作者归档:aigol

关于aigol

Hi boby

Cisco交换机接口出现err-disabled

IOS

1Cisco IOS Software, C3750E Software (C3750E-UNIVERSALK9-M), Version 12.2(55)SE5, RELEASE SOFTWARE (fc1)

故障现象:
故障接口插不插网线指示灯都为 桔红色,查看接口状态为

1#sh interfaces status
2Port      Name               Status       Vlan       Duplex  Speed Type
3Gi1/0/48                     err-disabled 1            auto   auto 10/100/1000BaseTX

原因查找:

01查看err-disable原因
02#show interface status err-disable
03 
04Port      Name               Status       Reason               Err-disabled Vlans
05Gi1/0/48                     err-disabled loopback
06 
07loopback,看来是环路了
08 
09#看看具体配置
10 
11#查看针对哪些功能开启了err检测
12#sh errdisable detect
13ErrDisable Reason            Detection    Mode
14-----------------            ---------    ----
15arp-inspection               Enabled      port
16bpduguard                    Enabled      port
17channel-misconfig (STP)      Enabled      port
18community-limit              Enabled      port
19dhcp-rate-limit              Enabled      port
20dtp-flap                     Enabled      port
21gbic-invalid                 Enabled      port
22inline-power                 Enabled      port
23invalid-policy               Enabled      port
24l2ptguard                    Enabled      port
25link-flap                    Enabled      port
26loopback                     Enabled      port
27lsgroup                      Enabled      port
28mac-limit                    Enabled      port
29pagp-flap                    Enabled      port
30port-mode-failure            Enabled      port
31pppoe-ia-rate-limit          Enabled      port
32psecure-violation            Enabled      port/vlan
33security-violation           Enabled      port
34sfp-config-mismatch          Enabled      port
35small-frame                  Enabled      port
36storm-control                Enabled      port
37udld                         Enabled      port
38vmps                         Enabled      port
39 
40#检测到err后是否重启接口,重启接口的间隔时间是多少
41#sh errdisable recovery
42ErrDisable Reason            Timer Status
43-----------------            --------------
44arp-inspection               Disabled
45bpduguard                    Disabled
46channel-misconfig (STP)      Disabled
47dhcp-rate-limit              Disabled
48dtp-flap                     Disabled
49gbic-invalid                 Disabled
50inline-power                 Disabled
51l2ptguard                    Disabled
52link-flap                    Disabled
53mac-limit                    Disabled
54loopback                     Disabled
55pagp-flap                    Disabled
56port-mode-failure            Disabled
57pppoe-ia-rate-limit          Disabled
58psecure-violation            Disabled
59security-violation           Disabled
60sfp-config-mismatch          Disabled
61small-frame                  Disabled
62storm-control                Disabled
63udld                         Disabled
64vmps                         Disabled
65 
66Timer interval: 300 seconds
67 
68Interfaces that will be enabled at the next timeout:

恢复接口:

1#关闭再打开接口就行了
2#interface Gi1/0/48
3#shutdown
4#no shutdown

 

 

PXE网络安装CentOS7.1

PXE网络安装CentOS 7.1,安装环境:
先安装一台桌面版CentOS(使用CentOS-7-x86_64-DVD-1503-01.iso安装),作为启动服务器,ip为192.168.72.32。

1#安装http、tftp、dhcp服务
2yum install httpd tftp-server dhcp
3 
4#安装syslinux,安装后才有文件 /usr/share/syslinux/pxelinux.0
5yum install syslinux
6 
7#安装system-config-kickstart配置启动文件,
8yum install system-config-kickstart
1#DHCP配置
2cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf

DHCP配置文件修改

01# cat /etc/dhcp/dhcpd.conf
02# dhcpd.conf
03#
04# Sample configuration file for ISC dhcpd
05#
06 
07# option definitions common to all supported networks...
08#domain-name 修改为对应名称
09option domain-name "localhost";
10option domain-name-servers 223.5.5.5, 223.6.6.6;
11 
12default-lease-time 600;
13max-lease-time 7200;
14 
15# Use this to enble / disable dynamic dns updates globally.
16#ddns-update-style none;
17 
18# If this DHCP server is the official DHCP server for the local
19# network, the authoritative directive should be uncommented.
20#authoritative;
21 
22# Use this to send dhcp log messages to a different log file (you also
23# have to hack syslog.conf to complete the redirection).
24log-facility local7;
25 
26# No service will be given on this subnet, but declaring it helps the
27# DHCP server to understand the network topology.
28 
29 
30subnet 192.168.72.0 netmask 255.255.255.0 {
31        range 192.168.72.243 192.168.72.250;
32        option routers 192.168.72.1;
33        next-server 192.168.72.32; #TFTP服务器IP
34        filename "pxelinux.0";
35 
36}

#tftp配置,disable = no

01# cat /etc/xinetd.d/tftp
02# default: off
03# description: The tftp server serves files using the trivial file transfer \
04#       protocol.  The tftp protocol is often used to boot diskless \
05#       workstations, download configuration files to network-aware printers, \
06#       and to start the installation process for some operating systems.
07service tftp
08{
09        socket_type             = dgram
10        protocol                = udp
11        wait                    = yes
12        user                    = root
13        server                  = /usr/sbin/in.tftpd
14        server_args             = -s /var/lib/tftpboot
15        disable                 = no  #修改
16        per_source              = 11
17        cps                     = 100 2
18        flags                   = IPv4
19}

httpd配置

1cd /etc/httpd/conf.d/
2#移除并备份conf文件,目的不显示测试页面
3mv autoindex.conf autoindex.conf.bak
4mv userdir.conf userdir.conf.bak
5mv welcome.conf welcome.conf.bak
6 
7#http目录文件准备
8mkdir /var/www/html/centos
9mount ~/CentOS-7-x86_64-DVD-1503-01.iso /var/www/html/centos

/var/www/html/ks.cfg 文件配置

01# cat /var/www/html/ks.cfg
02#platform=x86, AMD64, or Intel EM64T
03#version=DEVEL
04# Install OS instead of upgrade
05install
06# Keyboard layouts
07keyboard 'us'# Reboot after installation
08reboot
09# Root password
10rootpw --iscrypted $1$BhbE2ZLC$D/XPM6Jscst055R3X0nLp.
11# System timezone
12timezone Asia/Shanghai --isUtc
13# Use network installation
14url --url="http://192.168.72.32/centos"  #最后面不需要加 /
15# System language
16lang en_US
17# Firewall configuration
18firewall --disabled
19# Network information
20network  --bootproto=dhcp --device=ens0 --onboot=yes --noipv6 --hostname=pxe_one
21# System authorization information
22auth  --useshadow  --passalgo=sha512
23# Use graphical install
24graphical
25firstboot --disable
26# SELinux configuration
27selinux --disabled
28 
29# System bootloader configuration
30# 新硬盘需要创建mbr
31bootloader --location=mbr
32# Clear the Master Boot Record
33zerombr
34# Partition clearing information
35clearpart --all --initlabel
36# Disk partitioning information
37part / --asprimary --fstype="xfs" --size=20480
38part /boot --asprimary --fstype="xfs" --size=512
39part swap --asprimary --fstype="swap" --size=2048
40part /data --asprimary --fstype="xfs" --grow --size=1
41 
42%packages
43@core
44#@chinese-support
45#iptraf
46#vim
47#openssh-server
48#ntp
49#wget
50 
51%end

http根目录结构

01# tree -aL 2 /var/www/html/
02/var/www/html/
03├── centos
04│   ├── CentOS_BuildTag
05│   ├── .discinfo
06│   ├── EFI
07│   ├── EULA
08│   ├── GPL
09│   ├── images
10│   ├── isolinux
11│   ├── LiveOS
12│   ├── Packages
13│   ├── repodata
14│   ├── RPM-GPG-KEY-CentOS-7
15│   ├── RPM-GPG-KEY-CentOS-Testing-7
16│   ├── TRANS.TBL
17│   └── .treeinfo
18└── ks.cfg
19 
207 directories, 9 files

tftp目录文件准备

01#tftp目录文件准备
02cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
03mkdir /var/lib/tftpboot/pxelinux.cfg
04cp /var/www/html/centos/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
05cp /var/www/html/centos/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/
06cp /var/www/html/centos/isolinux/{vesamenu.c32,boot.msg,splash.png} /var/lib/tftpboot/
07 
08# tree /var/lib/tftpboot/
09/var/lib/tftpboot/
10├── boot.msg
11├── initrd.img
12├── pxelinux.0
13├── pxelinux.cfg
14│   └── default
15├── splash.png
16├── vesamenu.c32
17└── vmlinuz
18 
191 directory, 7 files

/var/lib/tftpboot/pxelinux.cfg/default 文件

001# cat /var/lib/tftpboot/pxelinux.cfg/default
002default vesamenu.c32
003timeout 60
004 
005display boot.msg
006 
007# Clear the screen when exiting the menu, instead of leaving the menu displayed.
008# For vesamenu, this means the graphical background is still displayed without
009# the menu itself for as long as the screen remains in graphics mode.
010menu clear
011menu background splash.png
012menu title CentOS 7
013menu vshift 8
014menu rows 18
015menu margin 8
016#menu hidden
017menu helpmsgrow 15
018menu tabmsgrow 13
019 
020# Border Area
021menu color border * #00000000 #00000000 none
022 
023# Selected item
024menu color sel 0 #ffffffff #00000000 none
025 
026# Title bar
027menu color title 0 #ff7ba3d0 #00000000 none
028 
029# Press [Tab] message
030menu color tabmsg 0 #ff3a6496 #00000000 none
031 
032# Unselected menu item
033menu color unsel 0 #84b8ffff #00000000 none
034 
035# Selected hotkey
036menu color hotsel 0 #84b8ffff #00000000 none
037 
038# Unselected hotkey
039menu color hotkey 0 #ffffffff #00000000 none
040 
041# Help text
042menu color help 0 #ffffffff #00000000 none
043 
044# A scrollbar of some type? Not sure.
045menu color scrollbar 0 #ffffffff #ff355594 none
046 
047# Timeout msg
048menu color timeout 0 #ffffffff #00000000 none
049menu color timeout_msg 0 #ffffffff #00000000 none
050 
051# Command prompt text
052menu color cmdmark 0 #84b8ffff #00000000 none
053menu color cmdline 0 #ffffffff #00000000 none
054 
055# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
056 
057menu tabmsg Press Tab for full configuration options on menu items.
058 
059menu separator # insert an empty line
060menu separator # insert an empty line
061 
062label linux
063  menu label ^Install CentOS 7
064  menu default
065  kernel vmlinuz
066# append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet
067  append initrd=initrd.img inst.ks=http://192.168.72.32/ks.cfg quiet
068 
069label check
070  menu label Test this ^media & install CentOS 7
071  kernel vmlinuz
072  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet
073 
074menu separator # insert an empty line
075 
076# utilities submenu
077menu begin ^Troubleshooting
078  menu title Troubleshooting
079 
080label vesa
081  menu indent count 5
082  menu label Install CentOS 7 in ^basic graphics mode
083  text help
084        Try this option out if you're having trouble installing
085        CentOS 7.
086  endtext
087  kernel vmlinuz
088  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet
089 
090label rescue
091  menu indent count 5
092  menu label ^Rescue a CentOS system
093  text help
094        If the system will not boot, this lets you access files
095        and edit config files to try to get it booting again.
096  endtext
097  kernel vmlinuz
098  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet
099 
100label memtest
101  menu label Run a ^memory test
102  text help
103        If your system is having issues, a problem with your
104        system's memory may be the cause. Use this utility to
105        see if the memory is working correctly.
106  endtext
107  kernel memtest
108 
109menu separator # insert an empty line
110 
111label local
112  menu label Boot from ^local drive
113  localboot 0xffff
114 
115menu separator # insert an empty line
116menu separator # insert an empty line
117 
118label returntomain
119  menu label Return to ^main menu
120  menu exit
121 
122menu end

启动服务器

01#启动服务器
02iptables -F
03systemctl start httpd.service
04systemctl status httpd.service
05systemctl enable httpd.service
06 
07systemctl start dhcpd.service
08systemctl status dhcpd.service
09systemctl enable dhcpd.service
10 
11systemctl start xinetd.service
12systemctl status xinetd.service
13systemctl enable xinetd.service
14 
15systemctl start tftp.socket
16systemctl status tftp.socket
17systemctl enable tftp.socket
18 
19systemctl start tftp.service
20systemctl status tftp.service
21systemctl enable tftp.service

查看服务端口是否正常

1#查看服务端口是否正常 tcp-80、udp-67、udp-69
2ss -tilnp
3ss -uilnp
4#或
5netstat -nat
6netstat -nau
7 
8#查看dhcp地址分配情况
9/var/lib/dhcpd/dhcpd.leases

继续阅读

参加Gopher China 2015

补充相关PPT及视频(20150906):

PPT:
http://download.csdn.net/album/detail/1623

链接:http://pan.baidu.com/s/1gd8kKQR 密码:vykm

雨痕  Go 学习笔记 第四版.pdf
https://github.com/qyuhen/book

视频:
http://www.imooc.com/learn/407

astaxie

分享内容:


继续阅读

SquidTL安装–待续

安装系统:CentOS 7.1

1wget http://www.zerozone.it/Software/Linux/SquidTL/squidtl-0.0.2.tar.gz
2 
3tar -vxzf squidtl-0.0.2.tar.gz
4 
5cd squidtl/

1yum install automake
2cp -rf /usr/share/automake-1.13 /usr/share/automake-1.10

01# ./configure
02checking for a BSD-compatible install... /usr/bin/install -c
03checking whether build environment is sane... yes
04checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
05checking for gawk... gawk
06checking whether make sets $(MAKE)... yes
07checking for gcc... gcc
08checking for C compiler default output file name... a.out
09checking whether the C compiler works... yes
10checking whether we are cross compiling... no
11checking for suffix of executables...
12checking for suffix of object files... o
13checking whether we are using the GNU C compiler... yes
14checking whether gcc accepts -g... yes
15checking for gcc option to accept ISO C89... none needed
16checking for style of include used by make... GNU
17checking dependency style of gcc... gcc3
18checking how to run the C preprocessor... gcc -E
19checking for grep that handles long lines and -e... /usr/bin/grep
20checking for egrep... /usr/bin/grep -E
21checking for ANSI C header files... yes
22checking for mysql_config... no
23configure: error: Couldn't find mysql_config. Please verify that it is installed.

configure: error: Couldn’t find mysql_config. Please verify that it is installed.

01# yum provides */mysql_config
02Loaded plugins: fastestmirror, langpacks
03Loading mirror speeds from cached hostfile
04 * base: mirrors.aliyun.com
05 * epel: epel.mirror.srv.co.ge
06 * extras: mirrors.aliyun.com
07 * updates: mirrors.aliyun.com
08epel/x86_64/filelists_db                                                                                                                              | 6.3 MB  00:00:06    
091:mariadb-devel-5.5.41-2.el7_0.i686 : Files for development of MariaDB/MySQL applications
10Repo        : base
11Matched from:
12Filename    : /usr/lib/mysql/mysql_config
13Filename    : /usr/bin/mysql_config
14 
15 
16 
171:mariadb-devel-5.5.41-2.el7_0.x86_64 : Files for development of MariaDB/MySQL applications
18Repo        : base
19Matched from:
20Filename    : /usr/bin/mysql_config
21Filename    : /usr/lib64/mysql/mysql_config
1yum install mariadb-devel

 

01./configure
02checking for a BSD-compatible install... /usr/bin/install -c
03checking whether build environment is sane... yes
04checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
05checking for gawk... gawk
06checking whether make sets $(MAKE)... yes
07checking for gcc... gcc
08checking for C compiler default output file name... a.out
09checking whether the C compiler works... yes
10checking whether we are cross compiling... no
11checking for suffix of executables...
12checking for suffix of object files... o
13checking whether we are using the GNU C compiler... yes
14checking whether gcc accepts -g... yes
15checking for gcc option to accept ISO C89... none needed
16checking for style of include used by make... GNU
17checking dependency style of gcc... gcc3
18checking how to run the C preprocessor... gcc -E
19checking for grep that handles long lines and -e... /usr/bin/grep
20checking for egrep... /usr/bin/grep -E
21checking for ANSI C header files... yes
22checking for mysql_config... /usr/bin/mysql_config
23checking for pkg-config... /usr/bin/pkg-config
24checking pkg-config is at least version 0.9.0... yes
25checking for XML... no
26configure: error: libxml2 is required.

configure: error: libxml2 is required.

1yum install libxml2-devel
01# ./configure       
02checking for a BSD-compatible install... /usr/bin/install -c
03checking whether build environment is sane... yes
04checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
05checking for gawk... gawk
06checking whether make sets $(MAKE)... yes
07checking for gcc... gcc
08checking for C compiler default output file name... a.out
09checking whether the C compiler works... yes
10checking whether we are cross compiling... no
11checking for suffix of executables...
12checking for suffix of object files... o
13checking whether we are using the GNU C compiler... yes
14checking whether gcc accepts -g... yes
15checking for gcc option to accept ISO C89... none needed
16checking for style of include used by make... GNU
17checking dependency style of gcc... gcc3
18checking how to run the C preprocessor... gcc -E
19checking for grep that handles long lines and -e... /usr/bin/grep
20checking for egrep... /usr/bin/grep -E
21checking for ANSI C header files... yes
22checking for mysql_config... /usr/bin/mysql_config
23checking for pkg-config... /usr/bin/pkg-config
24checking pkg-config is at least version 0.9.0... yes
25checking for XML... yes
26checking for strdup... yes
27checking for strerror... yes
28checking for vsprintf... yes
29checking for sigaction... yes
30checking for signal... yes
31configure: creating ./config.status
32config.status: creating Makefile
33config.status: creating src/Makefile
34config.status: creating src/config.h
35config.status: executing depfiles commands

 

Exchange网页登陆卡在owa/auth.owa

现象:
网页登陆Exchange邮箱,登陆页正常,输入用户、密码后,页面报错。

错误信息如下:

1网址为 https://mail.uname.com/owa/auth.owa 的网页可能暂时无法连接,或者它已永久性地移动到了新网址。
2 
3错误代码:ERR_RESPONSE_HEADERS_TRUNCATED

解决方法:
服务中–开启 “基于 Microsoft Exchange 表单的身份验证服务”.

基于 Microsoft Exchange 表单的身份验证服务

参考:
http://www.it0124.com/Home/ArticleDetail/231be72f-9002-4e0f-a00a-9aee4ea063c9

CentOS7网卡桥接

系统版本:CentOS 7.1 x64

1# cat /etc/redhat-release
2CentOS Linux release 7.1.1503 (Core)
3# uname -a
4Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

 桥接前配置:

01# cat /etc/sysconfig/network-scripts/ifcfg-enp2s4
02BOOTPROTO=dhcp
03DEFROUTE=yes
04PEERDNS=yes
05PEERROUTES=yes
06IPV4_FAILURE_FATAL=no
07IPV6INIT=yes
08IPV6_AUTOCONF=yes
09IPV6_DEFROUTE=yes
10IPV6_PEERDNS=yes
11IPV6_PEERROUTES=yes
12IPV6_FAILURE_FATAL=no
13IPV6_FAILURE_FATAL=no
14TYPE=Ethernet
15NAME=enp2s4
16UUID=65b1d8b3-2214-45ec-987f-d0f1cc0004cb
17DEVICE=enp2s4
18ONBOOT=yes
19 
20# cat /etc/sysconfig/network-scripts/ifcfg-enp3s5
21BOOTPROTO=dhcp
22DEFROUTE=yes
23PEERDNS=yes
24PEERROUTES=yes
25IPV4_FAILURE_FATAL=no
26IPV6INIT=yes
27IPV6_AUTOCONF=yes
28IPV6_DEFROUTE=yes
29IPV6_PEERDNS=yes
30IPV6_PEERROUTES=yes
31IPV6_FAILURE_FATAL=no
32IPV6_FAILURE_FATAL=no
33TYPE=Ethernet
34NAME=enp3s5
35UUID=65b1d8b3-2214-45ec-987f-d0f1cc0004cb
36DEVICE=enp3s5
37ONBOOT=yes

通过配置文件配置桥接:

01# cd /etc/sysconfig/network-scripts
02 
03# cat ifcfg-br0      #桥接口名称为br0
04TYPE=Bridge
05BOOTPROTO=static
06IPADDR=192.168.1.82
07PREFIX=24
08IPV4_FAILURE_FATAL=no
09NAME=br0
10DEVICE=br0
11ONBOOT=yes
12BRIDGE_STP=yes
13 
14# cat ifcfg-enp2s4
15TYPE=Ethernet
16NAME=enp2s4
17UUID=30a9efb8-2594-4596-9cde-d87c1ac06003
18#HWADDR=00:1c:c4:df:db:e4
19DEVICE=enp2s4
20ONBOOT=yes
21BRIDGE=br0
22 
23# cat ifcfg-enp3s5
24TYPE=Ethernet
25NAME=enp3s5
26#HWADDR=00:1c:c4:df:db:e6
27UUID=65b1d8b3-2214-45ec-987f-d0f1cc0004cb
28DEVICE=enp3s5
29ONBOOT=yes
30BRIDGE=br0
31 
32# systemctl status network.service  #重启网络服务
33 
34#查看是否失效
35# ifconfig
36br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
37        inet 192.168.1.82  netmask 255.255.255.0  broadcast 192.168.71.255
38        inet6 fe80::21c:c4ff:fedf:dbe4  prefixlen 64  scopeid 0x20<link>
39        ether 00:1c:c4:df:db:e4  txqueuelen 0  (Ethernet)
40        RX packets 1438  bytes 182390 (178.1 KiB)
41        RX errors 0  dropped 0  overruns 0  frame 0
42        TX packets 8  bytes 592 (592.0 B)
43        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
44 
45enp2s4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
46        ether 00:1c:c4:df:db:e4  txqueuelen 1000  (Ethernet)
47        RX packets 669318  bytes 968188165 (923.3 MiB)
48        RX errors 0  dropped 0  overruns 0  frame 0
49        TX packets 87613  bytes 7615798 (7.2 MiB)
50        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
51 
52enp3s5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
53        ether 00:1c:c4:df:db:e6  txqueuelen 1000  (Ethernet)
54        RX packets 87597  bytes 7613914 (7.2 MiB)
55        RX errors 0  dropped 0  overruns 0  frame 0
56        TX packets 666707  bytes 967793844 (922.9 MiB)
57        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
58 
59# brctl show
60bridge name     bridge id               STP enabled     interfaces
61br0             8000.001cc4dfdbe4       no              enp2s4
62                                                        enp3s5

 通过brctl配置桥接:

01#安装brctl
02yum install bridge-utils
03 
04# ifconfig enp2s4 down
05# ifconfig enp3s5 down
06# ifconfig enp2s4 0.0.0.0
07# ifconfig enp3s5 0.0.0.0
08 
09# brctl addbr br0
10# brctl addif br0 enp2s4
11# brctl addif br0 enp3s5
12 
13# ifconfig br0 192.168.1.82 up
14 
15# brctl stp br0 off  #关闭生成树协议
16# brctl show
17 
18#brctl 命令配置重启后失效,可以把相关命令添加到/etc/rc.d/rc.local 即可。

 

参考:

CentOS 6桥接网卡配置

CentOS mini版安装后基本设置

使用CentOS mini版,安装后一般做一些基本设置才能更好的使用。

版本:
http://mirrors.aliyun.com/centos/7.1.1503/isos/x86_64/CentOS-7-x86_64-Minimal-1503-01.iso

01# cat /etc/redhat-release
02CentOS Linux release 7.1.1503 (Core)
03 
04# uname -a
05Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
06 
07 
08/etc/sysconfig/network-scripts/ifcfg-enp5s0  #开机启动网卡
09ONBOOT=yes
10 
11systemctl restart network.service      #重启网络服务
12#或
13/etc/rc.d/init.d/network restart
14 
15 
16 
17 
18yum -y install wget    #安装wget
19 
20#更换阿里云yum源
21mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
22 
23wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
24 
25#第三方源
26yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
27#或
28yum install http://mirrors.ustc.edu.cn/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
29 
30#生成缓存
31yum makecache
32 
33#安装常用软件、工具
34yum -y install vim htop
35 
36#add command ifconfig
37yum -y net-tools
38 
39#add command nslookup、dig
40yum -y install bind-utils
41 
42#设置vim 别名
43vi .bashrc 
44alias vi='vim'