I have a problem to make a routing table for my PC.

I have 1 pc running on Ubuntu, and i have 2 connection card (eth0 & wlan0). eth0 IP : wlan0 IP: with dhcp-server installed

client with IP: connected to my router wlan0 but not connected to my eth0 network.

How to solve this problem? thanks

1 Answer 1


I see both networks have private IPs so I will assume you just want to route traffic between those two; no firewalling, no traffic control of any kind, no network address translation.

Try doing this:

echo "1" | sudo tee /proc/sys/net/ipv4/ip_forward

then ensure your client ( has its default gateway set to (your Linux box/router).

Once you have this, you should be able to see the other network ( To test this, try pinging the Linux box's address on that network ( You should get a response:

$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_req=1 ttl=64 time=2.30 ms
64 bytes from icmp_req=2 ttl=64 time=1.62 ms

The ip_forward setting tells the Linux kernel to forward packets destined for another network through the appropriate interface. By default it's turned off, meaning that the kernel will discard packets that are asking to be forwarded.

This setting will "reset" itself when you reboot the system, to make it permanent do this:

echo "net.ipv4.ip_forward=1" | sudo tee /etc/sysctl.d/60-ip-forward.conf

This will create a config file with this setting to be loaded when the system boots.

Finally, please read the IP Tables Howto which contains information on how to control how your kernel allows packets to pass through the interfaces, whether it does network address translation, and other things. This is very important if you ever want to have a Linux system sitting between a public network and a private one (and even between two private networks, as forwarding traffic may not always be desired in this case).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .