Home Network Tossing Notebook 2: HyperV+DSM&VPN Tossing

DSM

It has been a long time since I set up my own NAS, but I haven't been motivated. It's very convenient to have too many cloud disks. Suddenly one day, the cloud disk began to crab, began to take one family and close it, and it was stimulated. It was just a certain activity in the East and it was DIY. Because of my IT dog, in line with the principle of best use of materials, this DIY considers multi-purpose: In addition to NAS, but also for some of the DB and interest in the work of toss.

configuration list

CPU: Inter I3-6100

Motherboard: Asus B150-PLUS

SSD: Kingston 120G M.2 2280 SSD

Memory: Kingston DDR4 2133 8GB Desktop Memory X2 (send from a motherboard)

Hard Disk: WD4T red disk X2; Seagate 3TB X2

Power: XFX rated 550W XTR550

Chassis: Tt Fans A31

System solutions

Operating system: When weed DSM, we read a lot of articles about Black Cluster, thought about direct virtualization but personally feel a bit waste (you can't add video card hanging game later, hard disk does not seem to sleep), found Win+HyperV more Meet personal requirements (HyperV virtual machine can automatically save the current state when the host shuts down, automatic recovery at startup).

Hard Disk Solution: SSD is used as the system disk of Win10. Seagate 2 hard disk raid0 plans to store non-essential data (movies, TV dramas, etc.), and 2 Red Disks raid1 store important data while cooperating with Baidu Cloud Synchronization on DSM. The raid mentioned above uses win's own storage space to implement soft raid.

DSM storage mode: There is no disk directly after raid to DSM. Instead, it is mounted on the win system and then mounted to DSM through NFS. This disk can be used both for win10 and for DSM, why not. However, when using NFS, there is a need to pay attention to: DSM need to create an index of the file (photos, video and Baidu cloud synchronization and the like) can not be operated on the win server, can only operate through the DSM, otherwise because of the DSM system The permission problem of the next file, which can not create an index and can not be viewed in the relevant server.

Installation and deployment

After Win10 Ultimate is installed, HyperV will not be automatically installed. We need to manually add this component (it will automatically restart during installation): Control Panel - Programs and Features - Enable or disable Windows features - HyperV.

Enable HyperV

Simply put, install the virtual machine under HyperV:

Open the HyperV console (Control Panel - Administrative Tools - HyperV Manager) and first click on "Virtual Switch Manager" to create an external virtual switch.

Then we click "New" to start a new virtual machine following the boot screen.

Virtual machine name

Virtual Machine Algebra

Set up memory

Select switch

hard disk

Select the installation file

Then install DSM, DSM installation will not be introduced, there are many related experiences.

Let me talk about some of the details of the virtual machine settings (in the console, click on the virtual machine to set (need to shut down the virtual machine)):

Dynamic memory

Dynamic CPU

Automatic start

Start saving

NFS

Server

Enabling NFS service on Win machine is very simple, you can install "haneWIN NFS Server"

After the installation, use the administrator to run and open the interface for configuration; in the "Output - Edit Output File", configure the NFS server shared directory

After configuration, we click on "restart service". (Sometimes it doesn't seem to work, but it can be restarted by command)

Clients

The NFS service on Win has been set up. How can we make DSM use this shared directory?

First of all, in the file management in DSM, we install our own design to create a new directory structure, and then mount the NFS shared directory by command.

How to make the above command automatically? There are two ways:

Boot automatically mount: After logging in to DEM via SSH, edit the "/etc/rc" file and add the mount command before "exit 0" at the end.

DSM Mission Plan: DSM-Control Panel - add a regularly scheduled mission plan to the mission plan.


The above two methods can coexist.

VPN

Build a VPN for yourself, which can be used for intranet penetration and scientific Internet access (requires foreign VPS).

First we need to buy a VPS, configuration is not very high, I bought 35 knife a year (1 CPU 512 memory 20G hard drive 1 ip 2T monthly traffic), the system uses Ubuntu 16.04, this configuration only VPN may be a bit wasteful, like Tossing can play on their own. (The service provider doesn't say it, so you don't have to advertise.)

There are many protocols commonly used for VPN services. Here we briefly introduce the setup of pptp and openvpn.

In short, the advantage of pptp is that any terminal basically does not need to install a client, and the system itself supports the pptp protocol.

PPTP

OpenVPN

OpenVPN When I tried it, the open source Pritunl used had a web administration page. The official website has installation methods for various systems. Here is an example using Ubuntu16.04:

Internal network penetration + remote wake-up

With VPN, log in to the VPN in the LAN, and then set the jump on the VPN server to achieve intranet penetration.

VPN connection here does not say (each environment is different), here simply talk about how to configure intranet penetration and achieve remote wake-up.

Intranet Penetration We configure port jumps through purchased VPS iptables

This is a udp jump that I used to implement remote wakeup configuration. Here my 192.168.254.254 machine is a ROS router. Then I configure a udp port jump in ROS and assign it to the machine I need to wake up. Now.

Among them, the remote wake-up needs the computer to start the network wake-up, the relevant methods are introduced on the network, here is a brief introduction:

1. The wake-up function is enabled in the BIOS (it is not the same as the interface mode of each motherboard, so it is not described here in detail)

2. Network card configuration

3. Power configuration

After all of the above are configured, we can realize the remote wake-up of computers in the LAN through a variety of methods (computer software, web services, mobile phone APPs) on the external network.