1

I have been trying this setup for weeks and still can not make this to work...

ubuntu 12.04 64 bit with 2 nic

nic1: eth0:192.168.2.33 -static ip with internet access (connected to modem)

nic2: eth1:192.168.1.2 -static ip connected to LAN.

enabled ip_forward on ubuntu box net_ip_forward = 1

on the LAN with ip address 192.168.1.5 specified gateway as 192.168.1.2 and able to ping gateway.But can not ping public address.What am i missing? on router box:

route -n

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

0.0.0.0         192.168.2.1     0.0.0.0         UG    100    0        0 eth0

192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1

192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

tried

ip route add 192.168.2.0/24 via 192.168.1.2 dev eth0

route -n on LAN 192.168.1.5

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

0.0.0.0         192.168.1.2     0.0.0.0         UG    100    0        0 eth0

192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

192.168.2.0     192.168.1.2     255.255.255.0   UG    0      0        0 eth0

iptables default policy is to accept all.

tracepath 8.8.8.8 from LAN

  1:  192.168.1.5                                           0.060ms pmtu 1500

  1:  192.168.1.2                                           3.367ms 

  1:  192.168.1.2                                           3.764ms 

   2:  no reply

Is there a way to make this work,other than NAT ing.

1 Answer 1

1

192.168.2.1 is not a public address either. What box is that? Does it know how to route traffic back to 192.168.1.5? Does it do NAT for networks other than 192.168.2.0/24?

5
  • 192.168.2.1 is a D-link router connected to a modem.It doesnt know abot 192.168.1.0/24 network.
    – Blue Gene
    Commented Oct 15, 2012 at 7:53
  • 1
    There's your problem then.
    – ptman
    Commented Oct 15, 2012 at 7:54
  • Can u please guide me with fixing this.When i used clear os.It worked with out much effort.All i did was specified 192.168.2.1 as external in the graphical mode.But with Ubuntu i am stuck./
    – Blue Gene
    Commented Oct 15, 2012 at 7:57
  • It's not ubuntu that needs configuring, it's the d-link router.
    – ptman
    Commented Oct 15, 2012 at 9:58
  • x2 - your D-Link needs a static route to 192.168.1.0/24 via 192.168.2.33. Make sure your D-Link also is set to NAT both subnets.
    – rnxrx
    Commented Oct 15, 2012 at 17:49

You must log in to answer this question.

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