# General > IoT, IoE, and Maker Forum >  [RESOLVED] Raspberry Pi as portable router

## Nightwalker83

Hi,

I am trying to setup my Raspberry Pi as a portable router? Has anyone here had experience in doing so before? I have followed several tutorials on the subject online but have had the setup fail most likely due to improper configuration. Although, reading the files I have configured I can not see where I have gone wrong.

The operating system I am using in Debian, not sure if that is going to impact the project or not?

Thanks,


Nightwalker

----------


## dilettante

Is this just an exercise for its own sake or do you want something that reliably does this?

Because small portable routers you can easy fit in your pocket are darned cheap, and most support at least WiFi downstream and upstream along with Ethernet upstream.  These usually have internal batteries, in some cases large enough to serve as phone chargers as well.

There are also a ton of cheap devices that have Ethernet downstream and WiFi upstream, meant for scenarios like motel WiFi usage with a non-wireless device like a creaky old laptop.  These are normally line ("mains") powered though, but I'm sure you could find an exception.

But cobbling something together out of a Raspberry Pi... well I suppose duct tape is cheap enough.  :Wink:

----------


## Nightwalker83

Both! I was going to buy a portal router by realized that I had the Raspberry Pi and wondered if that could do what I needed! I have already spend money I thought I needed to do the job and turns out what I had planned did not work.

----------


## Nightwalker83

I achieved it by 

First setting up the RPi for WiFi



```
country= your coutry
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid= #Your home network
    psk= #Network password
}
```

Setting the interfaces: /etc/network/interfaces



```
auto lo
iface lo inet loopback

allow-hotplug eth0
auto eth0

iface eth0 inet static

allow-hotplug wlan0
auto wan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
auto wan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
```

Install Xrdp on the Pi
install  the dhcpserver

 File: /etc/dhcp/dhcpd.conf 

change that to reflect the Pi Ethernet connect that is acting as the server.



```
 subnet  0.0.0.0  netmask 255.255.0.0 {
  range 0.0.0.0 0.0.0.0;
  option broadcast-address 0.0.0.0;
  option routers  0.0.0.0;
  option domain-name "local";
  option domain-name-servers 8.8.8.8, 8.8.4.4;
  default-lease-time 600;
  max-lease-time 7200;
 }
```

The easiest why to modify the config above is by putting the ip address of the Ethernet server into a subnet calculator.

----------

