Proxmox LXC Container Setup #232

Closed
opened 2021-03-26 08:22:18 +00:00 by p3k · 1 comment
p3k commented 2021-03-26 08:22:18 +00:00 (Migrated from github.com)
  • Install ifupdown2 (needed for applying network settings in Proxmox)

  • Define vmbr1 Linux bridge with IP 172.17.1.1/16

  • Enable IP Forwarding net.ipv4.ip_forward=1 in /etc/sysctl.d/99-hetzner.conf

  • Define additional settings

    # Source: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_masquerading_nat_with_span_class_monospaced_iptables_span
    post-up   iptables -t nat -A POSTROUTING -s '172.17.0.0/16' -o enp0s31f6 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '172.17.0.0/16' -o enp0s31f6 -j MASQUERADE
    
    post-up   iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
    post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
    
    # Route SSH to Antville dev container via port 30180
    post-up   iptables -t nat -A PREROUTING -p tcp -i enp0s31f6 --dport 30180 -j DNAT --to-destination 172.17.3.180:22
    post-down iptables -t nat -D REROUTING -p tcp -i enp0s31f6 --dport 30180 -j DNAT --to-destination 172.17.3.180:22
    
    # Route SSH to Twoday dev container via port 30181
    post-up   iptables -t nat -A PREROUTING -p tcp -i enp0s31f6 --dport 30181 -j DNAT --to-destination 172.17.3.181:22
    post-down iptables -t nat -D REROUTING -p tcp -i enp0s31f6 --dport 30181 -j DNAT --to-destination 172.17.3.181:22
    
  • Copy files into shared directory

  • Install and run Apache2 LXC (3000)

  • Install and run MariaDB LXC (3010)

  • Install and run Antville.org LXC (3020)

  • Install and run Antville development LXC (3080)

  • Install and run Twoday.net LXC (3021)

  • Install and run Twoday development LXC (3081)

  • Install and run backup LXC (3050)

  • Install and run Mattermost LXC

  • Install Distributed Shell

  • Install Bash-It Install zsh

  • Install and run etckeeper on all containers

  • Install sudo on dev containers and define /etc/sudoers.d/helma for starting / stopping Helma

- [x] Install ifupdown2 (needed for applying network settings in Proxmox) - [x] Define vmbr1 Linux bridge with IP 172.17.1.1/16 - [x] Enable IP Forwarding `net.ipv4.ip_forward=1` in `/etc/sysctl.d/99-hetzner.conf` - [x] Define additional settings <details> ```plain # Source: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_masquerading_nat_with_span_class_monospaced_iptables_span post-up iptables -t nat -A POSTROUTING -s '172.17.0.0/16' -o enp0s31f6 -j MASQUERADE post-down iptables -t nat -D POSTROUTING -s '172.17.0.0/16' -o enp0s31f6 -j MASQUERADE post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1 post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1 # Route SSH to Antville dev container via port 30180 post-up iptables -t nat -A PREROUTING -p tcp -i enp0s31f6 --dport 30180 -j DNAT --to-destination 172.17.3.180:22 post-down iptables -t nat -D REROUTING -p tcp -i enp0s31f6 --dport 30180 -j DNAT --to-destination 172.17.3.180:22 # Route SSH to Twoday dev container via port 30181 post-up iptables -t nat -A PREROUTING -p tcp -i enp0s31f6 --dport 30181 -j DNAT --to-destination 172.17.3.181:22 post-down iptables -t nat -D REROUTING -p tcp -i enp0s31f6 --dport 30181 -j DNAT --to-destination 172.17.3.181:22 ``` </details> - [x] Copy files into shared directory - [x] Install and run Apache2 LXC (3000) - [x] Install and run MariaDB LXC (3010) - [x] Install and run Antville.org LXC (3020) - [x] Install and run Antville development LXC (3080) - [x] Install and run Twoday.net LXC (3021) - [x] Install and run Twoday development LXC (3081) - [x] Install and run backup LXC (3050) - [x] Install and run Mattermost LXC - [x] Install [Distributed Shell](http://manpages.ubuntu.com/manpages/bionic/man1/dsh.1.html) - [x] ~~Install [Bash-It](https://github.com/Bash-it/bash-it)~~ Install zsh - [x] Install and run [etckeeper](https://ubuntu.com/server/docs/tools-etckeeper) on all containers - [x] Install sudo on dev containers and define `/etc/sudoers.d/helma` for starting / stopping Helma
p3k commented 2021-04-09 22:07:44 +00:00 (Migrated from github.com)

note to self: change Site#main skin to saying This is Myrstack ⅽⅹⅼ. speaking … (roman numerals → backwards LXC) 😆

note to self: change Site#main skin to saying `This is Myrstack ⅽⅹⅼ. speaking …` (roman numerals → backwards LXC) 😆
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: antville/antville#232
No description provided.