Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Static ip with wpa_supplicant

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
elmar283
Guru
Guru
Posts: 316
Joined: Mon Dec 06, 2004 10:57 pm
Location: Haarlem, Netherlands
Contact:
Contact elmar283
Website

Static ip with wpa_supplicant

  • Quote

Post by elmar283 » Wed Aug 17, 2011 11:26 am

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: Select all

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: Select all

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: Select all

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 ~ $ 
Top
gerdesj
l33t
l33t
User avatar
Posts: 622
Joined: Thu Sep 29, 2005 1:44 pm
Location: Yeovil, Somerset, UK
Contact:
Contact gerdesj
Website

Re: Static ip with wpa_supplicant

  • Quote

Post by gerdesj » Thu Aug 25, 2011 12:02 am

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
Top
elmar283
Guru
Guru
Posts: 316
Joined: Mon Dec 06, 2004 10:57 pm
Location: Haarlem, Netherlands
Contact:
Contact elmar283
Website

  • Quote

Post by elmar283 » Thu Aug 25, 2011 6:36 am

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.
Top
swimmer
Veteran
Veteran
User avatar
Posts: 1330
Joined: Mon Jul 15, 2002 10:42 am
Location: Netherlands

  • Quote

Post by swimmer » Sun Aug 28, 2011 9:49 am

Did you also try

Code: Select all

config_Earth
instead of

Code: Select all

config_Earth_eth1
?

Works for me ... ;-)

HTH
swimmer
Top
elmar283
Guru
Guru
Posts: 316
Joined: Mon Dec 06, 2004 10:57 pm
Location: Haarlem, Netherlands
Contact:
Contact elmar283
Website

Static ip with wpa_supplicant

  • Quote

Post by elmar283 » Sun Aug 28, 2011 10:49 am

This is a follow-up from: http://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
Top
swimmer
Veteran
Veteran
User avatar
Posts: 1330
Joined: Mon Jul 15, 2002 10:42 am
Location: Netherlands

Re: Static ip with wpa_supplicant

  • Quote

Post by swimmer » Sun Aug 28, 2011 11:28 am

elmar283 wrote:This is a follow-up from: http://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: Select all

### 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: Select all

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
Top
morb77
n00b
n00b
Posts: 2
Joined: Sat Sep 26, 2009 9:12 am

Configuration from swimmer works

  • Quote

Post by morb77 » Sat Nov 05, 2011 7:22 pm

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!
Top
swimmer
Veteran
Veteran
User avatar
Posts: 1330
Joined: Mon Jul 15, 2002 10:42 am
Location: Netherlands

  • Quote

Post by swimmer » Sun Nov 06, 2011 11:56 pm

Glad I could help :) Doesn't happen that often ;-)
Top
majoron
Apprentice
Apprentice
User avatar
Posts: 243
Joined: Wed Oct 12, 2005 2:02 pm
Location: Frankfurt

  • Quote

Post by majoron » Sat Oct 27, 2012 10:53 am

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
Top
Post Reply

9 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic