Page 1 of 1

Static IP

Posted: Thu Feb 13, 2014 2:32 pm
by Bobble
I have viewed every version of "how to set static ip" on the internet!
None have worked!
HELP
Is there a definitive correct way?

Re: Static IP

Posted: Thu Feb 13, 2014 3:01 pm
by allfox
Could you post what you've done? What OS you are using? And your /etc/network/interfaces file?

Re: Static IP

Posted: Thu Feb 13, 2014 3:04 pm
by redhawk
Could you paste the contents of your /etc/networking/interfaces file.

Richard S.

Re: Static IP

Posted: Thu Feb 13, 2014 3:45 pm
by DougieLawson
Bobble wrote:I have viewed every version of "how to set static ip" on the internet!
None have worked!
HELP
Is there a definitive correct way?
sudo ifconfig eth0 192.168.99.100
sudo ifconfig eth0 up
or
sudo ip address add 192.168.99.100 dev eth0

The various network managers make it easy to get that to happen automatically.

Re: Static IP

Posted: Thu Feb 13, 2014 3:50 pm
by Richard-TX
Here is the interfaces file that I use. Works every time.


edit as needed.

Code: Select all

    auto lo

    iface lo inet loopback
    iface eth0 inet static
    address 10.232.1.81
    netmask 255.255.255.0
    gateway 10.232.1.1


    auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet static
    address 10.232.1.99
    netmask 255.255.255.0
    gateway 10.232.1.1
    wpa-passphrase password
    wpa-ssid myssid

Re: Static IP

Posted: Thu Feb 13, 2014 3:51 pm
by plugwash
Bobble wrote:I have viewed every version of "how to set static ip" on the internet!
None have worked!
HELP
Is there a definitive correct way?
The correct way depends on the distro and what software is being used to manage the interface in question. Please tell us what you are running so we can point you to correct advice.
sudo ifconfig eth0 192.168.99.100
sudo ifconfig eth0 up
or
sudo ip address add 192.168.99.100 dev eth0
This will only work for the current session. It's affects will go away on next boot.