Code Monkey home page Code Monkey logo

vlans-vagrant's Introduction

VLAN Setup with Vagrant

This Vagrantfile provides a virtual environment to simulate a network setup with VLAN separation. VLANs, or Virtual Local Area Networks, are a means to partition a physical network into multiple, isolated logical networks. This setup helps in understanding and experimenting with VLAN configurations in a controlled environment.

Overview

The provided Vagrant setup comprises:

  1. Router VM:

    • Acts as the main router for the VLANs.
    • Configures and manages the VLAN interfaces, ensuring traffic separation between VLANs.
    • IP: 192.168.56.1.
  2. NGINX VM 1 (VLAN 10):

    • Hosts an NGINX web server.
    • Resides within VLAN 10.
    • IP within VLAN 10: 192.168.10.2.
  3. Client VM 1 (VLAN 10):

    • A basic client machine set up within VLAN 10.
    • Can be used to test connectivity and access to resources within VLAN 10.
    • IP within VLAN 10: 192.168.10.3.
  4. NGINX VM 2 (VLAN 20):

    • Hosts an NGINX web server.
    • Resides within VLAN 20.
    • IP within VLAN 20: 192.168.20.2.
  5. Client VM 2 (VLAN 20):

    • A basic client machine set up within VLAN 20.
    • Can be used to test connectivity and access to resources within VLAN 20.
    • IP within VLAN 20: 192.168.20.3.

Getting Started

Prerequisites

Ensure you have the following installed on your machine:

Usage

  1. Clone this repository or copy the Vagrantfile to a directory on your machine.
  2. Open a terminal and navigate to the directory containing the Vagrantfile.
  3. Run the command vagrant up. This will start the provisioning of the VMs as defined in the Vagrantfile.
  4. Once provisioning is complete, the VMs will be up and running. You can SSH into any VM using the command vagrant ssh <vm_name>. For example, to SSH into the router VM, use vagrant ssh router.

Testing VLAN Separation

  1. SSH into client1 and try accessing the NGINX web page hosted by nginx1 using curl http://192.168.10.2. You should be able to access it.
  2. From the same client, attempt to access the NGINX page hosted by nginx2 with curl http://192.168.20.2. This should fail due to VLAN separation.
  3. Perform similar tests from client2 to verify VLAN separation.

Cleanup

To halt the VMs, use the command vagrant halt. If you wish to delete the VMs and clean up, use vagrant destroy.

vlans-vagrant's People

Contributors

wozniakpl avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.