I need to share the wifi internet of my ubuntu laptop to my linux mint desktop , I have a cross over cable. ( Connecting desktop to router is not an option)

I am able to ping my laptop from my desktop but unable to connect to internet.

I have first used network network manager settings in laptop to and change your IPv4 settings to shared to other computers

ifconfig in laptop says


IP address


IP address

NOW to the desktop where i need the internet, we tried both Automatic (DHCP) and manual settings under Wired Connection. Though able to ping the laptop not able to get the internet, ping google.com says unknown host. ping (IP address of goolge) says 100% packet loss destination unreachable

In manual I gave IP , tried gateways once, tried gateway ( which was shown in netstat -nr) tried gateway and still able to ping but no Internet connection

How can i remedy this. DNS entries are in router so shouldn't be a problem.

[Comments got hard to read, edited to add route's]

route on Desktop:

Destination     Gateway         Genmask         Flags Metric Ref  Use Iface
default             UG - 0 - 0   - 0 - eth0        *      -     U -  1 - 0   - 0 - eth0     *      -   UH - 0 - 0   - 0 - eth

and route on Laptop:

Destination     Gateway         Genmask         Flags Metric Ref Use Iface
default -           UG - 0 - 0  - 0 - wlan0       *      -     U -  1 - 0  - 0 - eth0     *      -     U -  9 - 0  - 0 - wlan0
  • 1
    "able to ping my laptop from my laptop" ... ? What's the router address / laptop's gateway? Doesn't work for the desktop?
    – Xen2050
    Dec 18, 2014 at 20:15
  • @Xen2050 Sorry my bad, it's "able to ping my laptop from my desktop", Desktop doesn't have a WiFi module so I can't connect to the WiFi internet. netstat -nr gives for my laptop. Dec 18, 2014 at 20:39
  • 1
    I'm familiar with the ping error "no route to host", but "destination unreachable" not so much. How's route look on each?
    – Xen2050
    Dec 18, 2014 at 21:03
  • 1
    I just did. About out of ideas though, default's there
    – Xen2050
    Dec 18, 2014 at 21:37
  • @Xen2050 Is there a way around this. I have functionally tried most of the things. What should i tweak Dec 18, 2014 at 22:24

1 Answer 1


I did a little searching and found some answers, not quite identical but should work, it's supposed to be "easy" using the Ubuntu GUI tools. It'll set up some IP tables / NAT magic (somehow), so we were close with using "route - show / manipulate the IP routing table" but just didn't know the "secret words"

On the internet connected computer (server), go to the Network Manager (right-click on the network icon(s) in the toolbar and edit the wired connection (eth0), go to the IPv4 tab and in "Method", choose "Shared to other computers". Apply everything and close the network manager windows.

Answers are a little different for the non-internet (client) computer.

  • Some say to just plug it in & it'll work. Or set it to "Automatic" (and maybe set the dns server to the "server" computer if required) [Share wireless with wired, share Ubuntu to WinXP]
  • Another says to manually set it's IP to one in the same LAN network, as in if the "server" is, then set the "client" to with the same Netmask (
    Then use the "server" ip as the gateway and dns.

There's also a manual, terminal way to do it too using iptables, but the fellow's instructions are very sparse and don't explain what it does at all, except "this will configure the nat" (probably copypasta'd from somewhere else). I don't think it'd be useful to paste it here without an explanation so I won't, but here's the link if you're interested (or a masochist ;-)

  • Thank you, the issue is solved and I'm posting from my desktop. :) I used the server IP as the gateway and dns Dec 19, 2014 at 10:21
  • 1
    No problem. Too many variables to guess successfully, even what should make sense often doesn't. FYI, I've been using an old old wifi router to share wireless internet with local wired computers for a long time now, running Tomato or dd-wrt or openwrt gives many options, and should use less power than even a laptop.
    – Xen2050
    Dec 19, 2014 at 11:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .