Howto: Ubuntu dapper + internet connection sharing


Recommended Posts

This thread is slightly different to the last as it describes how to enable internet connection sharing over an ad-hoc network, as opposed to just connecting to an Ad-Hoc network with a static IP, I decided to put it into a seperate thread as it relates to configuring a seperate card and I didn't want the other thread getting too busy

My network is set up as so:

ADSL Router -> ethernet -> Dapper PC -> wireless -> Dapper Laptop

Here are the instructions on how to set up the Dapper PC to share the internet to lan clients:

Under the x86_64 Dapper beta 2, the network configuration program crashes, so I installed the i386 version of Dapper beta 2 and now it works.

My ethernet card, connected to the router, was already configured by DHCP, so all I had to do was set up the PCs ra0 card with a static IP address

This wasn't as simple as I thought, we can set it up with ubuntus network configuration manager and it will save the settings correctly to /etc/network/interfaces but it will not set it up as an Ad-Hoc network, to do this you must issue iwconfig ra0 mode Ad-Hoc

iwconfig ra0 essid Z3r0 #your essid here

My PC could now ping the laptop, the laptop could now ping the PC, but the laptop couldn't reach the internet through the PC, this requires another step

modprobe iptable_nat

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward

The laptop can now access the internet

Finally add these commands to rc.local to execute on each bootup

iwconfig ra0 mode Ad-Hoc

iwconfig ra0 essid Z3r0 #your essid here

modprobe iptable_nat

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward

Troubleshooting:

if you have wireless-mode Ad-Hoc in /etc/network/interfaces your PC will freeze the PC after logging in, do not put it in there, issuing post-up wireless-mode Ad-Hoc doesn't work and pre-up will cause the system not to boot

It is therefore necessary to add the command to rc.local as above.

I had a look at WEP, issuing iwconfig ra0 key s:1234567891011 works but the laptop and PC fail to communicate, I already know it works as the laptop was working with windows before with WEP, so I assume that the drivers are broken? or there is another unknown to me configuration option

--------------------------------------------------------------------------------------------------------------------------------

Just for clarity

/etc/network/interfaces should look like this:

auto lo

iface lo inet loopback

#The primary network interface configured via DHCP

auto eth0

iface eth0 inet dhcp

auto ra0

iface ra0 inet static

address 192.168.0.1

netmask 255.255.255.0

gateway 10.0.0.138 #my router

/etc/resolv.conf should look like this:

nameserver 10.0.0.138 #my router or your ISPs DNS server instead

----------------------------------? ---------------------

If you are connecting directly to a router, try this

set up the ip etc in network manager with dhcp assigned address and WEP off

iwconfig ra0 mode managed #default

iwconfig essid youressid

iwconfig channel 6 #your channel

dhclient ra0 #get ip address from router, no need to issue ifconfig ra0 up/down, I suggest trying a static IP first though

ping 10.0.0.138 #your router

If that works add the iwconfig commands to /etc/rc.local to execute on bootup

Here are two wikis (with info about WPA/WPA2)

One for the AR5212

http://forums.whirlpool.net.au/index.cfm?a=wiki&tag=ar5212

One for the RT61

http://forums.whirlpool.net.au/index.cfm?a=wiki&tag=rt61

Enjoy:))

Edited by Z3r0
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • It use to be a nightmare, with LibreOffice supporting a newer draft ODF standard by default, and Microsoft Office supporting the older non-draft standard. Now that they both support the same version of ODF, they should be interoperable.
    • Brave Browser 1.91.171 by Razvan Serea Brave Browser is a lightning-fast, secure web browser that stands out from the competition with its focus on privacy, security, and speed. With features like HTTPS Everywhere and built-in tracker blocking, Brave keeps your online activities safe from prying eyes. Brave is one of the safest browsers on the market today. It blocks third-party data storage. It protects from browser fingerprinting. And it does all this by default. Speed - Brave is built on Chromium, the same technology that powers Google Chrome, and is optimized for speed, providing a fast and responsive browsing experience. Brave Browser also features Brave Rewards, a system that rewards users with Basic Attention Tokens (BAT) for viewing opt-in ads. This innovative system provides an alternative revenue model for content creators and a way to support the Brave community. SlimBrave Neo takes all the good things about Brave and makes them even better by keeping everything clean, light, and privacy-focused. It removes the extra clutter, turns off features you might not need, and cuts down on anything that could slow you down or collect unnecessary data. Because it relies on simple settings and policies instead of modifying the browser itself, you still get full Brave compatibility—just in a smoother, lighter, and more privacy-friendly package. Brave Browser 1.91.171 changelog: General Fixed Cardano not being disabled on upgrade to Brave Origin. Upgraded Chromium to 149.0.7827.103. Origin Removed “Survey Panelist” setting from brave://settings/privacy. Fixed P3A and usage ping under brave://settings/privacy being displayed on first launch on Linux. Upgraded Chromium to 149.0.7827.103. Download: Brave Browser 64-bit | 1.2 MB (Freeware) Download: Brave Browser 32-bit View: Brave Homepage | Offline Installers | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Hi. As the title suggests, I can't access the forum on my phone. I'm using Edge on Android and when I try to navigate to the forum I get a "we value your privacy" popup and none of the buttons are clickable. It effectively stonewalls me from reading any forum content.
    • Honestly you're not wrong about AdGuard. Neowin frequently has lifetime license discounts for them and that's how I got my cheap family license a few years ago to run it on all my devices.
  • Recent Achievements

    • Rookie
      Marzoid went up a rank
      Rookie
    • Community Regular
      coch went up a rank
      Community Regular
    • One Year In
      slackerzz earned a badge
      One Year In
    • One Year In
      highriskpaym earned a badge
      One Year In
    • One Month Later
      highriskpaym earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      520
    2. 2
      PsYcHoKiLLa
      192
    3. 3
      +Edouard
      157
    4. 4
      Steven P.
      84
    5. 5
      ATLien_0
      75
  • Tell a friend

    Love Neowin? Tell a friend!