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 05-21-2001, 03:00 PM   #1
yskwong
LQ Newbie
 
Registered: May 2001
Posts: 3

Rep: Reputation: 0

2 NICs, 2 external IP's (1 behind a router):

I have a Linux PC setup as a standalone machine, running RedHat 6.2 Professional. It has an ethernet connection eth0 and is connected to the web via an external IP (say 24.65.xxx.xxx).

For some reasons, I need to provide a way for PCs on an internal office LAN to access this Linux PC as a special server. The PCs on internal LAN are connected together via a Linksys Cable/DSL Router (BEFSR81 with an integrated 8-port 10/100 switch), which provides both a switch for the LAN and a connection to the web via another separate external IP (say 24.68.yyy.yyy).

So I put in another NIC into the Linux PC, and configured it as eth1 to connect to the internal LAN via the Linksys router/switch. The Linksys router is setup with DHCP disabled, and IP addresses for PCs on the LAN being assigned manually: the router with an internal IP of 192.168.1.1, eth1 of Linux PC with an internal IP of 192.1.30, and a Windows 2000 PC on the LAN with an internal IP of 192.168.1.10.

On reboot all PCs and router, everything seems to working fine with the following expected behavior:

1. From the Linux PC:
a. I can browse external web sites via eth0 through external IP 24.65.xxx.xxx
b. I can talk to a Windows 2000 PC on LAN via eth1, look at its web site thru http://192.168.1.10/ or an internal name assigned via /etc/hosts.
2. From an external PC outside the LAN:
a. I can browse the Linux PC through a domain name mapped to 24.65.xxx.xxx (the IP for eth0).
b. I can browse the Windows 2000 PC via another domain name mapped to the routerís external IP 24.68.yyy.yyy, with port 80 forwarded to this particular PC.

However, after running for a while, things seem to go wrong for no particular reasons that I know of:
1. From the Linux PC, when I browse an external web site (that reports on your originating IP address), I find that I am accessing thru eth1 and the router, as the external site is reporting my router external IP address.
2. From an external PC, I can no longer access the web server on the Linux PC, associated with the domain name mapped to 24.65.xxx.xxx (the IP for eth0).
3. Sometimes, even the web site on the Windows 2000 PC associated with the router external IP 24.68.yyy.yyy is not accessible.

On rebooting the Linux PC, everything is then back to normal, with expected behavior as described in the preceding paragraph.

QUESTIONS ARE:

1. What is causing the Linux PC to switch to using eth1 (from eth1) on accessing the Internet? Any workaround?
2. Why are the domain names or the external IPís associated with Linux PC and the router can become inaccessible? Any workaround?

Thanks for any assistance you might offer!
 
Old 05-21-2001, 04:27 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,457
Blog Entries: 54

Rep: Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897
Cant lay my finger on it but I think its routing/metric.
I would try adding default static routes for external connection tru eth0, and another default route set up for accessing LAN tru eth1.
Curious if this would make a difference.
 
Old 05-23-2001, 10:25 AM   #3
yskwong
LQ Newbie
 
Registered: May 2001
Posts: 3

Original Poster
Rep: Reputation: 0
Hi: Thanks for the suggestion. Can you help with how to add the default static routes you suggested?

When I do a "route" command, the Kernal IP table is as follow on bootup when things are working as expected.

It remains the same on issuing another "route" command when the PC no longer has the expected behavior. At this point, I can no longer reached the web server of this PC from an external PC on browsing either with its external IP: 24.64.145.54, or thru its domain name. But I can still ping the IP or domain name with response.

Kernal IP Routing Table

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.30 * 255.255.255.255 UH 0 0 0 eth1
24.64.145.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
default 24.64.145.1 0.0.0.0 UG 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 1 0 0 eth1

 
Old 05-23-2001, 10:38 AM   #4
#!
Member
 
Registered: May 2001
Distribution: RedHat, 'drake, suse, slack, gentoo, beehive, lfs...
Posts: 43

Rep: Reputation: 15
Hi,

I think your problem is that you need to download a patch from the Linksys site that fixes a bug prevalent in those routers. The bug fits the description of your situation. One person I know said that after awhile, it just stopped messing up on him

Good luck.
 
Old 05-24-2001, 09:43 AM   #5
yskwong
LQ Newbie
 
Registered: May 2001
Posts: 3

Original Poster
Rep: Reputation: 0
Hi:

I tried the suggestion the problems might be due to Linksys router. I upgraded the Linksys router to the latest version of firmware dated May, 2001. The problems did not go away. So I guess it is not due to the router. Thanks anyway.
 
Old 05-25-2001, 07:22 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,457
Blog Entries: 54

Rep: Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897
I think it goes like this.
for lan network over device:
/sbin/ifconfig eth0 inet (net.wrk.adr) netmask (netmask)
/sbin/route add -net (net.wrk.adr) netmask (netmask) dev eth0
*i dont know if this needs adding a default gw, so try.
for ext network over device:
/sbin/ifconfig eth1 inet (net.wrk.adr) netmask (netmask)
/sbin/route add -host (gw.ip.adr) eth1
/sbin/route add default gw (gw.ip.adr) netmask (netmask) dev eth1
plz consult man route on this ok...

if uve got it these lines ok, they could be entered into
/etc/sysconfig/static-routes, or run off a runlevel script or network start/ifup script.

check if uve got gated/routed running,
they might also be culprits in changing routes...

HTH...
 
  


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
ssh connection refused for external IP's Pleonast Linux - Networking 2 11-08-2004 12:00 PM
firewall for 5 external ip's boeing9379 Linux - Networking 2 10-10-2004 12:45 AM
internal box to external IP's? TigZy Linux - Networking 4 09-29-2004 06:39 PM
My laptop receives an IP via DHCP, but can't ping router or outside IP's! Max P0wer Linux - Networking 12 08-17-2004 05:45 PM
Unable to reach external IP's and URL's louisb Linux - Networking 6 08-19-2003 08:45 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration