LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-19-2014, 12:16 PM   #1
blueSn0w
LQ Newbie
 
Registered: Aug 2014
Distribution: Linux mint
Posts: 2

Rep: Reputation: Disabled
how does /etc/network/interfaces actually work? information maybe missing in man page


Hi LQ users, this is my first post here so if i am posting this in a wrong way please tell me .

To the problem.
I was trying to learn how to connect to a wpa2 secured network without the GUI network manager. So i followed a tutorial (sadly i do not remember where it was) and it told me how to configure the /etc/wpa_supplicant.conf and /etc/network/interfaces files in order to connect to wifi.

according to interfaces man page there are no options to write in the "iface wathever manual" stanza. But i have two lines there defining that (i supose) wpa_supplicant will use.

My question is: As interfaces manpage does not show these options, where do i find how it works, what program is actually reading this file (i suposed ifup, but ifup:s manpage does not explain how these options are used either.)
Is it ifup that starts up the interface at startup and sends the options to wpa_suplicant?

This is my interface file:
Code:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth1
iface eth1 inet manual
        wpa-driver nl80211  <- this line is explained nowere
        wpa-roam /etc/wpa_supplicant.conf <- or this

iface hallo inet dhcp
... and this is my wpa_supplicant.conf file:
Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=netdev
update_config=1

network={
        ssid="hallo"
        #psk="mypassword"
        psk=somecode i suppose is secret
        id_str="hallo"
}
I supose i could have found how this works somewhere. But i searched and didnt really find how it works. Is there any "official" page that does actually explain how these commands work?

If it is important: my distro is linux mint KDE and i dont have any gui network manager running
 
Old 08-19-2014, 12:30 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Welcome to LQ!

I've not done this with /etc/network/interfaces but instead written a script and left any semblence of my wireless device out of the interfaces file.

The gist of my script:
Code:
# $ESSID and $PSK were passing arguments to my script
# ESSID is the SSID of the WIFI
# PSK is the shared secret for WPA
# $IFACE is my wireless interface which is typically wpa0 for my case

/sbin/start-stop-daemon -K -x /sbin/wpa_supplicant;
/usr/bin/wpa_passphrase $ESSID $PSK > $HOME/wpa.conf;
/sbin/wpa_supplicant -B -Dwext -i$IFACE -c$HOME/wpa.conf;

# Then beyond this I'd either have a static IP
# or I'd obtain one via dhclient
# Static IP:

ifconfig $IFACE $IP_ADDR
route add default gw $GATEWAY

# DHCP:

dhclient $IFACE
How I got there was web searching and trial/error with my system until I got a reliable way to get it working. So perhaps things are different on your system, but here's hoping that some of these suggestions help.

Last edited by rtmistler; 08-19-2014 at 12:32 PM.
 
1 members found this post helpful.
Old 08-19-2014, 01:17 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
it pays to look at the age of the tutorials one is following, and if they're suitable for or targeted at your distro.

also, if you want to go the (semi-)manual way, you might have to actually uninstall or at least thoroughly disable networkmanager, which digs its greedy claws deep into your system.
 
Old 08-19-2014, 01:42 PM   #4
blueSn0w
LQ Newbie
 
Registered: Aug 2014
Distribution: Linux mint
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you very much for your quick responses!
I am really sorry that i didnt specify that my setup was actually working quite well for me.
And yes i did remove the networkmanager that was installed before.
Thank you rtmistler for your script! I think i will try to understand it and then use it, as i wasn't really understanding what was going on in the background with my previous setup.

PS. why have you used ; signs at the end of the first lines in your script?
 
Old 08-19-2014, 01:54 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by blueSn0w View Post
PS. why have you used ; signs at the end of the first lines in your script?
That's mainly due to my scripting style. The semicolon means that this is the end of a command, and hence someone could write a script line as:
Code:
ls;ls -a;
Placing it all on the same physical line. I tend to still use the semicolon at the end of commands; however you can avoid that if your commands are all on separate lines.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve information about the network interfaces? dnyanfor Linux - Newbie 3 11-02-2013 03:05 AM
man page is not found although $MANPATH and man.conf changed Abbraxas Linux - Newbie 3 09-05-2011 06:40 PM
manual page for X is missing (man X) ? Vilius Red Hat 8 09-11-2010 06:24 AM
pthread_sigmask man-page missing. dlinux Slackware 1 07-07-2009 10:19 AM
Where to get Linux Network Programming Interfaces information... microtrance Programming 1 11-10-2003 08:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration