Bobble
Posts: 1
Joined: Thu Feb 13, 2014 1:47 pm

Static IP

Thu Feb 13, 2014 2:32 pm

I have viewed every version of "how to set static ip" on the internet!
None have worked!
HELP
Is there a definitive correct way?

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: Static IP

Thu Feb 13, 2014 3:01 pm

Could you post what you've done? What OS you are using? And your /etc/network/interfaces file?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Static IP

Thu Feb 13, 2014 3:04 pm

Could you paste the contents of your /etc/networking/interfaces file.

Richard S.

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Static IP

Thu Feb 13, 2014 3:45 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Static IP

Thu Feb 13, 2014 3:50 pm

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
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: Static IP

Thu Feb 13, 2014 3:51 pm

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.

Return to “General discussion”