Issues setting a static address

Discussions about using Linux guests in VirtualBox.
Post Reply
swortsoul
Posts: 2
Joined: 27. Oct 2017, 05:49

Issues setting a static address

Post by swortsoul »

This is getting frustrating. I posted this on the Ubuntu forums but thought this might be a better spot. My host is a Win10 box.

I've worked with other flavors of unix and a bit of linux, but never Ubuntu. I didn't think it would be too hard to set a static IP for a virtualbox ubuntu server (17.10).

The machine seems to grab an IP from dhcp, but I can't figure out why or how to change it. It can see my other machines and get to the internet. I'm using a bridged adapter on my virtual ubuntu guest. For the guest I've got the following:

Code: Select all

dluser@dlbox:~$ ifconfig -a
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.24 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::a00:27ff:fe7f:c7f8 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:7f:c7:f8 txqueuelen 1000 (Ethernet)
RX packets 905 bytes 235940 (235.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 535 bytes 70731 (70.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 196 bytes 13898 (13.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 196 bytes 13898 (13.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Code: Select all

dluser@dlbox:~$ sudo lshw -class network
[sudo] password for dluser:
*-network
description: Ethernet interface
product: 82540EM Gigabit Ethernet Controller
vendor: Intel Corporation
physical id: 3
bus info: pci@0000:00:03.0
logical name: enp0s3
version: 02
serial: 08:00:27:7f:c7:f8
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 66MHz
capabilities: pm pcix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full ip=192.168.0.24 latency=64 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:19 memory:f0000000-f001ffff ioport:d010(size=8)

Code: Select all

dluser@dlbox:~$ cat /etc/network/interfaces
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# Generated by debian-installer.

# This file describes the network interfaces available on your system
# # and how to activate them. For more information, see interfaces(5).
#
# # The loopback network interface

auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet static
address 192.168.0.23
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
Any help would be appreciated.
And just to show this, these commands don't exist. I see them in many posts.

Code: Select all

dluser@dlbox:~$ sudo ifup enp0s3
sudo: ifup: command not found
dluser@dlbox:~$ sudo ifdown enp0s3
sudo: ifdown: command not found
Any ideas? I've searched for a couple days. I've rebuilt the machine a couple times. Not sure what else to do.

Thanks for any help.
Last edited by socratis on 27. Oct 2017, 07:46, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
JEBjames
Posts: 58
Joined: 26. Jan 2017, 18:27
Primary OS: MS Windows other
VBox Version: OSE other
Guest OSses: Centos, Ubuntu, Debian, Various Windows
Contact:

Re: Issues setting a static address

Post by JEBjames »

Not a solution, but a note...

Newer Linux systems stopped installing (by default) ifup/ifdown. It's newer replacement is the "ip" command.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Issues setting a static address

Post by Perryg »

This is not a VirtualBox issue at all just another something simple made harder for no reason at all.

https://askubuntu.com/questions/967695/ ... -static-ip
swortsoul
Posts: 2
Joined: 27. Oct 2017, 05:49

Re: Issues setting a static address

Post by swortsoul »

This was it. I'm sure some much smarter than me people worked hard and implemented that, but that is nucking futs... Yes I read how, why etc.

Thanks for the answer. Next time I need to set a static IP I'll go write a script, run a few commands, and hope it works again. You know, instead of editing a simple file and restarting the adapter.

It's really not that difficult, just changing something I found simple. I guess the more I use it, it will be simple as well.

Thanks again.
Post Reply