From b28040973d5241aef87158cf3850f48f751ac6a9 Mon Sep 17 00:00:00 2001 From: sem Date: Sun, 5 Feb 2023 23:21:01 +0300 Subject: [PATCH] Utils --- Proxmox/README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Proxmox/README.md b/Proxmox/README.md index 4a2a7db..a031011 100644 --- a/Proxmox/README.md +++ b/Proxmox/README.md @@ -26,3 +26,46 @@ LV vg0 data /var/lib/vz ext4 all # or ext4 300G IMAGE /root/.oldroot/nfs/install/../images/Debian-1105-bullseye-amd64-base.tar.gz ``` +Настройка сети с NAT и мрашрутизацией для виртуалных машин +``` +source /etc/network/interfaces.d/* + +auto lo +iface lo inet loopback + +iface lo inet6 loopback + +auto enp7s0 +iface enp7s0 inet static + address 65.109.116.119/26 + gateway 65.109.116.65 + up route add -net 65.109.116.64 netmask 255.255.255.192 gw 65.109.116.65 dev enp7s0 +# route 65.109.116.64/26 via 65.109.116.65 + +iface enp7s0 inet6 static + address 2a01:4f9:3051:1005::2/64 + gateway fe80::1 + +iface eth0 inet manual + +#auto vmbr100 +#iface vmbr100 inet static +# address 192.168.100.0/24 +# bridge-ports none +# bridge-stp off +# bridge-fd 0 + +auto vmbr100 +iface vmbr100 inet static + address 192.168.100.1 + netmask 255.255.255.0 + bridge-ports none + bridge-stp off + bridge-fd 0 + +#NAT + +post-up echo 1 > /proc/sys/net/ipv4/ip_forward +post-up iptables -t nat -A POSTROUTING -s '192.168.100.0/24' -o enp7s0 -j MASQUERADE +post-down iptables -t nat -D POSTROUTING -s '192.168.100.0/24' -o enp7s0 -j MASQUERADE +``` \ No newline at end of file