use PVE::LXC;
use PVE::Tools qw(run_command);
-use PVE::Network;
use PVE::ProcFSTools;
-my $have_sdn;
-eval {
- require PVE::Network::SDN::Zones;
- $have_sdn = 1;
-};
-
die "got unexpected argument count\n" if scalar(@ARGV) != 5;
my ($vmid, $arg2, $arg3, $type, $iface) = @ARGV;
my $net = PVE::LXC::Config->parse_lxc_network($netconf);
-my $tag = $net->{tag};
-my $firewall = $net->{firewall};
my $bridge = $net->{bridge};
-my $trunks = $net->{trunks};
-my $rate = $net->{rate};
-
die "missing bridge configuration" if !$bridge;
if (-d "/sys/class/net/$iface") {
PVE::Tools::run_command("/sbin/ip link set dev $iface up mtu $bridgemtu");
PVE::Tools::run_command("/sbin/ip addr add 0.0.0.0/0 dev $iface");
-
- if ($have_sdn) {
- PVE::Network::SDN::Zones::tap_plug($iface, $bridge, $tag, $firewall, $trunks, $rate);
- PVE::Network::SDN::Zones::add_bridge_fdb($iface, $net->{hwaddr}, $bridge, $firewall);
- } else {
- PVE::Network::tap_plug($iface, $bridge, $tag, $firewall, $trunks, $rate, { mac => $net->{hwaddr}});
- }
+ PVE::LXC::net_tap_plug($iface, $net);
}
exit 0;