LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 09-08-2006, 04:18 PM   #1
der_kaiser1
LQ Newbie
 
Registered: Apr 2005
Posts: 24

Rep: Reputation: 15
Exclamation Can't share Internet with Wifi


Hi everybody,
I've got 2 computers with Ubuntu Dapper installed on them. The first one is a desktop (PC1) connected to internet via ppp0 and has a Wifi PCI card. The second is a laptop (PC2) with a wifi integrated card.
I want to share Internet using wifi.
My /etc/network/interfaces on PC1 looks like this :
##########################################
# The loopback network interface
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
pre-up /sbin/iwpriv wlan0
wireless_mode Master
wireless_channel 9
wireless-essid Home

iface eth0 inet static
address 192.168.2.1
netmask 255.255.255.0

auto eth0
#####################################
And the one on PC2 looks like this :
#####################################
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.1

#auto eth1
#iface eth1 inet dhcp

#auto eth2
#iface eth2 inet dhcp

auto ath0
iface ath0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
wireless_mode Managed
wireless-essid Home
######################################

The command iwlist ath0 scan on the laptop detects the network, but when I try to ping one of the computers, it fails on both senses.
I've desactivated all the firewalls, and the problem is still persistent.
Can any one help me on that?
Thank you!
 
Old 09-08-2006, 07:19 PM   #2
geden
Member
 
Registered: Nov 2004
Distribution: Mandriva ONE/ Kubuntu 8.04
Posts: 61

Rep: Reputation: 15
I would venture to say that you need to set up the internet connected pc as a nat router, with iptables.
 
Old 09-08-2006, 07:21 PM   #3
Melsync
Member
 
Registered: Sep 2005
Posts: 75

Rep: Reputation: 15
If it is you who set the static ip address on both computers, I think they need to be both 192.168.1.X or both 192.168.2.X, not one 192.168.1.X and the other one 192.168.2.X.
 
Old 09-08-2006, 07:56 PM   #4
der_kaiser1
LQ Newbie
 
Registered: Apr 2005
Posts: 24

Original Poster
Rep: Reputation: 15
Melsync :
The addresses are different because they are not the same.
192.168.1.x is for wireless and 192.168.2.x is for cable ethernet.
I hope I'm not wrong on that...

geden :
Can you explain me more?
I've copied this script (found in a tutorial) in /etc/network/if-pre-up.d/
But I thaught that it was useless. And I also wanted to remove iptables to be sure that there was no firewall blocking the ping. Is this script ok? (Sorry for the french comments)

#!/bin/sh
# /etc/network/if-pre-up.d/iptables-start
#
# Initialise les règles de filtrage iptables
# D'après http://people.via.ecp.fr/~alexis/for...ables-start.sh
#####

# Remise à zéro des règles
iptables -F
iptables -t nat -F

#
# Politiques par défaut
#
#####
# Accepte les connexions entrantes
iptables -P INPUT ACCEPT
# Accepte les connexions destinées à être forwardées
iptables -P FORWARD ACCEPT
# Accepte les connexions sortantes
iptables -P OUTPUT ACCEPT

#
# Règles de filtrage
#
#####
# Pas de filtrage
iptables -A INPUT -j ACCEPT

#
# Règles pour le partage de connexion (le NAT)
#
#####
# Le système fait serveur NAT ; l'interface extérieure est ppp0
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

# Si la connexion que vous partagez est une connexion ADSL, vous
# serez probablement confronté au fameux problème du MTU. En résumé,
# le problème vient du fait que le MTU de la liaison entre votre
# fournisseur d'accès et le serveur NAT est un petit peu inférieur au
# MTU de la liaison Ethernet qui relie le serveur NAT aux machines qui
# sont derrière le NAT. Pour résoudre ce problème :
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS -o ppp0 --clamp-mss-to-pmtu

#
# Règles de port forwarding
#
#####
# Décommentez la ligne suivante pour que les requêtes TCP reçues sur
# le port 80 de l'interface eth0 soient forwardées à la machine dont
# l'IP est 192.168.0.3 sur son port 80 (la réponse à la requête sera
# forwardée au client)
#iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination 192.168.0.3:80
 
Old 09-09-2006, 06:14 AM   #5
Melsync
Member
 
Registered: Sep 2005
Posts: 75

Rep: Reputation: 15
Quote:
Originally Posted by der_kaiser1
Melsync :
The addresses are different because they are not the same.
192.168.1.x is for wireless and 192.168.2.x is for cable ethernet.
I hope I'm not wrong on that...
I think you are.
Try
Quote:
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0

iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
 
Old 09-09-2006, 07:35 AM   #6
der_kaiser1
LQ Newbie
 
Registered: Apr 2005
Posts: 24

Original Poster
Rep: Reputation: 15
Melsync :
I think that the addresses are not the problem..
I've changed them but still not working.

Can anyone tell me if the architecture adopted is right? A computer connected to the Internet as "Master" and the laptop as "Managed".
Is there a way to know if my PCI Wifi card can act as a Master?

Thank you!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best WIFI card for Linux? Please share experiences! JazzLad Linux - Laptop and Netbook 16 05-09-2006 08:47 PM
How To Share WiFi Conn. djrayon Linux - Wireless Networking 0 12-11-2005 10:13 AM
Working WiFi but no internet... help ! Tonyyates51 Linux - Wireless Networking 3 10-19-2005 03:21 PM
HOW TO share I internet connection through wifi?? piggyaugu Linux - Newbie 4 07-03-2005 12:22 AM
internet connection through wifi Hotfeet Linux - Wireless Networking 4 12-04-2004 12:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 11:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration