LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 10-22-2011, 09:50 AM   #1
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Rep: Reputation: 8
IP forwarding won't work


Hello,

I want my Linux Ubuntu Server act as an internal router, so routing between two local subnets, no NAT.

This is what I have:
/etc/network/interfaces
Code:
auto eth0
iface eth0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

auto eth1
iface eth1 inet static
        address 172.16.0.1
        netmask 255.255.0.0
        network 172.16.0.0
        broadcast 172.16.0.255
route
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
172.16.0.0      *               255.255.0.0     U     0      0        0 eth1
default         192.168.1.1     0.0.0.0         UG    100    0        0 eth0
I have no IPTABLES configured:
Code:
Chain INPUT (policy ACCEPT 39642 packets, 1707K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 6 packets, 288 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 39796 packets, 19M bytes)
 pkts bytes target     prot opt in     out     source               destination

Output of the sudo cat /proc/sys/net/ipv4/ip_forward

1

I also configured the dhcp server to only listen on interface eth1.
When I connect my laptop to the server, I recieve following IP address:
address: 172.16.0.2
mask: 255.255.0.0
gateway: 172.16.0.1
DNS: 172.16.0.1

I can ping the eth1 interface:
ping 172.16.0.1 => success!

I ALSO can ping the eth0 interface: (still from the same laptop)
ping 192.168.1.2 => success!

But when I attached another laptop using static IP at eth0, I'm UNABLE to connect...
ping 192.168.1.5 => fail!

So apperantly, it does not forward the packets...
What am I doing wrong?

Here's a scheme:
Internet -> NAT router -> network 1 -> eth0 LINUX ROUTER eth1 -> network 2

Thanks!
 
Old 10-22-2011, 10:22 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate. Please, continue here: http://www.linuxquestions.org/questi...arding-909519/
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Port forwarding (DNAT) won't work hooba Linux - Networking 1 06-04-2011 03:21 PM
SSH won't run X forwarding raypen Linux - Software 2 05-17-2008 06:35 PM
IP Forwarding won´t work tiuz Slackware 5 04-27-2006 09:20 PM
Transparency in Aterm won't work, fbsetbg won't set previous background rob0t Slackware 2 08-13-2005 07:37 PM
Port forwarding simply won't work.. RoaCh Of DisCor Linux - Hardware 9 12-23-2004 06:07 PM


All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration