[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ipv4 forwarding not working?

Posted on 2010-09-03
3
Medium Priority
?
549 Views
Last Modified: 2013-12-16
I have an ubuntu box setup with two nics: eth0 and eth1. Eth0 is a public IP. Eth0 is a private (192.168.0.0/29) network. Eth0 has dhcp on it, and distributes addresses just fine. Clients can ping the box from that network.

Clients cannot, however, ping public IP addresses like 207.69.188.185 (Earthlink DNS Servers).

I think I do not have ipv4 forwarding setup properly even though it is set to "1".

What's the problem?
michael@box:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.248 U     0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth1
default         2xx.xxx.xxx.xxx   0.0.0.0         UG    100    0        0 eth0

Open in new window

michael@box:~$ sudo sysctl -p
net.ipv4.ip_forward = 1

Open in new window

root@clientbox:/home/fakeuser# ping 207.69.188.185
PING 207.69.188.185 (207.69.188.185) 56(84) bytes of data.

[It does nothing]

Open in new window

root@clientbox:/home/fakeuser# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=1.38 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=1.35 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=1.35 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=1.34 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=0.185 ms
^C
--- 192.168.0.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms

Open in new window

0
Comment
Question by:DrDamnit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Accepted Solution

by:
santoshmotwani earned 2000 total points
ID: 33598065
http://ohioloco.ubuntuforums.org/showthread.php?t=604104

Please see Step 5 in this forum , it will solve your problem.
0
 
LVL 10

Expert Comment

by:ampranti
ID: 33610845
/etc/init.d/networking restart
0
 
LVL 32

Author Closing Comment

by:DrDamnit
ID: 33630442
sudo iptables --table nat --append POSTROUTING --jump MASQUERADE --source 192.168.1.0/24

was the part from step 5 that fixed it.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question