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.

Is it possible to do the following:

Machine1 Kubuntu 8.04 desktop wired internet  Cable modem  
Machine2 eepc701 Xubuntu 1O.04 wired machine1 cross ethernet cable  
Machine3 nokia n900 wireless to machine2  Wifi card machine2 mode master  

Routing tables:

Machine1

192.168.1.0     *               255.255.255.0   U     0      0        0 eth0  
XX.XX.160.0     *               255.255.252.0   U     0      0        0 eth2  
link-local      *               255.255.0.0     U     1000   0        0 eth2  
default         XX.XX-160-1.xxx 0.0.0.0         UG    0      0        0 eth2  

Machine2

192.168.1.192   *               255.255.255.192 U     0      0        0 ath0  
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0  
default         user.local      0.0.0.0         UG    0      0        0 eth0  

Machine3

192.168.1.192   *               255.255.255.192 U     0      0        0 wlan0  

Doing: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

On machine2 , dhcp3 server on machine2 ip adress well delivered to #3

ping #3 -> ath0 ok  
ping #2 -> wlan0 ok  
ping #2 -> #1 ok  
ping #1 -> ath0 ok  

ping #3 -> #2 eth0  network unreachable  
ping #1 -> #3  network unreachable      

Access point is open. What is failing?

share|improve this question
    
What Operating System on Machine 1 and 2? –  William Hilsum Sep 2 '11 at 9:53

3 Answers 3

I have tried to tidy up your question slightly, but, it is very confusing. If you just want to share internet between three machines that are set the way you want, there is no need to mess around with the routing table or subnets. If I have misunderstood, please can you rephrase your question.

Firstly, I would highly recommend you get yourself a Wireless Router. This will save yourself a lot of trouble and it will have extra benefits such as allowing your N900 to work with machine two off.

If you already have a internet cable modem (guessing one ethernet port), get yourself a RJ45/Ethernet router and stick the current modem in to it. You should then be able to share with all the computers without problems.

The more complicated route is, if internet is working fine on Machine one and two, consider just installing a "virtual router" on machine 2 - Options are Virtual Router or Connectify

share|improve this answer
    
I added the OSThanks for the answer. –  gully Sep 2 '11 at 10:46
    
It was a matter tosave the money and use that old eepc and learn in the process. –  gully Sep 2 '11 at 10:48
    
sorry for truncking my answer. So I will take your advice. but I am still wondering why it's not working; –  gully Sep 2 '11 at 10:50
    
by the way I learn a lot ;) –  gully Sep 2 '11 at 10:54

Why you have a subnet mask ending with 192 (/26) that is entirely in an /24?

If you want to use a double NAT, the two ranges must be non-overlapping.

The machine in the bigger subnet (machine 1) will not know automatically that it has to route the packet through machine 2. Machine 1 will only use ARP to find your 192.168.1.192, which will always fail because the latter is not on the wired ethernet. You have to change the routing table on machine 1 so it knows a part of 192.168.1.0/24 is only reachable through machine 2.

An alternative solution is to create a bridge between the wired and wireless network on machine 2 so that IP will think it's one subnet. This is easy to do under Windows, but involves a lot of manually configuration under Linux ( http://www.linuxjournal.com/article/8172 ).

share|improve this answer

A thousand thanks to billc.cn.

As follows:

Machine1

192.168.10.1    *               255.255.255.255 UH    0      0        0 eth0  
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0  
XX.XX.160.0     *               255.255.252.0   U     0      0        0 eth2  
link-local      *               255.255.0.0     U     1000   0        0 eth2  
default         XX.XX-160-1.xxx 0.0.0.0         UG    0      0        0 eth2 

Machine2

192.168.1.0     *               255.255.255.0   U     0      0        0 eth0  
192.168.10.0    *               255.255.255.0   U     0      0        0 ath0  
default         user-local      0.0.0.0         UG    0      0        0 eth0 

dhcpd.conf:

option subnet-mask 255.255.255.0;  
option broadcast-adress 192.168.1.255;  
#next line was the last I changed before singing "Deo Gratias"  
>option routers 192.168.10.1;  
option domain-name-servers 89.2.0.1, 89.2.0.2; 

subnet 192.168.10.0 netmask 255.255.255.0 {  
  range 192.168.10.2 192.168.10.3 
} 
share|improve this answer

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.