Internet connexion sharing
- Inicie sesión ou rexístrese para enviar comentarios
Hello everybody,
I spent some hours trying to share my Internet connexion with another computer, unsuccessfully, unfortunately.
Here follows the situation I've arrived to after trying several solutions I've read on the Web. I have one computer (under Trisquel; let's call it Computer 1) connected to Internet via Wi-Fi (wlan1 interface). On this computer, there is also an ethernet (eth0) interfacewhich is connected to a router. On this router, my second computer (under Debian; let's call it Computer 2) is also plugged in.
The network interfaces of Computer 1 are configured graphically with Network-Manager. The wireless interface (wlan1; configured as the default one) is configured with thsese settings: IP address: 192.168.2.102; broadcast address: 192.168.2.255; subnet mask: 255.255.255.0; default route: 192.168.2.1; primary DNS: 192.168.2.1. The wired interface (eth0) is configured this way: IP address: 192.168.1.21; broadcast address: 192.168.1.255; subnet mask: 255.255.255.0; default route: 192.168.2.102; primary DNS: 192.168.2.102. In Network-Manager, the interfaces are configured manually.
The network interface of Computer 2 is configured via the /etc/network/interfaces. This one contains the lines below (so, it is configured with a fixed IP address: 192.168.1.22). This computer can only ping theses addresses: 192.168.1.1 (the router), 192.168.1.21 (the wired interface of Computer 1) and 192.168.2.102 (the wireless interface of Computer 1). But it can't ping 192.168.2.1 or an address on Internet.
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.22
netmask 255.255.255.0
broacast 192.168.2.255
gateway 192.168.2.102
dns-nameservers 192.168.2.102 8.8.8.8
Here, I can't see what else to try without installing an other package (I prefer avoiding it). If someone sees how to reconfigure my network to let Computer 2 access Internet, I would be happy to know it!
You might not have forwarding enabled. You can try this:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
This is necessary to route packages between two network interfaces. Keep in mind that when you restart the system the changes will be lost. And there are also security implications so you might want to research firewall settings that would work for you before enabling this permanently.
Thanks for replying. I tried it, but it unfortunately didn't work.
Isn't connexion an archaic spelling? I've never seen it actually used in the
modern day.
A quick look to Wiktionary suggests that it's a contemporary French spelling. Julius22's profile page confirms he's French.
I can't speak for your current setup but it generally works like this: Have two interfaces on machine 1 (eth0 to Internet, eth1 is unconnected) and bridge them, then configure the bridge (br0) on machine 1 to connect to the Internet - plug in machine 2 to eth1 and it'll go straight to the Internet as a kind of pass through. Machine 2 may be a router or switch.
Now the problem may be that you want to connect both machines together, instead of both to the Internet. My setup allows this as when I say 'Internet' I mean 'modem/router the house uses' which supports DHCP, so machine 1 and machine 2 both connect to the router and can see each other.
I will try what you wrote. In fact, I had in mind to keep my two wired interfaces (one for each computer) on the same subnetwork. But, after re-tinking about it, it might not be useful as I would only prefer that my computer which has not yet access to Internet keeps the same IP address. In fact, if it can have access to Internet and be accessible to the other computers, it's OK for me. And the end of your message suggests that it would work in my case as both wired interfaces are connected via a router.
I tried your solution, but still with no luck. I tried it with a Trisquel Mini live CD that was connected via DHCP. The computer could only ping the router.
I also tried to change the sub-network for my computer that I want to connect at the 192.168.1.22 address. I configured it (and the first computer and the router) to be on the 192.168.10.x sub-network. I tried it because the box used to connect to Internet has the 192.168.1.1 address, as my router had. I thought it could be helpful to separate thing well.
The second computer (connected to the router via DHCP, using a Trisquel Mini live CD) can ping the router and the first computer. But not an address on the Web.
Do you think it woud be better to use the /etc/network/interfaces file to configure the wired interface on the computer which is connected to Internet instead of Network-Manager?
I'm unsure, sorry. I just treat the bridge as a passthrough and use the same subnet for all computers on the network. I have a router/modem combo and all the computers connect to it in the 192.168.0.x range using DHCP.
I don't understand what yoour trying to do. You want to share the connection and you conect the computer to the router and you don't want the router gives you Internet but another computer give Internet to that other??
What are the purposes of PC1 and PC2 (call them this way from now on it's shorter)? What do u want they do? There r more computers?
My problem is that my access to Internet is from PC1 (by Wi-Fi). I want to share this access to Internet with PC2. I may want to connect another PC to my network one day. So, I want to use my router to share the access to Internet.
But I may try to connect PC1 and PC2 directly, avoiding the router from the problem, even if it's not what I initially wanted. Someone told me it should be easier to configure.
PC1 is my "normal" PC. PC2 is used for MythTV (it needs access to Internet for upgrading purpose, mainly; and I need to connect to it from my home network in order to use MythTV remotely).
Does my reply answer your questions?
I think I solved my problem. On PC1, I configured my wired interface (eth0) to be shared with other computers and connected it to the Internet port of my modem-router. I configured the latter one to be on the 192.168.10.x subnetwork (instead of 192.168.1.x). Then, PC2 was able to get access to Internet (with a DHCP or static configuration). Maybe, the problem was that the original Internet access point (by Wi-Fi on PC) had the same IP address (192.168.1.1) as the modem-router…
- Inicie sesión ou rexístrese para enviar comentarios