Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Cannot set Static IP in Debian VM

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
f0rr0z
Posts: 1
Joined: 2017-03-15 11:07

Cannot set Static IP in Debian VM

#1 Post by f0rr0z »

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.

arochester
Emeritus
Emeritus
Posts: 2435
Joined: 2010-12-07 19:55
Has thanked: 14 times
Been thanked: 54 times

Re: Cannot set Static IP in Debian VM

#2 Post by arochester »

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

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Cannot set Static IP in Debian VM

#3 Post by pcalvert »

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
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Post Reply