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

 

 

 

[SOLVED]setting up a static ip

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
waldekflipper
Posts: 2
Joined: 2017-09-17 18:21

[SOLVED]setting up a static ip

#1 Post by waldekflipper »

Hello,
i want to set up a static ip for my server because i am trying to run openvpn but i walked into an issue.
When i google how to setup an static ip all the tutorials tell me to add something like this

Code: Select all

allow-hotplug eth0
iface eth0 inet static
        address 192.168.1.202
        netmask 255.255.255.0
        gateway 192.0.1.1
underneath "# The primary network interface" in /etc/network/interfaces.
But my problem is there is no ""# The primary network interface" in my /etc/network/interfaces.
To clarify: acording to the tutorials my /etc/network/interfaces is supposed to look like

Code: Select all

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 to make my ip static i need to add this.
so when its static it looks like

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 192.168.1.202
        netmask 255.255.255.0
        gateway 192.0.1.1
this.
But my /etc/network/interfaces looks like this:

Code: Select all

source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
So how do i tell my primary interface to be static if there is no primary interface in /etc/network/interfaces?
Last edited by waldekflipper on 2017-09-19 06:19, edited 1 time in total.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: setting up a static ip

#2 Post by kedaha »

Hi,
What happens if you set up the static IP as advised in the tutorials? Doesn't it work?
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

TonyT
Posts: 575
Joined: 2006-09-04 11:57

Re: setting up a static ip

#3 Post by TonyT »

Your interface is probably not eth0.
See this:
https://wiki.debian.org/NetworkConfigur ... face_Names
then use your adapter name in place of eth0.

waldekflipper
Posts: 2
Joined: 2017-09-17 18:21

Re: setting up a static ip

#4 Post by waldekflipper »

Thanks for the reply's but i just solved my problem.
Because i was using network manager i had to setup a static ip trough network manager.

Post Reply