Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to build a network that consists of 3 PC's: a Client, a Server and an Intermediate. Client connects with intermediate wirelessly while Server connection with Intermediate is wired. So Intermediate has wired and wireless card.

Although when I PING the Client for Server I get error message: Unreachable destination. I used different networks for wired and wireless, for wired I used 192.168.1.0 while for wireless I used 192.168.2.0.

Notice that I use Ubuntu 13.04. Can someone please help me solving this problem?

share|improve this question
    
Please flesh out your question with info on how you set up 'Intermediate' to bridge the wired-to-wireless connection. Also, I believe that your IP assignments will not work: your ending octal should be greater than '.1' for each connection. '.0' is a generic Class C network host address and '.1' is typically reserved for routers/DHCP servers. –  douggro May 15 '13 at 19:26
    
(S)He's mentioning the networks that the PCs are in, not their assigned IPs. –  Alaa Ali May 15 '13 at 19:40
    
Recommend reading this 2 posts: askubuntu.com/questions/171914/… AND askubuntu.com/questions/16584/… You will learn there how to configure your wireless and wired connection between computers (Client-Client, Client-Server) and how to share your internet connection. –  Luis Alvarado May 15 '13 at 19:46
add comment

1 Answer 1

Yes, you will not be able to ping from the client to the server. This is because those two PCs are on two different networks (or subnets), and the "intermediate" PC is not configured to forward packets; in other words, the intermediate PC is not configured to act as a router, to route the packets between those networks.

Now, I haven't done this before, but I have an idea on how you would be able to do it, so this answer is not going to be a straight forward enter-these-commands answer, but more about explaining what should be done. You'll have to do some reading to get to what you want to do.

So, first of all, you'll need to enable IP forwarding. This can be done by putting the value "1" in a specific file. You'd do this by the following command:

echo 1 > /proc/sys/net/ipv4/ip_forward

This tells the PC that it will be forwarding packets. But from where to where? Which protocols to allow? What are the rules?

The answer to those questions will be done through the utility iptables. These are the rules that configure the firewall in Linux. So for example, you use iptables to indicate that you need NATing, or to restrict access to a subnet, or to forward packets from one interface to another. An iptables command looks like this:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

I don't really know what this command means, but I guess it means "do NATing when the output is eth0".

Now, this is the part where I don't know what commands will accomplish what you want to do, so you need to do some reading. I recommend carefully reading and understanding this: Internet/Connection Sharing, and you should focus on the Gateway set up section.

share|improve this answer
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.