Re: Achieving what's done by Microsoft's "Internet Connection Sharing"
- From: Tomás Ó hÉilidhe <toe@xxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 06:30:10 -0700 (PDT)
Jurgen Haan
From the console, all you need is two set up ethernet devices, ip
forwarding, a default gateway and iptables.
eth0: 192.168.1.1
wlan0: 10.10.10.1
ifconfig eth0 192.168.1.1 netmask 255.255.255.0
ifconfig wlan0 10.10.10.1 netmask 255.255.255.0
OK done. . .
Routing without nat. Well, that subject only uses the route command.
You just need to tell those networks where they can locate eachother.
(Important to keep in mind, for every route one way, a route back is
needed. It's useless for packets to know where to go, if the packets
that need to go back don't know which way to go.)
$ route add 192.168.1.0/24 gw 192.168.1.1
$ route add 10.10.10/24 gw 10.10.10.1
I thought routing tables were strictly to do with *sending* packets
rather than receiving them. When eth0 receives a packet with an IP
address other than its own, how will it know that it has to route it
thru wlan0?
Source routing is quite simple too:
$ iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j SNAT -o wlan0
--to-source 10.10.10.1
I did not test these commands, so there might be a typo somewhere. But
this should be the general idea (if I get your question right).
Thanks for that
.
- Follow-Ups:
- Re: Achieving what's done by Microsoft's "Internet Connection Sharing"
- From: Jurgen Haan
- Re: Achieving what's done by Microsoft's "Internet Connection Sharing"
- References:
- Achieving what's done by Microsoft's "Internet Connection Sharing"
- From: Tomás Ó hÉilidhe
- Re: Achieving what's done by Microsoft's "Internet Connection Sharing"
- From: Jurgen Haan
- Achieving what's done by Microsoft's "Internet Connection Sharing"
- Prev by Date: Re: Two Network cards
- Next by Date: Re: Achieving what's done by Microsoft's "Internet Connection Sharing"
- Previous by thread: Re: Achieving what's done by Microsoft's "Internet Connection Sharing"
- Next by thread: Re: Achieving what's done by Microsoft's "Internet Connection Sharing"
- Index(es):
Relevant Pages
|