# static I.P for wireless

## methodtwo

Hello there

I have a router which connects to my modem.Before i switched to wireless i configured my boxen to have a static internal I.P address(the external was still dynamic).this was fine.I have recently switched to wireless and i don't know how to configure it for a static internal I.P address.It's getting a dhcp assigned address from the router.I absolutely don't want to try anything that may stop the wireless from working.However i would like a static internal address because it makes things easier i.e remote printing.Please could someone tell me the complete solution to get this working as i'm still a bit of a gentoo n00b(I've used ubuntu mainly)

Thank you for your time

----------

## methodtwo

By the way i'm using wpa-supplicant for the wireless

Also what's that thing where you can have one interface that takes over when another one fails,automatically you understand.I think it's called something like I.P multipathing or something.Thanks

----------

## dylix

just take a look @ /etc/conf.d/net.example

config_ath0=( "192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255" )

routes_ath0=( "default via 192.168.0.1" )

or whathave you...

----------

## Bones McCracker

On each box, you need to specify a configuration for the wireless interface.  Just like you did this for your wired interface (probably eth0), you do this in the configuration file /etc/conf.d/net.

The various configuration options are described in /etc/conf.d/net.example.  Some extra example detail that is specific to wireless configuration is provided in /etc/conf.d/wireless.example.  Exactly what options you will use will depend on your setup. 

Also, there is a section on wireless networking in the handbook:

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4

----------

## methodtwo

Don't i have to use wlan0 instead of ath0? because when i do:

```

#ifconfig -a

```

the output lists my wireless interface as wlan0

----------

## Inodoro_Pereyra

 *methodtwo wrote:*   

> Don't i have to use wlan0 instead of ath0? because when i do:
> 
> ```
> 
> #ifconfig -a
> ...

 

Exactly.

Cheers!

----------

## d2_racing

It's because you use the driver ath5k  :Razz:  So it's normal  :Razz: 

Static wireless IP, nice  :Razz: 

----------

## methodtwo

I adjusted /etc/conf.d/net accordingly i.e

```

config_wlan0=( "192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255" )

routes_wlan0=( "default via 192.168.0.1" 

```

and then restarted net.wlan0 but it didn't work.Any thoughts?

thankx

----------

## d2_racing

Can you reboot your box instead and post this when your net.wlan0 is started :

```

# ifconfig -a

# iwconfig

# wpa_cli status

```

----------

## Inodoro_Pereyra

Dude, looks like you are trying to use the same setup propossed by dylix above...

What is the ip number of your gateway?

Cheers!

----------

## methodtwo

No i did use my own gateway and I.P address.I just happened to copy and paste from dylix's example.Do you have to re-boot the system entirely? because i merely restarted the interface after editing /etc/conf.d/netThankx for your replies

----------

## dylix

 *methodtwo wrote:*   

> No i did use my own gateway and I.P address.I just happened to copy and paste from dylix's example.Do you have to re-boot the system entirely? because i merely restarted the interface after editing /etc/conf.d/netThankx for your replies

 

/etc/init.d/net.wlan0 restart should be fine..

is it still using dhcp?

also, paste your /etc/conf.d/net file..

----------

## methodtwo

In answer to d2_racing.When i rebooted, with /etc/conf.d/net written for an internal static I.P address, the output of ifconfig -a indicated that the wireless interface had received the static I.P address so did the output of wpa_cli status.Also the output of iwconfig indicated that the wireless interface was recognised.I can't copy and paste the exact output because when i try for the static addy it doesn't work!

Here is the /etc/conf.d/net that i used before i re-booted:

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

config_wlan0=( "192.168.2.105 netmask 255.255.255.0 brd 192.168.2.255" )

routes_wlan0=("default via 192.168.2.1" )

```

As i said i re-booted and it didn't work.And yes i did have eth0 disabled

Thankyou for your time

----------

## cwr

If you ask your router for an address (via DHCP) I think you have to use the

address it gives you, or it gets confused and won't speak to you.  I have a

local setup where the main machine's DHCPD supplies hard-coded addresses

to various other machines (including wireless cards) based on their MAC

addresses.  Can your router be configured to do the same?

Will

----------

