You are not logged in.

#1 2010-07-01 01:05:39

sethfouts
Member
Registered: 2010-06-10
Posts: 7

[SOLVED] Share Ethernet Internet with Wifi AdHoc Network

After several hours of searching other similar threads, I cannot find anything which turns out to be useful for what I'm trying to do specifically.

I have a laptop with ethernet card and built-in wifi. With Arch Linux I have configured both before using both the ipconfig/iwconfig methods and using Wicd. I am currently connected to the internet using Wicd and Ethernet (only because Wicd is already installed and configured when I got this internet connection). It would violate the terms of my internet service here (in a dorm room through dorm sponsored internet) to connect a wireless router to the internet connection.

What I want to do then, is set up my laptop so that it accesses the internet through the ethernet connection, and shares it with my iPod Touch through an Adhoc configured on the wifi card. I believe this still may be a small violation of the terms of service with my provider, but I really just want to be able to update/download apps on my iPod.. not let the whole floor have internet for the low price of one room.

Thanks in advance for any help, let me know if I need to provide more specifics for what I'm trying to do.

Last edited by sethfouts (2010-07-01 14:31:40)

Offline

#2 2010-07-01 11:52:41

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: [SOLVED] Share Ethernet Internet with Wifi AdHoc Network

you can use iwconfig to set up the ad hoc connection (i dont know enough about wicd to see if it'll work with it)

iwconfig wlan0 up
iwconfig wlan0 192.168.100.1 netmask 255.255.255.0
iwconfig mode ad-hoc
iwconfig wlan0 channel auto
iwconfig wlan0 essid MYPC

you can then use your ipod to connect to this ad hoc network and assign the ipod an ip address 192.168.100.2, make sure to ping the ipod to see if its connected corrently or not.

you can then use iptables to NAT the connections, iptables -t nat -A POSTROUTING  -s 192.168.100.0/24 -o eth0 -j MASQUERADE
make sure ip forwarding is enabled by using, echo  1 > /proc/sys/net/ipv4/ip_forward

Offline

#3 2010-07-01 14:08:19

sethfouts
Member
Registered: 2010-06-10
Posts: 7

Re: [SOLVED] Share Ethernet Internet with Wifi AdHoc Network

Using the above, I was able to setup a second network connection on my laptop. It is an adhoc wireless connection, at 192.168.100.1 netmasked to 255.255.255.0. The ipod connects to it fine, and when I ping it from my laptop I get a reply.

I'm still having an issue with the connection not sharing my internet from the ethernet connection. I don't know how to check where the breakdown is here, besides attempting to access the internet from my ipod and getting a network not available error. Thanks again for any help.

Offline

#4 2010-07-01 14:31:17

sethfouts
Member
Registered: 2010-06-10
Posts: 7

Re: [SOLVED] Share Ethernet Internet with Wifi AdHoc Network

Found the solution. After forwarding the ethernet connection to the AdHoc network and properly connecting the ipod, I still needed to input the DNS ip address from my ethernet connection into the ipod's wireless connection settings. This ip address allowed it to find the internet connection and everything is working great now. Thanks for the help getting this set up.

Offline

#5 2011-09-30 15:16:55

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: [SOLVED] Share Ethernet Internet with Wifi AdHoc Network

I am trying to do exactly the same thing but here is my problem:

[juha@panzor ~]$ iwconfig wlan0 up
iwconfig: unknown command "up"
[juha@panzor ~]$ iwconfig wlan0 192.168.100.1 netmask 255.255.255.0
iwconfig: unknown command "192.168.100.1"
[juha@panzor ~]$ iwconfig mode ad-hoc
iwconfig: unknown command "ad-hoc"

Offline

#6 2011-09-30 15:24:14

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Share Ethernet Internet with Wifi AdHoc Network

The wiki https://wiki.archlinux.org/index.php/Wi … nual_setup says it should be

iwconfig wlan0 mode ad-hoc

Offline

Board footer

Powered by FluxBB