Hello @stim48,
can you please let me know what exactly you changed ? I have the same problem
I have uploaded the photo showing the polyscope, the terminal runing the simulator (pay atteniton to the error exception that says can t understand the output of net-statistic) and the ifcofnig. I have configured Bridged network adapter for the VM and have access to the internet from VM.
Below is the net-statistic, I had to replace the “et” sign with “At” to post the code here.
#!/usr/bin/perl
my $interface = “enp0s3”;
my $isDhcp = 0;
my $isStatic = 0;
open(INTF,"</etc/network/interfaces") || die “Cannot open interfaces”;
while($line = ) {
chomp $line;
if ($line =~/enp0s3/) {
$interface = “enp0s3”
}
if ($line =~ /$interface.*dhcp/) {
$isDhcp = 1;
} elsif ($line =~ /$interface.*static/) {
$isStatic = 1;
}
}
close INTF;
my $interface_operstate = cat /sys/class/net/$interface/operstate
;
my "At"ifconfig = split(/\n/,/sbin/ifconfig $interface 2>&1
);
my $addr = “”;
my $mask = “”;
my $ifconfig_str = join(" ", "At"ifconfig);
my $isNetDown = 1;
if ($interface_operstate =~ /up/) {
$isNetDown = 0;
}
if ($isDhcp) {
print “Mode:dhcp\n”;
} elsif ($isStatic) {
print “Mode:static\n”;
} else {
print “Mode:disabled\n”;
}
if ($isNetDown) {
print “Net down\n”;
} else {
print “Net up\n”;
}
foreach $line ("At"ifconfig) {
chomp $line;
if($line =~ /inet addr/) {
$addr = $line;
$addr =~ s/.inet addr:([^ ])./$1/;
}
if($line =~ /Mask/) {
$mask = $line;
$mask =~ s/.Mask:([^ ])./$1/;
}
}
my "At"route = split(/\n/,/sbin/route -n
);
my $gateway = “”;
foreach $line ("At"route) {
chomp $line;
if($line =~ /^0.0.0.0 /) {
$gateway = $line;
$gateway =~ s/^0.0.0.0[ ]([^ ]).*/$1/;
}
}
open RES, “</etc/resolv.conf”;
my "At"nameservers;
while($line = ) {
chomp $line;
if($line =~ /nameserver/) {
my $name=$line;
$name =~ s/nameserver //;
push "At"nameservers, $name;
}
}
close RES;
my "At"hostname = split(/\n/, hostname
);
print “Address:$addr\n”;
print “Mask:$mask\n”;
print “Gateway:$gateway\n”;
print “nameserver1:” . $nameservers[0] . “\n”;
print “nameserver2:” . $nameservers[1] . “\n”;
print “Hostname:$hostname[0]\n”;
Thanks for sharing.
Regards,
Goce