#!/bin/bash
# - bof - #


# :1
# -  - #
# - Configuring a new network bridge - #
ProxmoxMini
  Network
    Create
      Linux Bridge
                Name: vmbr2
           IPv4/CIDR: 192.168.101.1/16
             Comment:
    Click Create
    Apply Configuration
    Yes








# :2
# -  - #
# - Installing & configuring OpnSense in ProxmoxVE - #

# :a
# -  - #
# - Documentation - #
https://www.youtube.com/watch?v=1OEDhZH9GOQ

https://www.youtube.com/watch?v=XXx7NDgDaRU


# :b
# -  - #
# - Create OpnSense VM - #


# :b.1
# -  - #
# - OpnSense VM Basic Configuration - #
General
  1100
  OpnSense-101
OS
  ISO image: OpnSense_25-1_64bit.iso
System
  Default (i440fx)
  Default (SeaBIOS)
Disks
  65Gb
CPU
  Sockets: 1
    Cores: 6
    Total: 6
Memory
  8192
  Ballooning Devide Disable
Network
  No network device



# :b.2
# -  - #
# - Add OpnSense Network configuration - #
Click on 

1100 (OpnSense)
  Hardware
    Add
      Network Device
          Bridge: vmbr0
        Firewall: Disable
                  WAN
        Add

  Hardware
    Add
      Network Device
          Bridge: vmbr2
        Firewall: Disable
             For: 192.168.101.0
        Add



# :c
# -  - #
# - Start OpnSense - #
Console
  noVNC
    Start Now


# :d
# -  - #
# - Installation - #
Do you want to configure LAGGs now:  (N)o
Do you want to configure VLANs now:  (N)o

 login:  installer
passwd:  opnsense


# :d.1
# -  - #
# - OpnSense menu - #

Continue with default keymap
Install ZFS GPT/UEFI Hybrid
Stripe - No Redundancy
Select QEMU HDD
OK - Enter
YES - Enter


# :d.2
# -  - #
# - Set root passwd - #
Complete Install
OK - Enter
Reboot now
OK - Enter

# :d.3
# -  - #
# - Login as root - #


# :d.4
# -  - #
# - Interfaces - #

1) Assign interfaces

Do you want to configure LAGGs now?  (N)o
Do you want to configure VLANs now?  (N)o

WAN vtnet0
LAN vtnet1

Enter

Do you want to proceed? (Y)es
Enter



LAN (vtnet1) -> v4: 192.168.1.1/24           ->   To be changed to 192.168.101.1/16
WAN (vtnet0) -> v4/DHCP4: 192.168.1.28/24    ->   Correct (Connection to the router)



# :d.5
# -  - #
# - Set IPs - #

2) Set interface IP address

# :d.5.1
# -  - #
# - Set LAN IPa - #

1 - LAN
Configure IPv4 address LAN interface via DHCP? (N)o

Enter the new LAN IPv4 address.
192.168.101.1

Enter the new LAN IPv4 subnet bit count (1 to 32):
16

For a WAN... For a LAN...
Enter

Configure IPv6 address LAN interface via WAN tracking? (N)o
No
No

DHCP server?  (N)o
No
No
No
No


https://192.168.101.1

LAN (vtnet1) -> v4: 192.168.101.1/16
WAN (vtnet0) -> v4: 192.168.1.28/24


# :d.6
# -  - #
# - Reload all services - #

11 - Reload all services


# :e
# -  - #
# - Reload all services - #
Ubuntu-OpnSense
  Hardware
    Add
      Network Device
        vmbr2


Start the VM
Configure network manually

Network (wire)
  Turn off
  Configuration
  iPv6 Disable

  iPv4 Manual
  Address: 192.168.101.10
  Netmask: 255.255.0.0
  Gateway: 192.168.101.1

      DNS: 1.1.1.1



# :f
# -  - #
# - Reload all services - #
OpnSense Sonsole:
11) Reload all services



# :g
# -  - #
# - Ubuntu-OpnSense - #

https://192.168.101.1











# - eof - #