Wifi Static Ip


5 posts
by omiez » Wed Oct 31, 2012 4:59 am
Hello i want to setup Static Ip for my Wifi on Rpi.

Assuming that my Router is 192.168.1.1 how must i configure the rest of the network interface.

iface wlan0 inet static
address 192.168.1.xxx
netmask 255.255.255.0
network 192.168.1.0 ??????
broadcast 192.168.1.255 ??????
gateway 192.168.1.1

I am wondering about network and broadcast. How can i figure out if this are the right values for me?

Thank you
Nr.1 Raspberry Pi Mod.B Rev.2 256Mb Ram (Raspbian)

Raspberry Pi Mod.B Rev.2 512Mb Ram (Maybe i´ll get one)
Posts: 134
Joined: Sun Sep 30, 2012 10:10 pm
Location: Brasil
by SirLagz » Wed Oct 31, 2012 5:05 am
You don't *need* network and broadcast so you can leave them out.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Posts: 1704
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
by bgirardot » Wed Oct 31, 2012 6:31 am
For what it is worth:

You calculate those values usually based on your ip address and netmask.

You can find tcp/ip calculators on the internet, for example here is one: http://www.subnetmask.info/

Putting in your ip address and netmask in the second calculator on that page confirms the values you have are correct.
Posts: 517
Joined: Wed Oct 10, 2012 6:20 am
Location: Switzerland
by lusorio » Fri Jan 11, 2013 5:35 pm
Actually your netmask (255.255.255.0) means that all the bits in the three first bytes of the address are designed for the network address (Type C) and the last byte for machines addresses.

So if your IP address is
| 192.168.1.69
| 255.255.255.0

192.168.1 are the network and
69 is your machine.

256 machines can be attached to that network range except that:

the first available address of the network (0) so 192.168.1.0 is reserved for the network itself and
the last available (255) value is the broadcast address (for sending packages to all the machines on the network)

So finally you can have 254 different addresses.

If your network mask is 255.255.0.0 i.e, means that only 192.168 are designed for the network and the other two bytes for the machines' addresses.

Hope it helps.
Posts: 3
Joined: Thu Dec 27, 2012 3:29 pm
Location: Nice, France
by gragib » Fri Jan 11, 2013 10:38 pm
What router do you have? You should be able to log in to the router and assign a static IP for the MAC address of your WiFi adapter. Nothing needs to be done on the Raspberry Pi.
Posts: 99
Joined: Sat Dec 22, 2012 8:09 pm
Location: Calgary, AB, Canada