Index: freebsd-userspace/commands/sbin/ifconfig/af_inet6.c
===================================================================
--- freebsd-userspace/commands/sbin/ifconfig/af_inet6.c	(revision 82e1c695b61f4fd0f57d1c2ce0819fb1e75579ec)
+++ freebsd-userspace/commands/sbin/ifconfig/af_inet6.c	(revision 44ffbd53c6b956ef12d2e530d04ec5b530c2b161)
@@ -541,5 +541,9 @@
 	ip6lifetime++;	/* print IPv6 address lifetime */
 }
+#ifdef __rtems__
+static struct ifconfig_option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lopt_cb };
+#else
 static struct option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lopt_cb };
+#endif
 
 static __constructor void
Index: freebsd-userspace/commands/sbin/ifconfig/ifclone.c
===================================================================
--- freebsd-userspace/commands/sbin/ifconfig/ifclone.c	(revision 82e1c695b61f4fd0f57d1c2ce0819fb1e75579ec)
+++ freebsd-userspace/commands/sbin/ifconfig/ifclone.c	(revision 44ffbd53c6b956ef12d2e530d04ec5b530c2b161)
@@ -184,5 +184,9 @@
 	exit(0);
 }
+#ifdef __rtems__
+static struct ifconfig_option clone_Copt = { .opt = "C", .opt_usage = "[-C]", .cb = clone_Copt_cb };
+#else
 static struct option clone_Copt = { .opt = "C", .opt_usage = "[-C]", .cb = clone_Copt_cb };
+#endif
 
 static __constructor void
Index: freebsd-userspace/commands/sbin/ifconfig/ifconfig.c
===================================================================
--- freebsd-userspace/commands/sbin/ifconfig/ifconfig.c	(revision 82e1c695b61f4fd0f57d1c2ce0819fb1e75579ec)
+++ freebsd-userspace/commands/sbin/ifconfig/ifconfig.c	(revision 44ffbd53c6b956ef12d2e530d04ec5b530c2b161)
@@ -1,2 +1,6 @@
+#ifdef __rtems__
+#define __need_getopt_newlib
+#include <getopt.h>
+#endif
 /*
  * Copyright (c) 1983, 1993
@@ -124,4 +128,14 @@
 static void af_other_status(int);
 
+#ifdef __rtems__
+static struct ifconfig_option *opts = NULL;
+
+void
+opt_register(struct ifconfig_option *p)
+{
+	p->next = opts;
+	opts = p;
+}
+#else
 static struct option *opts = NULL;
 
@@ -132,4 +146,5 @@
 	opts = p;
 }
+#endif
 
 static void
@@ -137,5 +152,9 @@
 {
 	char options[1024];
+	#ifdef __rtems__
+	struct ifconfig_option *p;
+	#else
 	struct option *p;
+	#endif
 
 	/* XXX not right but close enough for now */
@@ -173,6 +192,13 @@
 	char options[1024], *cp;
 	const char *ifname;
+#ifdef __rtems__
+	struct ifconfig_option *p;
+#else
 	struct option *p;
+#endif
 	size_t iflen;
+#ifdef __rtems__
+	struct getopt_data getopt_reent;
+#endif
 
 	all = downonly = uponly = namesonly = noload = verbose = 0;
@@ -182,5 +208,10 @@
 	for (p = opts; p != NULL; p = p->next)
 		strlcat(options, p->opt, sizeof(options));
