#Tapdevice

How To Set It Up with Tap Device

This is only applicable for BSD-based operating systems as Guest OSs.

I created a simple bash script for adding a TAP device and then executed the commands provided below in the terminal.

From Host OS:

  1. Create a tap device and allow permission to the user, set the device up, assign a manual ip address to be used by the guest OS (in my case, it is 192.168.0.50), and forward the ARP proxy to the tap device.

    ~/.scripts/tap
    #!/usr/bin/env zsh
    
    # Add a new TAP (network tap) devices in TAP mode
    sudo ip tuntap add dev tap0 mode tap
    
    # Bring up the tap device, making it active
    sudo ip link set dev tap0 up
    
    # Add a route to the assigned IP address
    sudo ip route add 192.168.0.100 dev tap0
  2. Set up the firewall. Please refer to the UFW configuration from one of my latest posts as provided in the “Lihat juga:” section below.

Tentang Blog & Penulis

Topik perbincangan dalam blog ini merangkumi Linux dan perisian sumber terbuka, Virtual Machine, serta Typesetting system.
Fokus semasa: Full Stack Development
Minat sampingan: Analisis Data
Bakat tersembunyi hamba (yang patutlah dipendam buat selama-lamanya): Menyanyi dan melukis.

Sumber dari Wallpaper Cave.