LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Network configuration files: where to write the static ip? (https://www.linuxquestions.org/questions/ubuntu-63/network-configuration-files-where-to-write-the-static-ip-315175/)

zvonSully 04-20-2005 01:49 AM

Network configuration files: where to write the static ip?
 
My internet provider gave me my static IP;netmask,gateway,dns1 and dns2 .
Before Ubuntu i had Debian and it asked me at instal for those,but ubuntu hasn't(it set my internet thro DHCP).I conected to internet by eth0 by a cable modem.

So i need the file(s) where to put those:

-IP
-netmask
-gateway
-DNS1
-DNS2

Goala 04-20-2005 02:35 AM

Hi, supposing you have only one network card (eth0):

1º) ifdown eth0

2º) edit the /etc/network/interfaces file.
Code:

    iface eth0 inet static
            address your_static_ip
            netmask your_netmask
            gateway your_gateway_ip

3º) DNS:

edit /etc/resolv.conf , add/insert these lines:
Code:

nameserver dns1_ip
nameserver dns2_ip

4º) ifup eth0

zvonSully 04-20-2005 03:11 AM

Not working :(; I have ust one network card

these is what it says:
# ifup eth0
Don't seem to be have all the variables for eth0/inet.
Failed to bring up eth0.

I write here
the contents of /etc/network/interfaces:

# 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

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
#mapping hotplug
# script grep
# map eth0

# The primary network interface
iface eth0 inet static
adress <here is the ip>
netmask 255.255.255.0
gateway <here is the gateway>

#auto eth0

the contents of /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 217.156.101.1
nameserver 217.156.101.10

Goala 04-20-2005 03:23 AM

I've seen (seeing the /etc/resolv.conf file) you have installed the "resolvconf" package. So, update your /etc/network/interfaces file this way, because resolvconf will overwrite your /etc/resolv.conf with the information you'll provide with the dns-nameservers section here:
Code:

    iface eth0 inet static
            address your_static_ip
            netmask your_netmask
            gateway your_gateway_ip
            dns-nameservers your_dns1_ip your_dns2_ip

in your /etc/network/interfaces you have the string "adress" and it should be "address", be aware of that!


All times are GMT -5. The time now is 01:16 AM.