URsim network problem

Hey.
I have installed a kubuntu 18.04
Installed on the system.
There were problems with the network in the settings of the polyscope. Tried to prescribe in manual, also does not work. Always folds in the “disabled network”

I tried to use a virtual machine, everything works there.

who faced the problem?

The Network tab in the simulator is hardware dependent.
You are not able to configure the network settings in the URSim, but the simulator is by default running on the virtual host IP-configuration.
So you can change these settings in the OS.

1 Like

I change the network settings in the OS, but in the simulator only the “Default gateway”.
DNS server remains unchanged.

screenshot OS settings screen.

The problem is solved.
Edited the file “/ursim/filesys/sbin/net-statistics”
I registered the correct name of the network interface.
And the search for the IP address in the output of the command “ifconfig”.

4 Likes

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

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.