ifup returns an unknown interface error
I'm still learning Linux and I'm less familiar with Ubuntu. I have a Ubuntu image that I'm using in VirtualBox on a windows machine. It was able to connect and get an IP address up until about a week ago. I made no configuration changes. I've tried placing VirtualBox settings to use NAT and also tried bridged, it didn't seem to make a difference. If I run ifconfig, it gives me enp0s3, but if I run ifup enp0s3 I get an unknown interface enp0s3 error.
uname -a
output:
Linux cs165-VirtualBox 4.10.0-40-generic #44-16.04.1-Ubuntu SMP Thu Nov 9 15:33:07 UTC 2017 i686 i686 i686 GNU/Linux
ifconfig
output:
enp0s3 Link encap:Ethernet HWaddr 08:00:27:eb:53:a4
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:720 (720.0 B) TX bytes:240 (240.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240 (240.0 B) TX bytes:240 (240.0 B)
What I get when I try to restart the network service:
~> /etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service.
ifup
returns an unknown interface error:
~> ifup enp0s3
Unknown interface enp0s3
Try using
sudo ifconfig enp0s3 up
or
sudo ifconfig enp0s3 down
or
sudo ip link set dev enp0s3 up
or
sudo ip link set dev enp0s3 down
Hope this helps!