LinuxQuestions.org
Help answer threads with 0 replies.
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 01-20-2012, 11:09 AM   #1
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134
/etc/network/interfaces for static wifi


I seem to be having issues setting up the /etc/network/interfaces file for a static IP on my wifi card (WEP). I imagine it's a dumb error, but I haven't been able to find it yet. This is on an embedded linux (Debian-ish) system, eth0 is wired, eth1 is wireless.

/etc/network/interfaces:
Code:
auto lo
iface lo inet loopback

auto eth1
iface eth1 inet static
   post-up /sbin/iwconfig $IFACE mode managed essid "SMURF" key ##########
   address 192.168.1.141
   netmask 255.255.255.0
   gateway 192.168.1.1
When the machine boots, ifconfig shows the inet address and mask correctly, but there is no network access, as if it's not connected to the wireless.

Running the following by hand works fine:
Code:
ifconfig eth1 up
iwconfig eth1 mode managed essid "SMURF" key ##########
ifconfig eth1 192.168.1.141 netmask 255.255.255.0
So where am I going wrong?
 
Old 01-20-2012, 11:16 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Original Poster
Rep: Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134
The following might be of some use:

Code:
# ifdown eth1
# ifup eth1
Config_FileOperation file Not exist
Zone=[2][E][U]!!
# ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:12:7B:53:2B:20
          inet addr:192.168.1.141  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1196 (1.1 KiB)

# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes

--- 192.168.1.1 ping statistics ---
6 packets transmitted, 0 packets received, 100% packet loss
# iwconfig eth1 mode managed essid "SMURF" key ##########
# AP(BSS) finding:Found a AP(BSS)..
802.11 Authen (OPEN) Successful.
Association Successful, AID=4.
Link with AP(SSID): SMURF

# ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:12:7B:53:2B:20
          inet addr:192.168.1.141  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:510 (510.0 B)  TX bytes:2346 (2.2 KiB)

# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=3.811 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=3.317 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=3.382 ms
64 bytes from 192.168.1.1: seq=3 ttl=64 time=3.411 ms

--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 3.317/3.480/3.811 ms
#
(Note: essid name and key have been changed for protection)
 
Old 01-20-2012, 03:17 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Original Poster
Rep: Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134Reputation: 2134
Fixed it, looks like for some reason you have to use "up" instead of "post-up":
http://glomation.net/smf/index.php?topic=76.0;wap2

Odd, but fixed, everything works as expected now

/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

auto eth1
iface eth1 inet static
   up /sbin/iwconfig $IFACE mode managed essid "SMURF" key ##########
   address 192.168.1.141
   netmask 255.255.255.0
   gateway 192.168.1.1
 
Old 06-29-2012, 06:48 PM   #4
whysoserious
Member
 
Registered: May 2012
Location: London
Distribution: Debian and slackware for uni
Posts: 61

Rep: Reputation: Disabled
You asked then answered your own post. Legend lol. Haha
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
configuring static IP: questions about /etc/network/interfaces sneakyimp Linux - Server 3 02-18-2011 10:03 AM
[SOLVED] /etc/network/interfaces configuration for virtual interfaces nonshatter Linux - Networking 4 10-25-2010 06:22 AM
Static IP works from ifconfig but not /etc/network/interfaces neilneil2000 Linux - Networking 4 06-03-2008 02:44 PM
interfaces + wifi alaios Linux - Wireless Networking 1 09-26-2005 04:17 PM
making WiFi settings in /etc/network/interfaces permanent Lleb_KCir Linux - General 3 05-10-2005 11:22 PM

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

All times are GMT -5. The time now is 12:46 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration