realize l2 bridge utilization in vhosts
This commit is contained in:
@@ -39,7 +39,9 @@
|
||||
RUN+="/bin/sh -c 'modprobe ahci; echo 0000:08:00.0 > /sys/bus/pci/drivers_probe'"
|
||||
'';
|
||||
|
||||
boot.kernel.sysctl."net.ipv4.conf.all.forwarding" = true;
|
||||
boot.kernel.sysctl = {
|
||||
"net.ipv4.conf.all.forwarding" = true;
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/7e34cdc3-bd48-435a-8ea2-e1fe43926262"; }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
networking = {
|
||||
nftables.enable = true;
|
||||
firewall = {
|
||||
trustedInterfaces = [ "incusbr1" ];
|
||||
trustedInterfaces = [ "incusbr1" "incusbr2" ];
|
||||
filterForward = true;
|
||||
|
||||
extraForwardRules = ''
|
||||
@@ -23,6 +23,10 @@
|
||||
allowedTCPPorts = [ 53 ];
|
||||
allowedUDPPorts = [ 53 67 68 ];
|
||||
};
|
||||
incusbr2 = {
|
||||
allowedTCPPorts = [ 53 ];
|
||||
allowedUDPPorts = [ 53 67 68 ];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -9,9 +9,8 @@
|
||||
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 80 443 8123 1883 8883 9001 20 21 50000 50001 50002 50003 50004 50005 22 2222 2223 990 989 445 111 2049 32765 32768 20048 ];
|
||||
allowedUDPPorts = [ 111 2049 20048 32765 32768 ];
|
||||
trustedInterfaces = [ "incusbr0" "incusbr2" ];
|
||||
allowedTCPPorts = [ 53 80 443 8123 1883 8883 9001 20 21 50000 50001 50002 50003 50004 50005 22 2222 2223 990 989 445 111 2049 32765 32768 20048 ];
|
||||
allowedUDPPorts = [ 53 67 68 111 2049 20048 32765 32768 ];
|
||||
};
|
||||
|
||||
nftables.ruleset = ''
|
||||
@@ -28,6 +27,12 @@
|
||||
# allow vm to vm communication
|
||||
iifname "tap*" oifname "tap*" accept
|
||||
|
||||
# allow vm dns
|
||||
ether saddr 10:66:6a:06:f9:5e udp dport 53 accept
|
||||
|
||||
# allow vms on incusbr2 to go into lan
|
||||
iifname "incusbr2" accept
|
||||
|
||||
# allow natted replies
|
||||
iifname "incusbr2" oifname "incusbr0" tcp dport 8123 ct state new,established accept
|
||||
iifname "incusbr2" oifname "incusbr0" tcp dport 80 ct state new,established accept
|
||||
@@ -90,7 +95,6 @@
|
||||
{ address = "192.168.0.19"; prefixLength = 24; }
|
||||
];
|
||||
macAddress = "2c:fd:a1:c1:13:b0";
|
||||
mtu = 1280;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user