+#ifdef __rtems__
+	memset(&getopt_reent, 0, sizeof(getopt_data));
+	while ((c = getopt_r(argc, argv, options, &getopt_reent)) != -1) {
+#else
 	while ((c = getopt(argc, argv, options)) != -1) {
+#endif
 		switch (c) {
 		case 'a':	/* scan all interfaces */
@@ -673,6 +704,6 @@
 
 	memcpy(&my_ifr, &ifr, sizeof(my_ifr));
+#ifndef __rtems__
 	my_ifr.ifr_jid = jail_getid(jname);
-#ifndef __rtems__
 	if (my_ifr.ifr_jid < 0)
 		errx(1, "%s", jail_errmsg);
@@ -689,6 +720,6 @@
 
 	memcpy(&my_ifr, &ifr, sizeof(my_ifr));
+#ifndef __rtems__
 	my_ifr.ifr_jid = jail_getid(jname);
-#ifndef __rtems__
 	if (my_ifr.ifr_jid < 0)
 		errx(1, "%s", jail_errmsg);
@@ -1062,4 +1093,5 @@
 ifmaybeload(const char *name)
 {
+#ifndef __rtems__
 #define MOD_PREFIX_LEN		3	/* "if_" */
 	struct module_stat mstat;
@@ -1108,4 +1140,5 @@
 	/* not present, we should try to load it */
 	kldload(ifkind);
+#endif
 }
 
@@ -1189,2 +1222,15 @@
 #undef N
 }
+
+#ifdef __rtems__
+  #include <rtems/shell.h>
+
+  rtems_shell_cmd_t rtems_shell_IFCONFIG_Command = {
+    "ifconfig",                    /* name */
+    "ifconfig [args]",             /* usage */
+    "net",                         /* topic */
+    main_ifconfig,                 /* command */
+    NULL,                          /* alias */
+    NULL                           /* next */
+  };
+#endif
Index: freebsd-userspace/commands/sbin/ifconfig/ifconfig.h
===================================================================
--- freebsd-userspace/commands/sbin/ifconfig/ifconfig.h	(revision 82e1c695b61f4fd0f57d1c2ce0819fb1e75579ec)
+++ freebsd-userspace/commands/sbin/ifconfig/ifconfig.h	(revision 44ffbd53c6b956ef12d2e530d04ec5b530c2b161)
@@ -122,11 +122,23 @@
 void	af_register(struct afswtch *);
 
+#ifdef __rtems__
+struct ifconfig_option {
+#else
 struct option {
+#endif
 	const char *opt;
 	const char *opt_usage;
 	void	(*cb)(const char *arg);
+	#ifdef __rtems__
+	struct ifconfig_option *next;
+	#else
 	struct option *next;
+	#endif
 };
+#ifdef __rtems__
+void	opt_register(struct ifconfig_option *);
+#else
 void	opt_register(struct option *);
+#endif
 
 extern	struct ifreq ifr;
Index: freebsd-userspace/commands/sbin/ifconfig/ifgroup.c
===================================================================
--- freebsd-userspace/commands/sbin/ifconfig/ifgroup.c	(revision 82e1c695b61f4fd0f57d1c2ce0819fb1e75579ec)
+++ freebsd-userspace/commands/sbin/ifconfig/ifgroup.c	(revision 44ffbd53c6b956ef12d2e530d04ec5b530c2b161)
@@ -171,5 +171,9 @@
 	.af_other_status = getifgroups,
 };
+#ifdef __rtems__
+static struct ifconfig_option group_gopt = { "g:", "[-g groupname]", printgroup };
+#else
 static struct option group_gopt = { "g:", "[-g groupname]", printgroup };
+#endif
 
 static __constructor void
Index: freebsd-userspace/rtems/include/namespace.h
===================================================================
--- freebsd-userspace/rtems/include/namespace.h	(revision 82e1c695b61f4fd0f57d1c2ce0819fb1e75579ec)
+++ freebsd-userspace/rtems/include/namespace.h	(revision 44ffbd53c6b956ef12d2e530d04ec5b530c2b161)
@@ -56,4 +56,5 @@
 #define _fstat				fstat
 #define _stat				stat
+#define _ioctl				ioctl
 
 #define _sigprocmask			sigprocmask
Index: freebsd-userspace/rtems/include/rtems/netcmds-config.h
===================================================================
--- freebsd-userspace/rtems/include/rtems/netcmds-config.h	(revision 82e1c695b61f4fd0f57d1c2ce0819fb1e75579ec)
+++ freebsd-userspace/rtems/include/rtems/netcmds-config.h	(revision 44ffbd53c6b956ef12d2e530d04ec5b530c2b161)
@@ -26,6 +26,6 @@
   extern rtems_shell_cmd_t rtems_shell_PING6_Command;
 
-  // extern rtems_shell_cmd_t rtems_shell_IFCONFIG_Command;
-  // extern rtems_shell_cmd_t rtems_shell_ROUTE_Command;
+  extern rtems_shell_cmd_t rtems_shell_IFCONFIG_Command;
+  extern rtems_shell_cmd_t rtems_shell_ROUTE_Command;
   // extern rtems_shell_cmd_t rtems_shell_NETSTATS_Command;
 // #endif
Index: testsuite/netshell01/shellconfig.c
===================================================================
--- testsuite/netshell01/shellconfig.c	(revision 82e1c695b61f4fd0f57d1c2ce0819fb1e75579ec)
+++ testsuite/netshell01/shellconfig.c	(revision 44ffbd53c6b956ef12d2e530d04ec5b530c2b161)
@@ -11,5 +11,7 @@
 
 #define CONFIGURE_SHELL_USER_COMMANDS \
-    &rtems_shell_PING_Command
+    &rtems_shell_PING_Command, \
+    &rtems_shell_ROUTE_Command, \
+    &rtems_shell_IFCONFIG_Command
 
 #include <rtems/shellconfig.h>
