当前位置: 主页 > CentOS入门 > 系统配置 >

centos复制克隆改网卡

时间:2016-02-18 01:14来源:blog.51cto.com 作者:“PD” 博客 举报 点击:

1.备份 etc/udev/rules.d/70-persistent-net.rules

[root@SRD999 /]# cd etc/udev/rules.d/

[root@SRD999 rules.d]# ls

60-fprint-autosuspend.rules  70-persistent-net.rules    98-kexec.rules

60-pcmcia.rules              90-alsa.rules              99-fuse.rules

60-raw.rules                 90-hal.rules

70-persistent-cd.rules       97-bluetooth-serial.rules

[root@SRD999 rules.d]# cp 70-persistent-net.rules 70-persistent-net.rules.bak

2.修改配置文件

[root@SRD999 rules.d]# vi 70-persistent-net.rules

删掉eth0那行

将eth1改成eth0

修改前

wKiom1bD52HwfH1QAAGigTcNB-Q497.jpg

修改后   

删掉eth0那行

将eth1改成eth0

 

wKiom1bD5ruiJYzzAAFtE0JGEoI954.jpg

修改 etc/sysconfig/network-scripts/ifcfg-eth0 将HWADDR改成上面那个信息,就是MAC地址,并配置IP地址等信息

[root@SRD999 /]# vi etc/sysconfig/network-scripts/ifcfg-eth0

更改前

wKiom1bD5ryQFll5AACX9Z0neEk059.jpg

更改后

wKiom1bD5r2DE2CQAADUH2kTjO4284.jpg

重启网卡

[root@SRD999 /]# service network restart

Shutting down loopback interface:                          [  OK  ]

Bringing up loopback interface:                            [  OK  ]

Bringing up interface eth0:  Active connection state: activated

Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1

                                                           [  OK  ]

[root@SRD999 /]# 

 

安装telnet

[root@SRD999 /]# yum -y install telnet*

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

 * base: mirrors.opencas.cn

 * extras: mirrors.zju.edu.cn

 * updates: mirrors.zju.edu.cn

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package telnet.x86_64 1:0.17-48.el6 will be installed

---> Package telnet-server.x86_64 1:0.17-48.el6 will be installed

--> Processing Dependency: xinetd for package: 1:telnet-server-0.17-48.el6.x86_64

--> Running transaction check

...............................................................

 

[root@SRD999 /]# cd etc/xinetd.d

[root@SRD999 xinetd.d]# ls

chargen-dgram   daytime-stream  echo-dgram   tcpmux-server  time-stream

chargen-stream  discard-dgram   echo-stream  telnet

daytime-dgram   discard-stream  rsync        time-dgram

[root@SRD999 xinetd.d]# cp telnet telnet.bak   备份

[root@SRD999 xinetd.d]# vi telnet

[root@SRD999 xinetd.d]# 

将disable改成no 

修改前

wKioL1bD64fA1q05AAEdU7KjSwM908.jpg

修改后

wKioL1bD67SShTWxAAEfnnvOuR0343.jpg

重启服务

[root@SRD999 /]# service xinetd restart

Stopping xinetd:                                           [FAILED]

Starting xinetd:                                           [  OK  ]

[root@SRD999 /]# service xinetd restart

Stopping xinetd:                                           [  OK  ]

Starting xinetd:                                           [  OK  ]

[root@SRD999 /]# 

开放防火墙后就可以通过telnet登录系统了

------分隔线----------------------------
发表评论
为了和诣的生活,我关闭了评论页面,请大家到QQ群里交流吧:348944156,也欢迎关注本站微信公众号:centoscn