How can I make a virtual router on Ubuntu 12.04?

22,346

Run this in a terminal:

sudo apt-get install hostapd

Then, open a text editor program, for example gedit. Copy the following into it.

interface=wlan0
driver=nl80211
ssid= 
channel=1
hw_mode=g
auth_algs=1
wpa=3 
wpa_passphrase=
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP

Don't forget to fill in the name of your network after ssid= as well as the password after wpa_passphrase=.

After all these, save the file as hostapd.conf in your home folder.

Now, in your terminal:

sudo hostapd hostapd.conf

Turn the Wi-Fi connection on in your devices and enjoy the fast network share!

you might also want to add dhcpd to assign address to your Android device. Alternatively you can configure iptables to use NAT

Share:
22,346
mojo706
Author by

mojo706

DEVELOPER, GAMER etc

Updated on September 18, 2022

Comments

  • mojo706
    mojo706 over 1 year

    I have recently installed Ubuntu 12.04 and would like to make a virtual router for my Android Device which only connects to infrastructure networks and not ad hoc networks.

    I would appreciate any tips.

  • Lionthinker
    Lionthinker over 11 years
    My computer access internet through authentication server at a uni, where do I place the username and password?