Jump to content

Ad-hoc Network Ip configuration

jacobingalls

Hey, I am trying to connect multiple computers together via an ad-hoc network. What i want is to have my mac or pc be able to ssh/access a web server running on my wifi enabled raspberry pi. I would prefer that the raspberry pi host the network. I have been able to make a ad hoc network, but for some no computer connected gets an ip address.

My question is; what all do i need installed so that on power up, the raspberry pi will automatically make a ad-hoc network that assigns ip's to connected computers?

Thanks

Link to comment
Share on other sites

Link to post
Share on other sites

By definition ad hoc networking usually only runs on layer 2 so IP addresses are not involved but mac addresses are. That's why your not getting an IP address. you can statically assign IP addresses or run a dhcp server

Link to comment
Share on other sites

Link to post
Share on other sites

Assuming your wireless LAN is wlan0 you can add this to your /etc/network/interfaces file. It's probably not a good idea to use this since it's setup to use WEP, but I'll let you figure out WPA2.

	auto wlan0	iface wlan0 inet static	        address 172.16.0.1	        netmask 255.255.255.0	        broadcast 172.16.0.255	        post-up iwconfig wlan0 mode Ad-Hoc rate auto essid "raspberries" channel 1 key 1234567890

You can setup a DHCP server on the RaspberryPi or you can configure a static IP such as 172.16.0.2 on your machine and SSH into the RaspberryPi through 172.16.0.1.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×