特殊:Badtitle/NS100:WifiDocs/ShareEthernetConnectionThroughWireless
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/WifiDocs/ShareEthernetConnectionThroughWireless }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/af | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Afrikaans| [[::WifiDocs/ShareEthernetConnectionThroughWireless/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/ar | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|العربية| [[::WifiDocs/ShareEthernetConnectionThroughWireless/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/az | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|azərbaycanca| [[::WifiDocs/ShareEthernetConnectionThroughWireless/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/bcc | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|جهلسری بلوچی| [[::WifiDocs/ShareEthernetConnectionThroughWireless/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/bg | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|български| [[::WifiDocs/ShareEthernetConnectionThroughWireless/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/br | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|brezhoneg| [[::WifiDocs/ShareEthernetConnectionThroughWireless/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/ca | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|català| [[::WifiDocs/ShareEthernetConnectionThroughWireless/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/cs | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|čeština| [[::WifiDocs/ShareEthernetConnectionThroughWireless/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/de | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Deutsch| [[::WifiDocs/ShareEthernetConnectionThroughWireless/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/el | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Ελληνικά| [[::WifiDocs/ShareEthernetConnectionThroughWireless/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/es | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|español| [[::WifiDocs/ShareEthernetConnectionThroughWireless/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/fa | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|فارسی| [[::WifiDocs/ShareEthernetConnectionThroughWireless/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/fi | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|suomi| [[::WifiDocs/ShareEthernetConnectionThroughWireless/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/fr | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|français| [[::WifiDocs/ShareEthernetConnectionThroughWireless/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/gu | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|ગુજરાતી| [[::WifiDocs/ShareEthernetConnectionThroughWireless/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/he | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|עברית| [[::WifiDocs/ShareEthernetConnectionThroughWireless/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/hu | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|magyar| [[::WifiDocs/ShareEthernetConnectionThroughWireless/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/id | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Bahasa Indonesia| [[::WifiDocs/ShareEthernetConnectionThroughWireless/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/it | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|italiano| [[::WifiDocs/ShareEthernetConnectionThroughWireless/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/ja | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|日本語| [[::WifiDocs/ShareEthernetConnectionThroughWireless/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/ko | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|한국어| [[::WifiDocs/ShareEthernetConnectionThroughWireless/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/ksh | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Ripoarisch| [[::WifiDocs/ShareEthernetConnectionThroughWireless/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/mr | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|मराठी| [[::WifiDocs/ShareEthernetConnectionThroughWireless/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/ms | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Bahasa Melayu| [[::WifiDocs/ShareEthernetConnectionThroughWireless/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/nl | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Nederlands| [[::WifiDocs/ShareEthernetConnectionThroughWireless/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/no | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|norsk| [[::WifiDocs/ShareEthernetConnectionThroughWireless/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/oc | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|occitan| [[::WifiDocs/ShareEthernetConnectionThroughWireless/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/pl | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|polski| [[::WifiDocs/ShareEthernetConnectionThroughWireless/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/pt | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|português| [[::WifiDocs/ShareEthernetConnectionThroughWireless/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/ro | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|română| [[::WifiDocs/ShareEthernetConnectionThroughWireless/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/ru | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|русский| [[::WifiDocs/ShareEthernetConnectionThroughWireless/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/si | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|සිංහල| [[::WifiDocs/ShareEthernetConnectionThroughWireless/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/sq | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|shqip| [[::WifiDocs/ShareEthernetConnectionThroughWireless/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/sr | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|српски / srpski| [[::WifiDocs/ShareEthernetConnectionThroughWireless/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/sv | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|svenska| [[::WifiDocs/ShareEthernetConnectionThroughWireless/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/th | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|ไทย| [[::WifiDocs/ShareEthernetConnectionThroughWireless/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/tr | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Türkçe| [[::WifiDocs/ShareEthernetConnectionThroughWireless/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/vi | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|Tiếng Việt| [[::WifiDocs/ShareEthernetConnectionThroughWireless/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/yue | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|粵語| [[::WifiDocs/ShareEthernetConnectionThroughWireless/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/zh | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|中文| [[::WifiDocs/ShareEthernetConnectionThroughWireless/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/zh-hans | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|中文(简体)| [[::WifiDocs/ShareEthernetConnectionThroughWireless/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless | {{#if: | :}}WifiDocs/ShareEthernetConnectionThroughWireless}}/zh-hant | • {{#if: UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|中文(繁體)| [[::WifiDocs/ShareEthernetConnectionThroughWireless/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:WifiDocs/ShareEthernetConnectionThroughWireless|:WifiDocs/ShareEthernetConnectionThroughWireless|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :WifiDocs/ShareEthernetConnectionThroughWireless/zh | | {{#ifexist: WifiDocs/ShareEthernetConnectionThroughWireless/zh | | {{#ifeq: {{#titleparts:WifiDocs/ShareEthernetConnectionThroughWireless|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:WifiDocs/ShareEthernetConnectionThroughWireless|1|-1|}} | zh | | }}
Introduction
Okay, imagine you only have a network cable plugged in your desktop PC (which we'll call "eth0") and a wireless card too (which we'll call "wireless0"). Now suppose you have your laptop (or any other computer) and you have no way to connect it to the internet - but wait! you have a wireless in your desktop PC and your laptop does too, so what we're gonna do is to share your internet connection for your laptop through your wireless card. Come aboard! Remember, your machine may vary so be sure to use the commands shown in the "The basics" section right below. Note: this guide has been tested for sharing connection between :
Ubuntu Feisty Fawn (7.04) | and | Windows XP Professional |
Please add successfull configurations Note: This diagram was created with inkscape. If you want to edit it download the full file `ics.svg` from: More Actions->Attachments
The Basics
For getting your wireless card info, open a terminal and use these commands:
lsusb (lists all the connected USB devices) iwconfig (lists all the detected wireless hardware) iwlist (allows you to scan the wireless networks around you) ifconfig (lists all the detected network hardware. You can get some info for your wireless here too)
Packages
You also need Firestarter, which is just a GTK frontend for the iptables and will allow your internet connection to be shared. You can use Add/Remove Applications or the Synaptic package manager to get it (search for firestarter
) or just issue a command in any open terminal window:
sudo apt-get install firestarter
Configuring the SERVER
Here we'll configure who is going to share the Internet connection (our desktop PC with the two cards installed). First, we need to have some concepts and rules in mind:
- Computers must be in the same subnet (see below for explanations)
- You might not be able to use the Gnome Network Manager (and/or maybe KDE WiFi Manager) using this method.
- The Server's wireless0 has to be in a range of 192.168.x.2 and 192.168.x.24. Why? our computer is usually using 192.168.0.1 unless you're on a big network, 192.168.0.0 can't be used for it and ranges higher than 24 in the last number are only allowed for Wireless networking,`(1.reference please)` or so I've read.
- Your wireless card must have the lowest IP possible,`(2.reference please)` that's why we're using 192.168.0.2 because it's closest to 1 and 0 which are in use and we can't use it, so 2 is free. Client computers ALWAYS MUST have greater IP addresses than the chosen one for the wireless adapter `(3.reference please)`(or the one sharing the internet).
If you haven't yet, it's time to stop the Network Manager:
sudo /etc/dbus-1/event.d/25NetworkManager stop
Once stopped, we shall proceed to edit our /etc/network/interfaces file.
sudo gedit /etc/network/interfaces
Network Interfaces configuration -IMPORTANT-
Your network configuration file will look similar to this one:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet dhcp auto eth2 iface eth2 inet dhcp auto ath0 iface ath0 inet dhcp auto wlan0 iface wlan0 inet dhcp
For the sake of this example, we only have two network cards, so I'm gonna simplify the example by removing the interfaces we won't use from the file. You can happily do your modifications without deleting them. We need to think how we'll set up our network. We'll do it this way:
- IP Address for wireless0: 192.168.0.2 (its own IP address we can define manually).
- Gateway for wireless0: 192.168.0.1 (where does the internet come from? us, of course. 192.168.0.1 will always be your own computer in most of the cases).
- Network Mask for wireless0: 255.255.255.0 (Always needed and standard value 99.9% of the time).
Note: You might need to think up another IP address for it if you're on a large network. Else, just leave it like that. For sharing internet through the wireless with those settings, our interfaces file will end up like this:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto wireless0 iface wireless0 inet static wireless-key 1234567890 wireless-channel 6 wireless-mode ad-hoc wireless-essid 'Wireless Connection' address 192.168.0.2 gateway 192.168.0.1 netmask 255.255.255.0
Note: Remember to replace wireless0 with your network adapter's name, which you can get by typing in a terminal:
iwconfig
Okay. Now, we're doing the following things:
- Setting wireless0 to load automatically.
- Specify a static configuration instead of being assigned by DHCP (which we won't be able to do).
- We'll set an hexadecimal WEP key for safety (WPA is not supported at this stage).
- Also, a channel where to send the information order essay through. Remember Wireless is very similar to radio/tv communications.
- Specify that we're going be in an ad-hoc network (peer-to-peer or mesh).
- We'll put a name for it, which we'll use to identify it in Windows, and to identify ourselves in our location.
- We'll set it's address, gateway and netmask as we decided earlier.
That done, we can restart networking to get the device ready:
sudo /etc/init.d/networking restart
After that, we'll fire up Firestarter:
gksudo firestarter
A wizard should appear. Follow through these steps:
- Press Next.
- Choose eth0 (or your Ethernet device's name) as the Internet device. If your IP configuration is assigned by DHCP, check/uncheck the corresponding box according to your situation.
- Choose wireless0 (or your wireless device's name) as the device which will share Internet. Check the box that says to share Internet.
- Do NOT activate the option to enable DHCP in the Local Network.
- Press Save.
If everything went good, it should say Firewall Started. If not, please refer to the Troubleshooting section, else, we're done here.
Configuring the CLIENTS
This is relatively easy. When you have your wireless card working (it should blink its led lights, or at least turn on) and you've set up the server correctly, all you have to do is this:
- Make sure your other computer has wireless enabled and working.
- Go to the Wireless Connections panel and scan for nearby networks. Yours should appear soon. If not, then something's wrong with your server computer or the connection itself. Refer to the Troubleshooting section set by online resume writers for details.
- Double-click your connection and type your password in. Wait for it to connect.
- Go to Control Panel -> Network Connections and right-click your wireless connection, then click Properties.
- Click TCP/IP Internet Protocol (or similar) and click the Properties button.
- Click the Assign an IP Address Manually radio button (or similar).
- We'll need to put the following data:
- IP Address: 192.168.0.10
- Gateway: 192.168.0.1
- Network Mask: 255.255.255.0
- Set the DNS addresses to the same ones that your desktop PC has. You can check that by typing on the terminal on the Server/Desktop computer (use the IP addresses after "nameserver"):
cat /etc/resolv.conf
- Click Ok, then Ok again to apply changes.
10. Right-click the small icon on the bottom-right corner of the screen (system tray) which looks like a small monitor with some green curves next to it representing radio signals. Then click Repair. 11. Pat yourself on the back for your hard work and make yourself a sandwich :) Your laptop should have Internet now. If anything went wrong, check the Troubleshooting section, as always.
Troubleshooting
See related page on Ad hoc networking.
Authors
Big thanks to
- theone (IRC channel)
- astro76 (IRC channel)
- P3L|C4N0 (Spanish IRC channel)
References
- 1.
- 2.
- 3.