Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an eee running ArchLinux with wireless access to the Internet. I want to use it as the WAN input for an Asus RT-G32 router into which it is hardwired. The router in turn is hooked up to a 64-bit Windows PC for which I cannot obtain a wireless NIC.

Can someone explain, in general, (1) the iptables rules to be set on the eee which are required to share Internet connection with the router, and (2) the router settings required to use the eee as the WAN connection?

Note: IP of the eee is 192.168.1.x and the router is assigning subnet of 192.168.x.x, so I need instructions on how to ensure there are no IP 'collisions'.

share|improve this question
add comment

1 Answer

Is this right your network topology?

PriveNet--->AsusRouter---->eee ---wireless-----> >---Internet

If right, eee and AsusRouter may be haved ip address of 192.168.1.x.

In example,

192.168.x.x---> (192.168.x.x)AsusRouter(192.168.1.2)--->(192.168.1.1)eee(GlobalIP A)---->Internet

In this case,

(1) iptables setting in eee

If the network card name of ip 192.168.1.1 is eth0 and the network card name of GlobalIP A is eth1, use the following command. (network card name will be verified with 'ifconfig' command.)

iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source GlobalIP A

If GlobalIP A isn't static ip, may be use the following.

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

(2)route setting in AsusRouter

eee is default gateway of AsusRouter. So you must set default route in AsusRouter.

route add default gw 192.168.1.1

share|improve this answer
    
Yes, you mapped it out right. I will check out your rules, but was wondering, do I hook the eee to the WAN port of the Asus router, or just one of the numbered ports and set up the Windows machine to use eee as proxy? –  Stephen Oct 6 '11 at 13:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.