Using a VyOS Router with Hyper-V

Please share with your friends...
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

Installation

Perform the following steps from the Hyper-V Virtual Machine Connection window.

  1. VyOS will boot from the ISO image. When ready, the login prompt will be displayed.
    Welcome to VyOS - vyos tty1
    
    vyos login:
  2. Type vyos and press Enter. The password prompt will be displayed.
    Password:
  3. Type vyos and press Enter. The Welcome to VyOS login banner will be displayed.
    Linux vyos 3.13.11-1-amd64-vyoas #1 SMP Wed Aug 12 02:08:05 UTC 2015 x86_64
    Welcome to VyOS.
    This system is open-source software. The exact distribution terms for
    each module comprising the full system are described in the individual
    files in /usr/share/doc/*/copyright.
  4. Type install image and press Enter.
    Welcome to the VyOS install program.  This script
    will walk you through the process of installing the
    VyOS image to a local hard dive.
    Would you like to continue? (Yes/No) [Yes]:
  5. Press Enter.
    Probing drives: OK
    Looking for pre-existing RAID groups...none found.
    The VyOS image will require a minimum 1000MB root.
    Would you like me to try to partition a drive automatically
    or would you rather partition it manually with parted?  If
    you have already setup your partitions, you may skip this step
    
    Partition (Auto/Parted/Skip) [Auto]:
  6. Press Enter.
    I found the following drives on your system:
     sda    2147MB
    
    
    Install the image on? [sda]:
  7. Press Enter.
    This will destroy all data on /dev/sda.
    Continue? (Yes/No) [No]:
  8. Type Yes and press Enter.
    How big of a root partition should I create? (1000MB - 2147MB) [2147]MB:
  9. Press Enter.
    Creating filesystem on /dev/sda1: OK
    Done!
    Mounting /dev/sda1...
    What would you like to name this image? [1.1.6]:
  10. Press Enter.
    Copying squashfs image...
    Copying kernel and initrd images...
    Done!
    I found the following configuration files:
        /config/config.boot
        /opt/vyatta/etc/config.boot.default
    Which one should I copy to sda [/config/config.boot]:
  11. Press Enter.
    Enter password for administrator account
    Enter password for user 'vyos':
  12. Type your desired password and press Enter.
    Retype password for user 'vyos':
  13. Confirm your password and press Enter.
    I need to install the GRUB boot loader.
    I found the following drives on your system:
     sda    2147MB
    
    
    Which drive should GRUB modify the boot partition on? [sda]:
  14. Press Enter.
    Setting up grub: OK
    Done!

Perform the following steps from the Windows PowerShell ISE window.

  1. Stop the VyOS Virtual Machine, using the following command:
    Stop-VM $VyOS_Name

    The VyOS Virtual Machine will shut down gracefully and turn off.

  2. Remove the installation ISO from the VyOS Virtual Machine, using the following commands:
    Get-VMDvdDrive -VMName $VyOS_Name | Remove-VMDvdDrive
  3. Start the VyOS Virtual Machine, using the following command:
    Start-VM -Name $VyOS_Name

    The VyOS Virtual Machine will start and boot to the login prompt.


Please share with your friends...
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

7 comments

  1. Hey Chris,
    Nice work! Easy to follow as well. I’ve been doing something similar with 2012R2 Routing and Remote Access with VLANs but I have 2 x hosts running 2012R2 (both with a single NIC) and then have three VLANs that need to be routed. I needed both hosts to be in the domain so I can configure constrained delegation and move VMs between hosts. Have you tried this config on two hosts?

    1. Hi Martin!

      Thanks for you comments 🙂 What you are currently doing with RRAS should be quite easy with VyOS – although I haven’t specifically tried it.

      Kind Regards,
      Chris.

  2. Hi Chris,

    It works! Just started learning VyOs and this guide helps me a lot!
    Thank you very much.

    wks_adm

  3. Hi Chris,

    It is possible that I can communicate with the VM into my local machine? I tried to use the Internal Network adapter but I can’t ping the VM’s IP. Thank you in advance.

    1. Hi wks_adm,

      The VyOS configuration presented in the tutorial uses NAT in the same way as a home broadband router, so by default it is not possible for your host machine on the “outside” to communicate with a virtual machine on the “inside”. However, like a router, in VyOS you can setup port forwarding (Desination NAT) – so you can manually setup rules to allow individual outside connections through.

      For example, the following commands enable port forwarding for RDP (TCP 3389) to host 172.16.1.20:

      set nat destination rule 10 description 'RDP to 172.16.1.20:3389'
      set nat destination rule 10 destination port 3389
      set nat destination rule 10 inbound-interface eth0
      set nat destination rule 10 protocol tcp
      set nat destination rule 10 translation address 172.16.1.20
      set nat destination rule 10 translation port 3389

      RDP to the VyOS eth0 external address. Use different destination port addresses for multiple hosts with the same service.

      Hope that helps!
      Chris.

  4. Hi Chris,

    Fantastic! I was looking this for kind of tutorial, I followed all the instructions and it works like a Charm
    Thank you very much for spending your time making this great tutorial.

Leave a Reply