Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Static ip with wpa_supplicant
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
elmar283
Guru
Guru


Joined: 06 Dec 2004
Posts: 316
Location: Haarlem, Netherlands

PostPosted: Wed Aug 17, 2011 11:26 am    Post subject: Static ip with wpa_supplicant Reply with quote

I'm trying to get a static ip-address with wpa_supplicant. I used to have this, but somehow it is not working anymore. I can't findout what the reason is.
I have set up my computer up as a router.
eth0
Is the insite network:
address 192.168.0.1 uses a static ip-address

eht1
Is my outsite netork. It used to have a static addres, now it's only working with dhcpcd.
address 192.168.178.28 now uses dhcp.

If it might not be possible to have a static addres with wpa_supplicant I would like that /etc/resolv.conf isn't alterted.
I tried to do this by setting dhcp_eth1="nodns" but it didn't work.

Can anyone tell me how to make wpa_supplicant work with a static addres or option B to make nodns possible?

I will post some config files here:
Code:

elmarotter@masterserver ~ $ cat /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

dns_domain_lo="eotter1979.xs4all.nl"

config_eth0="192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255"
#routes_eth0="default via 192.168.0.1"
dns_servers_eth0="192.168.0.1"
associate_timeout_eth0=60

gateways_eth1="192.168.178.1"
modules="wpa_supplicant"
wpa_supplicant_eth1="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"
wpa_timeout_eth1=60
associate_timeout_eth1=60
config_Earth_eth1="192.168.178.28 netmask 255.255.255.0 brd 192.168.178.255"
dns_servers_Earth_eth1="192.168.0.1"
routes_Earth_eth1="default via 192.168.0.1"
dhcp_Earth_eth1="release nodns"
#config_routes_eth1="192.168.178.28/24 netmask 255.255.255.0 brd 192.168.178.255"
#dns_servers_routes_eth1="192.168.0.1"
#routes_routes_eth1="default via 192.168.0.1"

fallback_eth1="dhcp"
iwconfig_eth1="mode managed"


Code:

elmarotter@masterserver ~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
Wachtwoord:
# The below line not be changed otherwise we refuse to work
update_config=1
ctrl_interface_group=0
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
country=nl_NL

network={
  ssid="Earth"
  proto=WPA
  key_mgmt=WPA-PSK
  pairwise=CCMP TKIP
  group=CCMP TKIP
  psk="*********************"
  priority=5
}


Code:

elmarotter@masterserver ~ $ sudo rc-update
                acpid | battery      default                 
              amavisd |              default                 
              apache2 | battery      default                 
         avahi-daemon | battery      default                 
             bootmisc |         boot                         
                clamd |              default                 
        courier-imapd |              default                 
    courier-imapd-ssl |              default                 
    courier-pop3d-ssl |              default                 
                cupsd | battery      default                 
                 dbus | battery      default                 
                devfs |                               sysinit
               dhcpcd |              default                 
                dhcpd |              default                 
                dmesg |                               sysinit
                 fsck |         boot                         
             hostname |         boot                         
              hwclock |         boot                         
             iptables | battery      default                 
              keymaps |         boot                         
            killprocs |                      shutdown       
                local | battery      default                 
           localmount |         boot                         
              mailman |              default                 
              modules |         boot                         
             mount-ro |                      shutdown       
                 mtab |         boot                         
                mysql | battery      default                 
                named |              default                 
             net.eth0 | battery      default                 
             net.eth1 | battery      default                 
               net.lo |         boot                         
             netmount | battery      default                 
           ntp-client | battery      default                 
                 ntpd | battery      default                 
              postfix |              default                 
             postgrey |              default                 
               procfs |         boot                         
            pure-ftpd | battery      default                 
                 root |         boot                         
                samba | battery      default                 
            saslauthd |              default                 
            savecache |                      shutdown       
                squid | battery      default                 
                 sshd | battery      default                 
                 swap |         boot                         
               sysctl |         boot                         
            syslog-ng | battery      default                 
         termencoding |         boot                         
                 udev |                               sysinit
       udev-postmount | battery      default                 
              urandom |         boot                         
           vixie-cron | battery      default                 
