Cannot set Static IP in Debian VM

New to Debian (Or Linux in general)? Ask your questions here!

Cannot set Static IP in Debian VM

Postby f0rr0z » 2017-03-15 11:59

Hi there! I'm new in this forum and almost new in the linux world too.
I'm installing a VM of Debian, which I'll need to use in my IT classes, but I'm having troubles to configure a static IP.
I tried to set up a new minimal virtual machine, without any kind of configuration (just defect parameters), and I'm having that same problem. I used the research but any solution worked for me, so here I am looking for it.

If I use my VM in dhcp mode, I don't have any problem with, but our teacher told us to set a static IP, in my case, 192.168.30.27, to don't have problems with users using the same IP asigned by dhcp. And when I change the configuration file "nano /etc/network/interfaces" and put it on static, I cannot acces internet or debian repositories.

This was the default "interfaces" file:
_______________________________________________________
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
_______________________________________________________
And the only modification that I made in, it's in the last command line:
from "iface eth0 inet dhcp" to "iface eth0 inet static"
and add another line, that's " address 192.168.30.27"

I don't know what's wrong. I tried to adding netmask, broadcast, gateway... but it didn't work, so I put it like I wrote again.
Furthermore, I cannot connect to MV by ssh when IP is static. And I tried the network settings of Virtual Box configured in NAT and Bridged Adapter, with the same result. Don't know if that info could help.

I add a screenshot about the error message, it's in spanish but it just say "Cannot resolve <<ftp.es.debian.org>>" and under that "W: Failed to obtain 'repository_url' "
Image
I'm desesperately trying to fix that, help please :(

By the way, I'm sorry for my bad english. Just learned some at school and videogames.
f0rr0z
 
Posts: 1
Joined: 2017-03-15 11:07

Re: Cannot set Static IP in Debian VM

Postby arochester » 2017-03-15 12:24

You could try these as well.
Spanish
http://barrapunto.com/index.pl?section=debian - Barrapunto.com - Debian related News.
http://blog.desdelinux.net/tag/debian - DesdeLinux - Documentation, news and forums related to Debian.
http://www.exdebian.org - exDebian - Documentation, news and forums related to Debian.



There is also
http://www.garryricketsonartworks.org/Debian-spanish/ -New, support questions, discussion
- based in Mexico
"Something to be aware of: Debian is a core or source distribution. This means there are many Debian-based distributions. THEY ARE NOT DEBIAN."
arochester
 
Posts: 1053
Joined: 2010-12-07 19:55

Re: Cannot set Static IP in Debian VM

Postby pcalvert » 2017-03-16 02:05

Hi,

This is the approach I use, and it works well:
Keeping the NAT adapter and adding a second host-only adapter works amazing, and is crucial for laptops (where the external network always changes).

http://muffinresearch.co.uk/archives/20 ... ux-guests/

Remember to create a host-only network in virtualbox itself (GUI -> settings -> network), otherwise you can't create the host-only interface on the guest.


Source:
http://stackoverflow.com/a/10410527

Phil
pcalvert
 
Posts: 1731
Joined: 2006-04-21 11:19
Location: Sol Sector


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable