C/C++教程

5 - Configure External network connectivity for Virtual machine

本文主要是介绍5 - Configure External network connectivity for Virtual machine,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

Prerequisites:

  • CentOS7 virtual machine on Hyper-V

Now that we have a CentOS system working on Internal network, that's good. Next let's bring it access to Internet.

 

Configure Internet access for CentOS:

  1. Make sure you shutdown CentOS properly before we move onto below steps
  2. Go back to Hyper-V, now we going to create another Virtual network switch
  3. Click on Virtual switch manager
  4. From the new prompt screen, highlight New Virtual network switch -> External -> Create Virtual Switch
  5.  You will get a new configure sreen. Put name External-VM-Switch ( Whatever the name you like is fine ) for new external switch, Connection type we choose to External networks this time, then choose the network you have on your local host Windows 10, here i am using wireless WIFI, then click OK

  6. Once created the external switch, you can also find it on Network sharing center on your Windows 10 system.
    Windows Home Button -> Control Panel -> Network and sharing center -> Change adapter settings
  7. Now we've done for create external network switch, now we can apply it to CentOS, to let CentOS access to internet
  8. Highlight k8s-master on Hyper-V, right click -> Settings -> highlight Add Hardware - Select network adapter, We are going to add another network device to virtual machine, click on Add
    Note: If you got options Add Hardware, Network Adapter greyed out, that means you haven't shutdown your CentOS system it's still running !
  9. For the new introduced Network adapter, we make it apply to External-VM-Switch this time
    Believe you will notice we now have 2 Network adapter for our Vitual machine now, as below:
    Network Adapter 1 - using switch Internal-VM-Switch - It's for internal access local host remote to virtual machine
    Network Adapter 2 - using switch External-VM-Switch - it's for external access let CentOS wave to Internet
  10. Now it's time to give it a try from Vitual machine access to Internet, release the monster !
  11. Start and connect virtual machine again, try ping to www.baidu.com
  12.  Working as expected, awesome ! Now we have enabled Virtual machine CentOS access to Internet.

    Remebmer to apply the same for another vitual machine k8s-node1 from step 8 to 11

这篇关于5 - Configure External network connectivity for Virtual machine的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!