LinuxQuestions.org
Help answer threads with 0 replies.
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 10-02-2006, 10:01 PM   #1
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Rep: Reputation: 30
accessing local webserver from inside LAN using FQDN


Hi all,

I have a LAN like this:

VLANs (172.20.10.0 - 172.20.60.0)---> CORE SWITCH ---> ROUTER+SQUID ---> MODEM/GATEWAY ---> INTERNET

ROuter IP is 172.20.30.1 and xxx.xxx.xxx.xxx (public ip). Core switch IP is 172.20.10.254 - 172.20.60.254. The webserver IP is 172.20.30.10

The core switch acts as a gateway for communication between VLANs. There's a webserver in one of VLAN that can be accessed from outside using NAT setup on router. All clients in each VLAN can connect to the internet. One problem is, all clients in the same VLAN as the webserver cannot access the webserver using FQDN like www.mywebserver123.com but clients in other VLAN can.

In router I set this:

iptables -t nat -I PREROUTING -d www.mywebserver123.com -p tcp --dport 80 -j DNAT --to-destination 172.20.30.10

The commands for routing table setup for the router:
route add -net 172.20.30.0 netmask 255.255.255.0 eth0
route add -net 172.20.30.0 netmask 255.255.255.0 gw 172.20.30.254 eth0
route add -net 172.20.20.0 netmask 255.255.255.0 gw 172.20.30.254 eth0
route add -net 172.20.10.0 netmask 255.255.255.0 gw 172.20.30.254 eth0
route add -net 172.20.40.0 netmask 255.255.255.0 gw 172.20.30.254 eth0
route add -net 172.20.50.0 netmask 255.255.255.0 gw 172.20.30.254 eth0
route add default gw xxx.xxx.xxx.xxx

xxx.xxx.xxx.xxx is public ip.

Another question: Is it ok to set the IP of router = 172.20.30.1 or should I set a private IP that's not in any VLAN?

Any advice appreciated. tq
 
Old 10-06-2006, 04:04 AM   #2
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
any advice appreciated
 
Old 10-07-2006, 06:50 PM   #3
ARC1450
Member
 
Registered: Jun 2005
Location: Odenton, MD
Distribution: Gentoo
Posts: 290

Rep: Reputation: 30
Do you ahve an internal DNS server? If so, just create a view and it's easy.

You're not routing in the VLAN of the web server, so having your router tell the clients where the webserver is probably isn't going to do much. The router looks at the netmask and if the address you ask it for is included within that netmask, it won't touch it. So putting the router off in it's own VLAN may work.
 
Old 10-07-2006, 10:43 PM   #4
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
thanks for the answer. I have thought of changing the router IP to different VLAN/LAN. besides it doesn't make sense to have IP one of VLAN as if it is one of the clients but in fact it is not. I try to change the IP first to something different but how's the routing gonna be? I'm confused.
 
Old 10-12-2006, 08:36 PM   #5
zamri
Member
 
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by ARC1450
Do you ahve an internal DNS server? If so, just create a view and it's easy.
In second thought, how to create a view in internal DNS?
 
  


Reply

Tags
gateway, iptables, lan, prerouting, routing, vlan



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
router issue (accessing local webserver) FliesLikeABrick Linux - Networking 4 11-25-2005 11:43 AM
Can access local LAN Webserver, but not Internet spaceuser Debian 11 08-23-2005 12:54 AM
Setting up a webserver inside a lan, which should be accessible from outside seidren Linux - Networking 2 05-18-2004 08:26 AM
newbie setting up lan - can't see local webserver. nmoog Linux - Networking 1 03-27-2004 11:17 PM
what should i set a local FQDN to? vrillusions Linux - Newbie 1 02-09-2003 03:32 AM

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

All times are GMT -5. The time now is 06:28 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