3

I've been following this post here on how to do this. I am using OS X and VirtualBox with an Ubuntu server.

In the post they have the following: (I don't see those settings)

auto eth0
 iface eth0 inet static
   address 10.253.0.50
   netmask 255.255.255.0
   network 10.253.0.0
   gateway 10.253.0.1
   dns-nameservers 8.8.8.8

Where do I find network, gateway and dns-nameservers?

When I do an ifconfig in Ubuntu, I only see the following relevant settings:

eth0

  • inet addr
  • Bcast
  • Mask

lo

  • inet addr
  • Mask
d a i s y
  • 5,511
esteemed.squire
  • 635
  • 1
  • 7
  • 11
  • The appropriate network settings will depend whether you are setting it up in bridged mode with an IP address from the same LAN range as the host, or in the default NAT mode where you will be forwarding ports from the host to the private virtual network. – steeldriver Jul 17 '15 at 10:36
  • I am using bridged mode. But I don't see the settings mentioned in my question in both the Ubuntu server or OS X (host machine). – esteemed.squire Jul 17 '15 at 20:19
  • You don't see them because you have to type them – solsTiCe Oct 17 '16 at 09:43

2 Answers2

2

To have a static IP for your server, you have to understand your network configuration. If you are the one managing the IP network, you have to use one of the free IP. Otherwise, please ask your network admin for a static IP and use that.

  • address (enter the IP you got from admin)
  • netmask (enter the subnet mask)
  • network (you can identify your network from the IP you got)
  • gateway (This also you have get from the admin)
  • dns-nameservers (this can be 8.8.8.8 or whatever admin gives you)

Except, IP address, everything else can be copied from another machine from your network which is configured with static IP.

Chandrasekar
  • 347
  • 2
  • 6
  • I am using the following—address from the one provided by the virtual machine e.g., 192.168.1.32, netmask is provided when I do a ifconfig in Ubuntu server. network, gateway, dns-nameservers I do not see these listed in the ifconfig in Ubuntu nor on my host OS X when I do a ifconfig. Any idea where I can find these numbers? I am using bridged adapter for the virtual machine. – esteemed.squire Jul 17 '15 at 20:18
  • What is the output of 'netstat -rn' command? It will tell you the gateway. Try pinging the gateway and if you see the ping response, your network configuration is fine. To change to static IP you have to get the free static IP from your network admin, and they can provide dns nameserver details. I am not sure how to check that in OS X. – Chandrasekar Jul 18 '15 at 06:22
  • Thanks, I believe I have it figured out with the changes in the answer, seems to work and I'm able to ping other ips as well with these settings. – esteemed.squire Jul 18 '15 at 06:28
2

I believe I have this working with the following settings in /etc/network/interfaces:

auto eth0
iface eth0 inet static
address 192.168.1.32
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
esteemed.squire
  • 635
  • 1
  • 7
  • 11