[] Centos6 linux-talk and a method centos7 fixed IP

As we all know, a large set of server applications communicate with each other within the network are deployed using a fixed IP. Ali cloud server on the cloud, cloud application Tencent is also fixed IP, which means cloud platform inside allocation strategy is certainly also a fixed IP (if not to take fixed directly in the system the way). But taken within the general system default IP acquisition mode is DHCP, automatically obtain IP. No matter which of the above circumstances, we all need to be adjusted. Here we introduce two types of system fixed ip methods, and common problems you may encounter.

Recently, I have in batch experiments ansible cluster management, and built locally by VMware a small network (use VMnet8 NAT mode set up virtual network), its topology is probably as follows:

In other words, it needs a fixed IP on centOS7 and centOS6. Here briefly summarize the steps I experienced.

First, the fixed IP centOS7

Execute ifconfig see card name ens33

In the / etc / sysconfig / network-scripts / folder to see if there ifcfg-ens33 file.

If not, please refer to - how to turn off NetworkManager starts the network services and related network services solution.

Ifcfg-ens33 into the file (after cd to the directory is executed vim ifcfg-ens33), modified as shown in FIG.

 

Thereafter, the init 6 reboot, restart or manually, after then ping each other by a double machine, no problem in identifying the network settings.

 Two, centOS6 IP address is fixed

Look at / etc / sysconfig / network-scripts / name to see whether there is a card in ifconfig. I do not see myself in the installed system, so I sorted out solutions within the environment.

Within his or her environment, NetworkManager is due to take over the network environment, resulting network does not work.

https://www.cnblogs.com/hardykay/p/10214834.html

You can refer to the above blog.

但是,自己创建ifcfg-eth0文件,很容易写错(或者是不容易写全)。我特意又去网上看了一下如何进行centos6下的IP地址固定,看看还有没有什么新方法。果不其然,我找到了。

http://ju.outofmemory.cn/entry/303390

具体可参考这篇博客。

最终,我选用了setup的方法。请务必在进行setup设置之前,如果有自己创建的ifcfg-eth0文件,将其删除。setup可以帮我们更加规范化的配置。

setup的设置界面如图:

记住,如果底下有controlled by networkmanager,将其取消。这玩意儿red-hat团队自个儿开发的,感觉不好使。最后保存。

这个时候。运行命令ifconfig,你应该可以看到你所需要配置成的网络配置了。

 

希望能够对看到本文的你有帮助,有问题欢迎留言。

Guess you like

Origin www.cnblogs.com/sbhyc/p/11232256.html
Recommended