forward route from eth1 to eth0

Hi,

I have a laptop that connects to an open wifi network. Now I would like my hardware router, to use this connection.
How can I forward eth1 (wireless network) to eth0 (ethernet) so I can connect my router to eth0 and get a dhcp address from the wireless network?
Get what I would like to do?
I also thought i could setup my notebook as a router but I would like to know if i can forward the route from eth1 to eth0.
Haven’t found anything using google yet…

Thank you!
Ron

Ah i think i figured out that what i need is a proxy. i wanna configure my notebook as a proxy - right?

Thanks!

You’re making it harder than it needs to be.

Set up the laptop as a router, forwarding between eth0 and eth1.

Give the hardware router a static address in the subnet it’s on, don’t bother with DHCP.

So your laptop is just the upstream router for your hardware router.

How do i do this the “easy way” ? :slight_smile:

Thanks!

Do a search on the OpenSUSE wiki for setting it up as a router.

Any self-respecting embedded router will allow you to set the external interface to a static IP address.

Hm, have been trying to figure this out but coudln’t really get it working. It just never routed thru properly. Can anyone help me please?
Thanks a lot!

Well, alright. What I have tried is:
I made a text file with following content

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward 

assuming eth1 is my wlan card and eth0 is my LAN card going to y router. I configured it to 192.168.101.1 and my router to 101.2. I can ping 192.168.101.1 just fine from my workstation that is connected to the router but after executing my text file, I’m not able to ping google.com from eith my workstation or my laptop. Why not? What am I doing wrongly here?
Thanks,
Ron:(

Oh something I didn’t mention: all firewalls are turned off

Okay,

I also tried this version:
I added the line “net.ipv4.ip_forward = 1” to the file “/etc/sysctl.conf” and restarted my network with “/etc/init.d/network restart” and then i issued following commands in a text file:

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE

I connected my router to my notebook and tried to ping google.com from my workstation - negative but I can ping my notebooks networkcard (eth0) that has the address 192.168.101.1 with no problems. So I assume my iptables must be wrong…any one here that can help?

Thank you!

On Thu November 13 2008 09:16 pm, reggler wrote:

>
> Okay,
>
<snip>
>
> I connected my router to my notebook and tried to ping google.com from
> my workstation - negative but I can ping my notebooks networkcard (eth0)
> that has the address 192.168.101.1 with no problems. So I assume my
> iptables must be wrong…any one here that can help?
>
> Thank you!
>
>
Have you set the gateway address to point to your router?

P. V.
Is this on the test?

The router’s gateway address is set to 192.168.101.1 which is the notebook’s ethernet ip address. And the default gateway from my workstation is set to 192.168.0.1 which is the router’s ip address on the lan side. So that should be fine…i don’t know what else is wrong…>:(

On Thu November 13 2008 10:16 pm, reggler wrote:

>
> PV;1895681 Wrote:
>>
>> Have you set the gateway address to point to your router?
>>
>
> The router’s gateway address is set to 192.168.101.1 which is the
> notebook’s ethernet ip address. And the default gateway from my
> workstation is set to 192.168.0.1 which is the router’s ip address on
> the lan side. So that should be fine…i don’t know what else is
> wrong…>:(
>
>
reggler;
Can you ping google by IP (72.14.207.99). If so you only need to set your DNS
to that of your ISP. If not, have you tried taking the router out of the mix
and connecting your desktop directly to the laptop to see if Masquerading is
working. You need to be sure that works first. The rest should be easy.

P. V.
Is this on the test?

On Thu November 13 2008 11:13 pm, PV wrote:
<snip>
>>
>>
> reggler;
> Can you ping google by IP (72.14.207.99). If so you only need to set your
> DNS
> to that of your ISP. If not, have you tried taking the router out of the
> mix and connecting your desktop directly to the laptop to see if
> Masquerading is
> working. You need to be sure that works first. The rest should be easy.
For additional help look here:
http://www.swerdna.net.au/linhowtoics.html

P. V.
Is this on the test?