Topic: Wlan0 Sharing
mmasri's photo
Wed 04/28/10 03:50 PM
Ah I hope some one can give me a good solution for sharing my internet, under windows XP I can do it in 2 ways, when I have internet commng from my wireless network:

1- Righ click the network point to properties and click on share network.
it should make my NIC IP:
ip: 192.168.0.1
subnet mask: 255.255.255.0
default gateway: "nothing"

and basically I would set the IP statically on the other Computers NIC to:
IP: 192.168.0.2 "or any number from 2 to 244 "
Subnet mask: 255.255.255.0
default gateway: 192.168.0.1 "same ip as the main computer"

but now I am running Ubuntu, and I have tryed installing dhcp3-server, firestarter and many other things going with the manual one by one, but I cannot seem to find an easy solution to give internet from my eth0 to other NIC's on a strait cable.


newarkjw's photo
Wed 04/28/10 03:54 PM
Can you ping 192.168.0.1?

mmasri's photo
Wed 04/28/10 05:03 PM
yes if I was useing windows XP and I hade my network setup that way, I should be able to ping 192.168.0.1

but on UBuntu, when I try to setup a network sharing system. I cannot even get eth0 to ether act as a router, or even configure both eth0 on Local Computer, and eth0 on Second computer to share the same LAN.

Tessa02's photo
Wed 04/28/10 07:57 PM
Do you have Samba or another NFS installed?

mmasri's photo
Thu 04/29/10 02:41 AM
No, I haven't installed or configured any Samba or NFS yet.


AGoodGuy1026's photo
Thu 04/29/10 06:02 AM
Ok, your post is a little confusing... so I will make assumptions and comment...

1. if you have a wireless network (an access point somewhere) why are you trying to "share you network with eth0 on the XP machine" this is not making much sense to me, why not simply join the other computers to the WLAN? THEN share out your windows resources?

2. two computers on the same subnet do not need a router to talk (i.e. if you have one pc setup as 192.168.0.1, and the other setup as 192.168.0.2 - you do not need a gateway).

3. if you have a straight cable you will not "build a network" you would need a "crossover cable" between the two PC's in order to have connectivity...

4. if you are connecting with a WLAN - and you are trying to ping each other and cannot, the following can be problems:

a) you have connected to the wifi - but are using the wrong encryption key, therefore you are not really connected... I suggest using an "OPEN" ap configuration for testing first, then enable encryption later (just for troubleshooting I would never run an OPEN ap setup)

b) ensure that local firewalls are DIS-abled on the linux as well as the windows pc

c) I would suggest configuring DHCP on the WiFi AP, this will help you separate connectivity problems (if you do not get a Dhcp address - then the wifi is not configured properly) - as well as allow your AP to be "the router"...

Let us know how you progress~~

$.02 drinker

mmasri's photo
Thu 04/29/10 07:13 PM
Thank you.

Now I will try to explain my problem in more detials:

PC1 == "Ubuntu Linux 9.04"

PC1 has:
1- WAN card
2- NIC card "with smart capability" meaning if the connection is strait or corss it will do the internal cable switch on its own.

PC2 == "Linksys PAP2-T" == "VOIP Adapter" == "Not real PC"

now the main Access Point is far in the basement.

I need to Provide PC2 with internet from PC1, so that I can use the VOIP device.

I hope that makes things more clear?
as for my MAIN post, that was just the solution I would use for this problem if I was running a Microsoft Windows O.S
and I mentioned that example to see if there is a way as easy as that on LINUX

AGoodGuy1026's photo
Fri 04/30/10 07:05 AM
Understood, thank you for the additional information.

Your basic problem is this -- you have a linux machine with 2 interfaces (eth0 (WiFi), eth1 (NIC)).

Broadcasts on the eth0 network will not be forwarded to the eth1 network. The two interfaces are connected to two different "physical" networks.
In essence, they are seperated.

In order to accomplish what you need, you must configure your LINUX machine to be a router. This will require your linux machine to have 2 ip networks, one on each interface.

Also, since your eth1 network will be in a different subnet, your AP will have to be configured to "route back" to the eth1 network. Many AP's do not suppoprt this functionality.

My suggestion in this scenario would be:

1. configure LINUX to be a router
2. configure LINUX to "translate" all eth1 traffic to eth0 ip subnet, eliminating the need for the AP to "route back"
3. IP PC2 on eth1 network...

Suggested steps (specific)

### PC2 ###
#
1. Give PC2 an IP address of 192.168.1.2, netmask 255.255.255.0, gateway 192.168.1.1
#

### LINUX ###
#
1. enable packet forwarding - 'echo "1" > /proc/sys/net/ipv4/ip_forward'
2. enable iptables to translate eth1 to eth0 network '/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE'
3. save iptables settings 'service iptables save'
4. ipconfig eth0 192.168.0.2 (or whatever AP's subnet is)
5. ipconfig eth1 192.168.1.1
6. ip route default gw 192.168.0.1 (or whatever AP's ip address is)

That should be about it. I am a SUSE guy, so UBUNTU may be a bit different...

Good luck, hope this helps, Let us know your progress!!

$.02 drinker

mmasri's photo
Fri 04/30/10 12:03 PM
Thanks, I will try that later today.

SUSE wow I haven’t herd or seen SUSE from 2005, How is it?
do you use it for your every day computing?

I actually used, centos, and debian for my "pre configured" server testing.

as will Fedora and Ubuntu for Desktop, I tried installing SUSE cannot remember what kernel was running at the time..

Actuly I like Fedora more, but I format allot "bad luck with things"

and some times I go back to windows XP, so I can use Dreamweaver to do some PHP development in an easy environment.

and did not find a great editor such as Dreamweaver on Linux.

a side from that, Ubuntu comes with Gnome and an auto updater, or how can i say it, it would search and install for MP3 codec’s on its own, while in fedora I had to really learn allot of things to get MP3 to work, which was great, but then going to XP for a year then going back to Fedora makes it hard to re-learn how to configure MP3

For example this Original POST I managed to do it at some point 3 month back the road, but having difficulty doing it again.

I read somewhere that Fedora has a built in feature that allows you to share the internet between Wla0 and Eth0 as simple as you would do it in XP.

Any ways, how is Suse? Would you recommend it for every day task?

I think it uses the same Red-Hat system?
Which is basically for those who did not know:

1- "Red Hat" == "Fedora" == "Centos"
2- "Debian" != "Ubuntu" but Ubuntu is made from Debian.

For small details about the main differences kindly check the following link posted by a hosting Company I rent Servers from:

http://xlhost.com/operatingsystems.php