?
Solved

ipv4 forwarding not working?

Posted on 2010-09-03
3
Medium Priority
?
548 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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

765 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