How to share Internet Access through ethernet cable
Hi, my question here is : How to share Internet Access through ethernet cable
I have connect 2 machines trhough en ETH cable by success (ping each other, up/down load files, ssh ). So, now, i want to share my wirelless internet connection. Here is my setup : Code:
Code:
Destination Gateway Genmask Flags Metric Ref Use Iface Code:
ping -I wlan0 -c 1 10.10.10.10 : error ! PS: i would like to do it, not through the NetworkManager thanks |
Hi. You will have to set up IP masquerading with NAT (Network Address Translation) on your local gateway box (i.e. "pc-2"), so that connections coming from "pc-1" and directed to hosts on the Internet will be automatically forwarded from the internal (10.10.10.10) to the external (192.168.1.64) interface. This is possible by defining rules with the "iptables" command, which is part of netfilter, the default firewalling and packet filtering software on GNU/Linux systems. There are also several front-ends for iptables that can help with setting up the rules (one or more front-ends might already be included in your distribution).
Some related documentation: Documentation about the netfilter/iptables project IP Masquerade and Network Address Translation Linux IP Masquerade HOWTO Linux 2.4 NAT HOWTO Regards |
Why are you proposing the configuration shown? Why not use a router? We have a variety of devices that can simultaneously connect to the internet through a router (24/7). One limitation of your configuration is that pc-2 would have to be on in-order for pc-1 to have Internet access. This reminds that Microsoft Windows Version ??? (circa 1990 something) which used to have the option of designating one computer as a "gateway" so that other computers on the home LAN could access the internet. Anyway, beyond the advice of using a router, I do not have the technical knowledge you are requesting.
|
Quote:
|
It was a great drawing for a first time question too.
Pretty sure Philip Lacroix has the solution that you asked for. Since you say manager, see alt solutions here maybe. https://help.ubuntu.com/community/In...nectionSharing |
this is what i do:
http://www.linuxquestions.org/questi...6/#post3804866 |
1st of all, iwant to thanks all that reply.
I use Linux in both machine (Debian,kernel 3.12.6) i still read the documentation that 'Philip Lacroix' points to, its more than full ... because some already examples, found on net dont work in my case (or maybe i do something wrong ...) Like, in 'schneidz's example , if i set the gateway of an iface, at an address on a different network, the (route, ip route,..), dont accept this by error : "interface unreachable" ie: Code:
route add -net 10.10.10.0 netmask 255.255.255.0 gw 192.168.1.254 dev eth0 i think that to enable ip4-forwarding by the echo command, before or after the route/iptable commands, have a meaning in the way, the above commands acts..., Is this true, or not ? I read the posts, but i will post again when i will have something to say, or when solved, dont think my silince as ignorance. Thank's |
How to share Internet Access through ethernet cable. DONE.
Quote:
but Code:
route add default gw 192.168.1.254 according to the settings in my 1st post; 1) set the deafult gateway on the pc-1, points to the 'eth0' interface of the 'pc-2' 2) run a small script of iptables rules, for 'pc-2' 1) Code:
route add default gw 10.10.10.10 Code:
#!/bin/bash Code:
You can add this code to '/etc/rc.local' :hattip: ... really thanks, everyone, here ! |
All times are GMT -5. The time now is 11:04 AM. |