elmarotter@masterserver ~ $
Back to top
View user's profile Send private message
gerdesj
l33t
l33t


Joined: 29 Sep 2005
Posts: 621
Location: Yeovil, Somerset, UK

PostPosted: Thu Aug 25, 2011 12:02 am    Post subject: Re: Static ip with wpa_supplicant Reply with quote

I've been doing this for ages. The only config needed for this is in /etc/conf.d/net.

You seem to have eth0 and eth1. Which is your WiFi interface? I think eth1 but your description is a bit confused.

In wpa_supplicant you set keys etc but the IP address (DHCP) is only set in conf.d/net

Cheers
Jon
Back to top
View user's profile Send private message
elmar283
Guru
Guru


Joined: 06 Dec 2004
Posts: 316
Location: Haarlem, Netherlands

PostPosted: Thu Aug 25, 2011 6:36 am    Post subject: Reply with quote

eth1 is my wifi.

I tried static ip in /etc/conf.d/net
But I do not get an ip when I try that. And I don't want to use DHCP.
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Sun Aug 28, 2011 9:49 am    Post subject: Reply with quote

Did you also try
Code:
config_Earth
instead of
Code:
config_Earth_eth1
?

Works for me ... ;-)

HTH
swimmer
Back to top
View user's profile Send private message
elmar283
Guru
Guru


Joined: 06 Dec 2004
Posts: 316
Location: Haarlem, Netherlands

PostPosted: Sun Aug 28, 2011 10:49 am    Post subject: Static ip with wpa_supplicant Reply with quote

This is a follow-up from: https://forums.gentoo.org/viewtopic-t-890978.html

I can't seem to reply to that forum thread anymore. Sorry if this is not the way to do this.

config_Earth did not work.
swimmer: could you send me your config of /etc/conf.d/net and /etc/wpa_supplicant/wpa_supplicant.conf?

Merged by NeddySeagoon as OP was having problems with Replies
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Sun Aug 28, 2011 11:28 am    Post subject: Re: Static ip with wpa_supplicant Reply with quote

elmar283 wrote:
This is a follow-up from: https://forums.gentoo.org/viewtopic-t-890978.html

I can't seem to reply to that forum thread anymore. Sorry if this is not the way to do this.

config_Earth did not work.
swimmer: could you send me your config of /etc/conf.d/net and /etc/wpa_supplicant/wpa_supplicant.conf?

Merged by NeddySeagoon as OP was having problems with Replies


Sure 8-)

/etc/conf.d/net
Code:

### WIRED ###
config_eth0="dhcp"

### WIRELESS ###
modules_wlan0="wpa_supplicant"
wpa_supplicant_wlan0="-Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf"

## Thuis
config_<my_essid>="192.168.1.15/24"
routes_<my_essid>="default via 192.168.1.1"
dns_servers_<my_essid>="192.168.1.1"
dns_domain_<my_essid>="xmsnet.nl"

/etc/wpa_supplicant/wpa_supplicant.conf
Code:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1

network={
        ssid="<my_essid>"
        psk="<my_password>"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        group=CCMP TKIP
}


HTH
swimmer
Back to top
View user's profile Send private message
morb77
n00b
n00b


Joined: 26 Sep 2009
Posts: 2

PostPosted: Sat Nov 05, 2011 7:22 pm    Post subject: Configuration from swimmer works Reply with quote

swimmer: thank you, sir!

That example of yours helped to fix same issue in my environments. Indeed, it is documented in the example file, but I did not think it must be followed exactly. You simply showed us path!
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Sun Nov 06, 2011 11:56 pm    Post subject: Reply with quote

Glad I could help :) Doesn't happen that often ;-)
Back to top
View user's profile Send private message
majoron
Apprentice
Apprentice


Joined: 12 Oct 2005
Posts: 239
Location: Frankfurt

PostPosted: Sat Oct 27, 2012 10:53 am    Post subject: Reply with quote

Thank you too, swimmer. I was trying to get a solution for the same problem, and somehow I managed to skip the instrucctions in "net.example" until now.

Regards
_________________
Computers are like air conditioners, they stop working properly if you open Windows
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum