Utils
This commit is contained in:
@@ -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
|
||||
```
|
||||
Reference in New Issue
Block a user