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

    • I think you meant the "ntfs3" driver, but yes there have been a lot of fixes for it in this release and previous releases, not 100% sure if the issue you mentioned is fixed though. In any case, the new "ntfs" driver in 7.1 doesn't have that issue (at least, no reports of such have come thru), but your kernel needs to explicitly enable support for the new driver first (like how CachyOS kernel has it), and you need to edit your mount points in /etc/fstab to use "ntfs" instead of the other drivers.
    • Epic Games says Unreal Engine 6 will help developers "build content faster" using AI models by Pulasthi Ariyasinghe Epic Games is rolling out the latest major update to Unreal Engine 5 today, and at the same time, the company also dropped some information on the next-generation version of the product, Unreal Engine 6. This was already revealed a few weeks ago alongside the new Rocket League upgrade reveal. The company says it is combining the features of Unreal Engine and Unreal Editor for Fortnite to create this new version of its popular media creation tool. On top of creating entire games, the new engine will also focus on letting developers operate large-scale live service titles more easily, whether by shipping content into their own ecosystems or into Fortnite. The use of large language models is also mentioned here, with Epic saying it will be a core part of the engine. "We see LLMs, generative AI models, and tools like Claude and Codex playing a central role in helping you build content faster while maintaining the creative control you need," adds the company. Here is the rundown of what's new about version 6 of Unreal Engine: With all these changes to the programming model, portability upgrades, and generative AI integration, Epic says the new version of the engine will "change a lot about how games are made." The company aims to ship Unreal Engine 6 into early access in late 2027, with a full release planned for 12-18 months later. Epic Games also dropped a lengthy blog post about the new Unreal Engine 5.8 update for game developers over here. The release is focused on delivering better performance, customization, and streamlined workflows for development teams. This will be the final major update for this version of the engine before Epic switches to focus fully on Unreal Engine 6's early access launch.
    • Watch Louis Rossmann's recent experience on YouTube about trying to get a warranty replacement from Samsung. It's crazy.
    • That is the thing, how many of these people don't realise they are using AI? If they use Google Search they have no choice but to use AI. So yes, maybe half of American adults do use and I expect a lot of Uk adults do to, but I bet most of them don't realise it. Myself, i avoid the rubbish.
    • They use FREE AI. They aren't paying for this meme-generating slopware...
  • Recent Achievements

    • One Month Later
      Vincian earned a badge
      One Month Later
    • First Post
      Jocimo earned a badge
      First Post
    • Week One Done
      suprememobiles48 earned a badge
      Week One Done
    • One Month Later
      Windows Guy earned a badge
      One Month Later
    • One Month Later
      Prasann earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      500
    2. 2
      +Edouard
      162
    3. 3
      PsYcHoKiLLa
      88
    4. 4
      Steven P.
      68
    5. 5
      neufuse
      65
  • Tell a friend

    Love Neowin? Tell a friend!