LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-20-2005, 05:05 PM   #1
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
My gateway can't route


EDIT: I needed this too
Code:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Why do I always notice these things seconds after I post. Mods: I won't be saddened if you delete/merge this thread.

*******************

eth1 is connected to a hub, eth0 to my DLink router through which it accesses the internet. No problems there as I can browse everything from the gateway machine (which I'm on right now).

I can connect a laptop to the hub and it gets an IP address 10.0.0.20, router 10.0.0.1 and subnet 255.255.255.0.

I can connect to 10.0.0.1's httpd but can't route to anything past the gateway like google.com or even 192.168.0.1 (DLink config page). `lynx 10.0.0.20` from the gateway also works.

Given what follows, why the fudge not? I've been racking my brain about this for days and I can't for the life of me figure out why it doesn't work properly. (The dhcp lease time was reduced to 5 seconds for debugging purposes).

Code:
root@gateway:/# cat /proc/sys/net/ipv4/ip_forward
1
Code:
root@gateway:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:09:E9:61:E0
          inet addr:192.168.0.50  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3088 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2015 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1293423 (1.2 Mb)  TX bytes:318924 (311.4 Kb)
          Interrupt:10 Base address:0x4000

eth1      Link encap:Ethernet  HWaddr 00:11:09:E9:61:E1
          inet addr:10.0.0.1  Bcast:10.255.255.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:411 errors:0 dropped:0 overruns:0 frame:0
          TX packets:170 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:58204 (56.8 Kb)  TX bytes:40497 (39.5 Kb)
          Interrupt:3 Base address:0xe000
Code:
root@gateway:/# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.255.255.0   U     0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
default         192.168.0.1     0.0.0.0         UG    1      0        0 eth0
Code:
root@gateway:/# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Code:
root@gateway:/etc# cat dhcpd.conf
ddns-update-style none;
default-lease-time 5;
max-lease-time 5;

subnet 10.0.0.0 netmask 255.255.255.0 {
        option routers 10.0.0.1;
#       option subnet-mask 255.255.255.0;
        option domain-name-servers 206.47.244.12, 206.47.244.42;
        option ip-forwarding on;
        range 10.0.0.10 10.0.0.20;
}
And, aplty:
Code:
root@gateway:/# fortune
Command, n: Statement presented by a human to a computer in such
     a manner as to make the human feel as if he were in control
Though I don't much feel it at the moment.

This is a continuation from this thread ( http://www.linuxquestions.org/questi...hreadid=312125 ).

I know it's bad practice to double post but the old thread was...less than pretty and contained lots of outdated and confusing information on my part.

I also claimed I found an answer by restting the netmask of eth1 to 255.255.0.0 which doesn't work. That means I stumbled upon the answer by a fluke I haven't been able to reproduce.

Last edited by michaelsanford; 04-20-2005 at 05:10 PM.
 
  


Reply


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
How do I keep gateway route across restarts? moonmoth Linux - Networking 3 09-04-2005 07:35 AM
default route without a gateway scylla Linux - Networking 1 10-21-2004 01:40 AM
/sbin/route -n and defautl gateway shanenin Linux - Networking 1 02-05-2004 01:10 PM
Route and Gateway Issues shaggz Linux - Networking 2 10-29-2003 12:33 PM
Ip Route Voice Gateway digicom Linux - Networking 1 08-22-2001 10:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:57 AM.

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
Open Source Consulting | Domain Registration