[SOLVED] Connecting to internet with Lubuntu through Ubuntu machine
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Connecting to internet with Lubuntu through Ubuntu machine
Hey,
Most probably this is already discussed several times, but I wasn't able to find any user friendly manuals on how to create some sort of network, which would mean that one computer (Lubuntu in this case) is connecting to internet through second PC (Ubuntu), which is directly connected to cable, so maybe you could help me out with some manuals and tips.
The computer which is connected to internet have two LAN cards (Realtek 8139 and integrated nVidia MCP65), Realtek card is connected to the internet provider cable (internet is tied to my computer's MAC address and uses static IP).
Second computer have also a Realtek card and it's connected to first computers integrated card.
Anyhow - I've put on the first computer eth1 (which is integrated MCP65) IPV4 setting to "Shared to Other Computers" and IPV6 to "Link-Local Computers" and while I was having Windows XP on the second machine, setting on it (the XP machine) DHCP (or how was it correctly called, when system automatically resolves or gets the IP and the rest what it needs?), second computer was receiving Internet signal and I could use both of them in such way.
Now the second computer is with Lubuntu and I thought that I could do the same way as did on XP - just put in Network Manager for the connection (eth0) everything to automatical and there will be internet, but there aren't and the manager shows some kind of "Automatic Ethernet" option, which after activation also doesn't do anything.
So my question in short would be: What do I have to do, to make my Lubuntu machine to recognize Ubuntu's eth1 and to use it as a source for Internet?
I wouldn't mind if someone would at least tell me how to correctly Google or search on LinuxQuestions forum for tips and How-To's!
That could be so, that it's already discussed before - it's just that I'm not that good at specific thing (like this one) searching. Also, I thought that if WinXP with dhcp could easily connect to internet through Ubuntu, so [easily] should do another Ubuntu system!
10.42.45.0/24 dev eth1 proto kernel scope link src 10.42.45.1 metric 1
62.85.125.0/24 dev eth0 proto kernel scope link src 62.85.125.45 metric 1
169.254.0.0/16 dev eth1 scope link metric 1000
default via 62.85.125.1 dev eth0 proto static
iptables-save went with no messages, so I assumed that it's not needed to post that. Will check now the other computer!
Here are the results: ilga@lubunts:~$ sudo dhclient
Quote:
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/00:0e:2e:c9:d0:2a
Sending on LPF/eth0/00:0e:2e:c9:d0:2a
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
and so on and on and on ...
From the computer with the internet connection, please run this command:
Code:
sudo iptables -I INPUT -i eth1 -j ACCEPT
Then, from your second computer please run
Code:
sudo dhclient
And post the output.
----
If that does NOT work please setup a static IP address for your second computer, in the 10.42.45.0/24 network.
IP address: 10.42.45.100
Subnetmask: 255.255.255.0
Default Gateway: 10.42.45.1
Use your ISP's DNS server.
Once you have set that, ping 10.42.45.1 from the second computer. If that works, ping 203.0.178.191 as well.
---
Please also do this from the main ubuntu computer and post the output:
Code:
ip route
ps aux | grep dhcp
cat /etc/resolv.conf
cat /proc/sys/net/ipv4/ip_forward
Last edited by SuperJediWombat!; 05-01-2010 at 09:31 AM.
Tried/did all the commands You told me to do, but still no results - no connection on second computer ..
Here's the info from second computer: ilga@lubunts:~$ sudo dhclient
Quote:
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/00:0e:2e:c9:d0:2a
Sending on LPF/eth0/00:0e:2e:c9:d0:2a
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPOFFER of 10.42.43.10 from 10.42.43.1
DHCPREQUEST of 10.42.43.10 on eth0 to 255.255.255.255 port 67
DHCPACK of 10.42.43.10 from 10.42.43.1
bound to 10.42.43.10 -- renewal in 1716 seconds.
Also, pinging 10.42.45.1 ended with Network is unreachable message ..
And here's from main computer: zivs@ubunts:~$ ip route
Quote:
10.42.43.0/24 dev eth1 proto kernel scope link src 10.42.43.1 metric 1
62.85.125.0/24 dev eth0 proto kernel scope link src 62.85.125.45 metric 1
169.254.0.0/16 dev eth0 scope link metric 1000
default via 62.85.125.1 dev eth0 proto static
Yay. The ping didn't work because for some reason your ubuntu box changed it's internal IP address from 10.42.45.1 to 10.42.43.1
The reason that DHCP did not work earlier is that you were blocking it from your firewall. Either add the iptables command I gave you earlier to your firewall script, or stick at the end of rc.local (or something similar.)
Set the lubuntu computer back to DHCP, and try to use the internet.
Thanks,SuperJediWombat! - after adding that iptables command on my Ubuntu machine and then running dhclient command on the other computer (Also, putting IPv4 to Automatic and IPv6 to Link-Local Only), I've finally got the Internet on both machines!
Only thing which I noticed just now was that in Network-Manager on Lubuntu computer wasn't written Mac address (which I copied out from ifconfig's info) ... I wonder if that missing Mac address there was also playing any role in this case?
Once again - huge thanks for putting so much effort in finding the problem for me!
No problem, I'm glad we got it sorted. Where did those iptables rules come from by the way? Did you set them up manually, or are they part of the Ubuntu network sharing system?
I haven't touched them before (if only Firestarter after installation (don't know why I had it installed) rewrote something?), so I guess that's part of Ubuntu's system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.