LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-10-2003, 06:35 PM   #1
Dirt
Member
 
Registered: Feb 2002
Location: St. Louis
Distribution: Red Hat 8.0
Posts: 30

Rep: Reputation: 15
Angry Can ping LAN but cant access internet.


I need some help.

I just set up linux 8.0 on a new server. I can ping the whole lan but I cant get it to ping anything on the internet either by IP or by NAME. Ive killed IP tables. I think it has to do with my gateway, I dont know the first thing about gateways.

Here is my route -n

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.16.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.16.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

Here is my ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
BROADCAST=172.16.1.255
IPADDR=172.16.1.37
NETMASK=255.255.255.0
NETWORK=172.16.1.0
ONBOOT=yes

Here is my ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
BROADCAST=172.16.1.255
IPADDR=172.16.1.35
NETMASK=255.255.255.0
NETWORK=172.16.0.0
ONBOOT=yes


Any Ideas? My default gateway is 172.16.0.1 im pretty sure. Another question... why is there 2 eth1's listed in the route -n?

Oh yeah..

I just tried..

route add default gw 172.16.0.1

same results
Dirt

Last edited by Dirt; 08-10-2003 at 06:50 PM.
 
Old 08-10-2003, 08:09 PM   #2
Dirt
Member
 
Registered: Feb 2002
Location: St. Louis
Distribution: Red Hat 8.0
Posts: 30

Original Poster
Rep: Reputation: 15
ok here is my progress...

I configured with netconfig...did a route -n

Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.16.0.1 0.0.0.0 UG 0 0 0 eth0

My eth0 disappeared? or did it? Here is my ifconfig...Its still there!


eth0 Link encap:Ethernet HWaddr 00:02:B3:B0E:97
inet addr:172.16.1.37 Bcast:172.16.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1301 errors:0 dropped:0 overruns:0 frame:0
TX packets:1122 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:538063 (525.4 Kb) TX bytes:176831 (172.6 Kb)
Interrupt:11 Base address:0x7000

eth1 Link encap:Ethernet HWaddr 00:02:B3:B0E:7E
inet addr:172.16.1.35 Bcast:172.16.1.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:48 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:2016 (1.9 Kb)
Interrupt:11 Base address:0x9000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2597 (2.5 Kb) TX bytes:2597 (2.5 Kb)

I bring down eth1 with ifdown

and then I can connect to the internet fine. but I show this now...weird

Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.16.0.1 0.0.0.0 UG 0 0 0 eth0

Anybody seen this before? Where is eth0? The gateway is there...

Last edited by Dirt; 08-10-2003 at 08:12 PM.
 
Old 08-11-2003, 02:45 AM   #3
Vengenc
LQ Newbie
 
Registered: Aug 2003
Posts: 13

Rep: Reputation: 0
I take it you're trying to setup the linux machine to forward internet requests for your lan.
Basically you want to use the linux box as a router. I do the same thing. I have to assume a few things.

you have eth1 and eth0. One connects to your internal lan and one connects to your ISP's high speed line.

You have a static IP address from your ISP. Usually this means you have a router of some sort. (easy to handle)
OR
You have a dynamic address assigned by a pppoe server. Usually you get a modem of some sort. (harder to handle)

Your 172.16.xxx.xxx addressing scheme works fine inside your network BUT you cannot make requests through your linux machine with those addresses.
these are called non-routed IP addresses meaning the will not pass a router. they will only be dropped. So one of your ethernet cards is not setup correctly to start with.

First things first. Get your internet connection working.

If you use a static IP this is just a matter of setting the correct ethernet card to get an address by DHCP (usually the case) or setting up the connection using the info your ISP provided.(Some times the case)

If you use pppoe then you have to go get rp-pppoe from roaringpenguin.com and get it installed (follow the install docs, pretty straight forward.)

when you get that done you should be able to surf the internet once you add your ISP's dns servers ot /etc/resolv.conf.

NOTE: with a static IP your default gateway is your routers IP address. With pppoe your default route will usually be the inet addr of the ppp0 device (not the P-t-P address)

Now your linux machine can reach the internet and the lan. Onwards and upwards.

to make it so your internal lan PC's can hit the internet you need to setup the linux machine to act as a router. You do this by setting up IP Forwarding and IP Masguerading. This is handled by iptables. You will want to setup a firewall which will incorperate killing unwanted incoming requests and forward traffic for your lan. You can find this on the internet as well. If you get to the point where your internet connection is up and you can still see your lan go out and read up on firewalling with iptables and get it in place.

Vengenc
 
  


Reply



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
Internet problems on LAN, cant ping certain websites, help please lurker Linux - Networking 2 07-17-2004 10:29 AM
SuSE 9.0 can browse LAN, ping router...cannot get on the internet tmlayton Linux - Networking 5 06-30-2004 02:43 AM
New server on my work lan, cannot ping to it on get on internet. leejenson Linux - Networking 2 11-13-2003 11:35 AM
Can't Ping or Access ftp sites from LAN vk1985 Linux - Networking 1 03-03-2003 12:26 AM
HELP ME!!! Can ping my sever box but can't access the internet elkrammer Linux - Networking 1 08-03-2002 10:15 AM

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

All times are GMT -5. The time now is 03:44 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
Open Source Consulting | Domain Registration