diff --git a/src/bin/network/ifconfig/ifconfig.cpp b/src/bin/network/ifconfig/ifconfig.cpp
index 6ae74eb..f719b2f 100644
--- a/src/bin/network/ifconfig/ifconfig.cpp
+++ b/src/bin/network/ifconfig/ifconfig.cpp
@@ -17,13 +17,21 @@
 #include <net/if_media.h>
 #include <net/if_types.h>
 #include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <sys/kernel.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>
+#include <sys/types.h>
 
+#include <net80211/ieee80211_ioctl.h>
+#include <net80211/ieee80211_haiku.h>
+
+#include <ctype>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 
 #include <NetServer.h>
@@ -170,6 +178,140 @@ media_parse_subtype(const char* string, int media, int* type)
 	return false;
 }
 
+static const char* 
+get_string(const char* val, const char* sep, u_int8_t* buf, int* lenp)
+{
+        int             len;
+        int             hexstr;
+        u_int8_t* p;
+
+        len = *lenp;
+        p = buf;
+        hexstr = (val[0] == '0' && tolower((u_char) val[1]) == 'x');
+        if (hexstr)
+                val += 2;
+        for (;;) {
+                if (*val == '\0')
+                        break;
+                if (sep != NULL && strchr(sep, *val) != NULL) {
+                        val++;
+                        break;
+                }
+                if (hexstr) {
+                        if (!isxdigit((u_char) val[0])) {
+                                printf("%s: bad hexadecimal digits", __func__);
+                                return NULL;
+                        }
+                        if (!isxdigit((u_char) val[1])) {
+                                printf("%s: odd count hexadecimal digits",
+                                __func__);
+                                return NULL;
+                        }
+                }
+                if (p >= buf + len) {
+                        if (hexstr)
+                                printf("%s: hexadecimal digits too long",
+                                __func__);
+                        else
+                                printf("string too long", __func__);
+                        return NULL;
+                }
+                if (hexstr) {
+#define tohex(x) (isdigit(x) ? (x) - '0' : tolower(x) - 'a' + 10)
+                        *p++ = (tohex((u_char) val[0]) << 4)
+                                | tohex((u_char) val[1]);
+#undef tohex
+                        val += 2;
+                } else
+                        *p++ = *val++;
+        }
+        len = p - buf;
+        /* The string "-" is treated as the empty string. */
+        if (!hexstr && len == 1 && buf[0] == '-') {
+                len = 0;
+                memset(buf, 0, *lenp);
+        } else if (len < *lenp)
+                memset(p, 0, *lenp - len);
+        *lenp = len;
+        return val;
+}
+
+
+static void
+set80211(int s, const char* dev, int type, int val, int len, void* data)
+{
+        struct ieee80211req ireq;
+
+        (void)memset(&ireq, 0, sizeof(ireq));
+        (void)strncpy(ireq.i_name, dev, sizeof(ireq.i_name));
+        ireq.i_type = type;
+        ireq.i_val = val;
+        ireq.i_len = len;
+        ireq.i_data = data;
+        if (ioctl(s, SIOCS80211, &ireq, sizeof(struct ieee80211req)) < 0)
+                printf("%s: error in handling SIOCS80211\n", __func__);
+}
+
+
+static void
+set80211ssid(const char* dev, const char* val, int s)
+{
+        int             ssid;
+        int             len;
+        u_int8_t        data[IEEE80211_NWID_LEN];
+
+        ssid = 0;
+        len = strlen(val);
+        if (len > 2 && isdigit((int)val[0]) && val[1] == ':') {
+                ssid = atoi(val) - 1;
+                val += 2;
+        }
+        bzero(data, sizeof(data));
+        len = sizeof(data);
+        if (get_string(val, NULL, data, &len) == NULL)
+                exit(1);
+
+        set80211(s, dev, IEEE80211_IOC_SSID, ssid, len, data);
+}
+
+
+static void
+set80211nwkey(const char* dev, const char* val, int s)
+{
+        int             txkey;
+        int             i, len;
+        u_int8_t        data[IEEE80211_KEYBUF_SIZE];
+
+        set80211(s, dev, IEEE80211_IOC_WEP, IEEE80211_WEP_ON, 0, NULL);
+
+        if (isdigit((int)val[0]) && val[1] == ':') {
+                txkey = val[0] - '0' - 1;
+                val += 2;
+
+                for (i = 0; i < 4; i++) {
+                        bzero(data, sizeof(data));
+                        len = sizeof(data);
+                        val = get_string(val, ",", data, &len);
+                        if (val == NULL)
+                                exit(1);
+
+                        set80211(s, dev, IEEE80211_IOC_WEPKEY, i, len, data);
+                }
+        } else {
+                bzero(data, sizeof(data));
+                len = sizeof(data);
+                get_string(val, NULL, data, &len);
+                txkey = 0;
+
+                set80211(s, dev, IEEE80211_IOC_WEPKEY, 0, len, data);
+
+                bzero(data, sizeof(data));
+                for (i = 1; i < 4; i++)
+                        set80211(s, dev, IEEE80211_IOC_WEPKEY, i, 0, data);
+        }
+
+        set80211(s, dev, IEEE80211_IOC_WEPTXKEY, txkey, 0, NULL);
+}
 
 //	#pragma mark -
 
@@ -509,8 +651,10 @@ configure_interface(int socket, const char* name, char* const* args,
 
 	bool hasAddress = false, hasMask = false, hasPeer = false;
 	bool hasBroadcast = false, doAutoConfig = false;
+	bool hasSsid = false, hasWepkey = false;
 	struct sockaddr address, mask, peer, broadcast;
 	int mtu = -1, metric = -1, media = -1;
+	char *ssid, *wepkey;
 	int addFlags = 0, currentFlags = 0, removeFlags = 0;
 
 	// try to parse address family
@@ -631,6 +775,22 @@ configure_interface(int socket, const char* name, char* const* args,
 				exit(1);
 			}
 			i++;
+		} else if (!strcmp(args[i], "ssid")) {
+			if (i + 1 >= argCount) {
+				fprintf(stderr, "%s: Option 'ssid expected paramater\n",
+						kProgramName);
+				exit(1);
+			}
+			hasSsid = true;
+			ssid = args[i + 1];
+		} else if (!stcmp(args[i], "wepkey")) {
+			if (i + 1 >= argCount) {
+				fprintf(stderr, "%s: Option 'ssid expected paramater\n",
+						kProgramName);
+				exit(1);
+			}
+			hasWepkey = true;
+			wepkey = args[i + 1];
 		} else if (!strcmp(args[i], "up") || !strcmp(args[i], "-down")) {
 			addFlags |= IFF_UP;
 		} else if (!strcmp(args[i], "down") || !strcmp(args[i], "-up")) {
@@ -755,6 +915,14 @@ configure_interface(int socket, const char* name, char* const* args,
 		}
 	}
 
+	if (hasSsid) {
+		set80211ssid(name, ssid, socket);
+	}
+
+	if (hasWepkey) {
+		set80211nwkey(name, wepkey, socket);
+	}
+
 	// start auto configuration, if asked for
 
 	if (doAutoConfig) {
