https://github.com/adel-bz/proxmox-private-network
Create and Settings a NAT network on a single IP address
https://github.com/adel-bz/proxmox-private-network
cloud-init kubernetes-cluster nat network proxmox
Last synced: 4 months ago
JSON representation
Create and Settings a NAT network on a single IP address
- Host: GitHub
- URL: https://github.com/adel-bz/proxmox-private-network
- Owner: adel-bz
- Created: 2024-07-01T11:29:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T10:54:16.000Z (almost 2 years ago)
- Last Synced: 2025-06-02T05:59:22.516Z (about 1 year ago)
- Topics: cloud-init, kubernetes-cluster, nat, network, proxmox
- Homepage: https://youtube.com
- Size: 12.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Proxmox-Private-Network
# Introduction
The Proxmox-Private-Network guide provides a comprehensive step-by-step tutorial for setting up a private network within a Proxmox environment. This process involves configuring a virtual network bridge, modifying network settings through SSH or the Proxmox shell, and ensuring proper NAT settings for network address translation. By following this guide, users can effectively establish a private network to manage VMs with isolated network environments. This can be useful when creating Highly Available Kubernetes clusters that need at least 6 Servers (3 Master and 3 Workers).
# Instruction
#### 1. Create a VM (if it doesn't exist).
#### 2. Create a Virtual Network (e.g., vmbr1)
- Select the node (Proxmox Host) under Datacenter.
- Navigate to the "Network" section in the "System" tab.
- Click "Create" and choose "Linux Bridge"
- Enter your network IP (e.g., "192.168.1.1/24") in the IP4/CIDR box.
- Click "Apply Configuration"

### 3. SSH into Proxmox Host
- Use SSH or the "Shell" option on the Proxmox panel to connect to the Proxmox host.
### 4. Update Network Interfaces
- Add the following code to ```/etc/network/interfaces``` (adjust network name and IPs as needed):
```
auto vmbr1
iface vmbr1 inet static
address 192.168.1.1
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0
# NAT SETTINGS
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o enp6s0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o enp6s0 -j MASQUERADE
```

#### 5. Restart Network:
```
# sudo systemctl restart networking
```
#### 6. Configure VM Network Device
- In the Proxmox panel, select your VM.
- In the "Hardware" section, change the network device to ```vmbr1```.
#### 7. Set IP and Gateway (for Cloud-init)
- Under the Hardware tab, go to the Cloud-Init tab.
- Edit the IP Config option with your specific IP.

#### 8. Start VM and Verify Connection
- Start your machine
- check the internet connection with:
```
# Ping 4.2.2.4
```
For a visual reference, you can watch this example video on [YouTube](https://youtu.be/gmAMq52Q-94) (see: it may not follow these exact steps).