-->
Showing posts with label Network. Show all posts
Showing posts with label Network. Show all posts

Saturday, February 16, 2019

VMware Workstation Pro 15] 10. Creating a virtual machine that acts as a router (vRouter)

Hello, guys. You will figure out how to create a virtual machine(VM) that acts as a router (vRouter) in this post. When you finish this practice, you will be able to easily create a virtual router in a virtualized environment.

Creating a virtual machine that acts as a router

Unfortunately, VMware Workstation Pro does not support virtual router functionality. So if you want to make a connection between different networks, you have to create a VM to use as a router. Set up the virtual network as shown below.



If you don't know how to create a virtual network, please refer to the post below.

https://sunguruitchannel01.blogspot.com/2019/02/vmware-workstation-pro-15-9-configuring.html

Create a new VM with the following spec:

Virtual machine name: Router01
Hardware compatibility: Workstation 10.x
Guest operating system: Linux/CentOS 7 64-bit
Processors: 1 Socket/1 Cores
Memory: 420 MB
Network connection 1: VMnet0
Network connection 2: VMnet1
Network connection 3: VMnet4
Network connection 4: VMnet5
I/O controller types: LSI Logic
Virtual disk type : SCSI
Disk: 10 GB
Display: Uncheck Accelerate 3D graphics

When you install CentOS 7.6, set the SOFTWARE SELECTION to Minimal Install as shown below.


If you don't know how to install CentOS 7.6, please refer to the post below.

https://sunguruitchannel01.blogspot.com/2019/02/vmware-workstation-pro-15-8-installing.html

Configuring CentOS 7.6

The network connectivity diagram is shown below.


To make CentOS 7.6 work as a router, run the following commands:

[root@router01 ~]# sed -i '/^SELINUX\>/s/enforcing/permissive/' /etc/selinux/config
[root@router01 ~]# sed -n '/^SELINUX\>/p' /etc/selinux/config
[root@router01 ~]# setenforce permissive
[root@router01 ~]# getenforce
[root@router01 ~]# sysctl net.ipv4.ip_forward
[root@router01 ~]# sysctl -w net.ipv4.ip_forward=1
[root@router01 ~]# sed -i '$ a\net.ipv4.ip_forward = 1' /etc/sysctl.conf
[root@router01 ~]# systemctl disable sshd
[root@router01 ~]# systemctl stop sshd
[root@router01 ~]# systemctl stop firewalld
[root@router01 ~]# systemctl disable firewalld
[root@router01 ~]# nmtui

Run the nmtui command to assign the static IP addresses to the network adapters.




To apply the changed IP addresses, use Activate a connection as shown below. Press the Enter key twice to apply. :D


Now set up static routes on your IP Router. My thing is set as below.



Testing Router Operating

Let's see if the virtual machine works well as a router. Run the following commands to install Apache HTTPD on your CentOS76 VM.

[root@centos76 ~]# yum -y install httpd
[root@centos76 ~]# firewall-cmd --permanent --add-service=http
[root@centos76 ~]# systemctl enable httpd
[root@centos76 ~]# systemctl start httpd
[root@centos76 ~]# ip addr show dev ens32 | grep 'inet\>'

    inet 192.168.5.10/24 brd 192.168.5.255 scope global noprefixroute ens32

Connect the CentOS76 VM to VMnet5.


From your host operating system, open a web browser to access the web server. Then enter the IP address of CentOS76 VM. If it appears as shown in the figure below, it is a success.


You have acquired the skill to create a VM that acts as a router. I encourage you to practice a few more times to become proficient. It will be very useful in the long journey ahead. In the next post, you will find out how to create a router. See you next. Thank you.




Sunday, February 3, 2019

Test Machine Spec and Virtual Networks


A few years ago, an electric shock caused my precious computer to fail. :( So I bought a new computer at the time. :D


I am currently using VMware Workstation Pro 15. The network configuration is as follows.


If your computer is directly connected to the Internet, the following configuration would be useful for testing.


You will learn how to install VMware Workstation Pro 15 in the next post. Thank you.

Tuesday, December 17, 2013

How to create virtual networks and routers in VMware Workstation


I use VMware Workstation (WS) 9 to test various OS and applications. Windows, Linux, x86 Solaris, VMware vSphere, databases, backup solutions and so on.  WS is useful software.

Before creating a Virtual machine (VM), I first create virtual networks. you can also make out the similar virtual networks in your VMware Workstation.

- up to 10 virtual networks in WS 9 based on Windows.
- up to 20 virtual networks in WS 10 based on Windows.

If you are a first time using VMware Workstation, please refer to the following.

■ How to create a virtual network in VMware Workstation



You can create a router VM using CentOS. Very simple. And if you install some required packages in CentOS, it acts as DHCP agent.

■  VMware Workstation - Create a  Router01 VM using CentOS



■  VMware Workstation - Create Router02, Router03 VMs



■  The static routing table of the IP Router


If you create a DHCP server, it is recommended to disable DHCP server function in a virtual network.

Thank you~! :)