LinuxQuestions.org
Visit Jeremy's Blog.
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 05-23-2004, 01:50 AM   #1
gjmwalsh
Member
 
Registered: Jul 2003
Location: Victoria, British Columbia
Distribution: Mandriva 2010 (cooker) with Bind9, Sendmail, Postgresql and Apache2 servers
Posts: 63

Rep: Reputation: 15
routing problem with 2 static (external) IPs


I have 2 static IPs, the first one is 142.179.101.34, netmask 255.255.248.0, through interface eth0, and the second is 142.179.101.35, netmask 255.255.248.0 through I/F eth1. Hardware wise, the highspeed ADSL line runs from the D-Link DSL 300G to a hub, which then sends the traffic to the appropriate ethernet card.

This should be very straightforward, but the routing table becomes messed up when the second IP is added. 142.179.101.34 is the main internet connection and has worked well in the past. But when the second IP is added, the router table shows 2 lines for destination network 142.179.96.0, both via eth1, whereas it should show one route to that network through eth0 (the origional one) and the new one via eth1.

As an apparent result of this, traffic gets through for 142.179.101.34 in both directions but 142.179.101.35 while pingable from 'inside' cannot be reached from the internet. I know I have to check through shorewall/iptables but I see no point in going through that if the basic routing is incorrect.

The only thing I have tried is to change the mask for the second IP to 255.255.0.0 which
creates a route to network 142.179.101.0. While this looks good at my end, I have no idea what I might be opening myself up for at the internet end.

FWIW, this is made necessary by the requirement to address secure virtual hosts by IP rather then by name because of the way ssh handles its work with Apache. (ie: I'm not really trying to make things difficult for myself!)

Can anyone shed some light in this for me??
 
Old 05-23-2004, 04:22 AM   #2
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
Be more specific.

You are writing about 2 external IPs and next about 'inside'. What is this 'inside' ? How it is connected to the router? What for is the hub & what way it can sends the traffic to the appropriate ethernet card? What are the LAN elements & connections ? (Maybe any diagram?)

... routing table becomes messed up - which it should be and which is it now (just post it)?

this is made necessary by the requirement to address secure virtual hosts by IP rather then by name - I can't see the relation. A lot of virtual hosts can be set up with the same IP so what is the requirement (any kind of company policy, is so what does it change in security if you are using same machine) ?

because of the way ssh handles its work with Apache. maybe I'm stupid but ssh has nothing to do with Apache.
 
Old 05-23-2004, 08:42 PM   #3
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
If I understand right what you want to accomplish, you can't do it this way. The 255.255.248.0 netmask or easier in hex ff:ff:f8:00 says that the whole network with IP's 142.179.96.0 through 142.179.103.255 (that are all the IP's which differ only in the last 11 bits which are masked) are reachable through eth0. The moment you define eth1 with the other IP (which is in the same netmask range of eth0) you indeed mess up the routing. Unless that whole subnet with 2048 IP's is yours alone (which I doubt) you cannot do this *locally*, that is, without involving your ISP. If you own these two IP's, you have to ask your ISP to route those two to you, and then you still need a router that will send the traffic to the proper machine.

If you are confused about the netmask, think of the subnet that your interface serves as the collection of IP's that satisfy (IP & ff.ff.f8.0) == 142.179.96.0 where the & means a bit-wise and. That is that 142.179.96.0 through 142.179.103.255 range.

Hope it helps,
mlp
 
Old 05-23-2004, 09:17 PM   #4
winsnomore
Member
 
Registered: May 2004
Location: USA
Distribution: #1 PCLinuxOS -- for laughs -> Ubuntu, Suse, Mepis
Posts: 315

Rep: Reputation: 31
Older ADSL modems had no routing capability .. that's why folks had to purchase a DSL-ROUTER .. new modems sometimes have it built it in.

So connecting 2 computers with a hub to a ADSL modem generally won't work no matter what addresses you provide to anyone .. it' will be the first come first serve .. a who's on first comedy on the network

The right soluition is .. get an ADSL modem with built in Router and use the hub as a concentrator.
Or get a DSL-ROUTER and put it next to the ADSL modem .. You will run into a problem of 2 back to back NAT translations (and possibly an issue with pppOE that a lot of ADSL modems use) (Typicall DSL routers don't use ppoOE, though some can .. and then you have to put your DSL modem in a bridged ethernet mode).

That said, you should use DHCP unless there is a VERY good reason for using static addresses. Regarding needing fixed IP address .. that' s mostly of the past, in any case there is absolutely no point on using fixed ip addressES behind an ADSL modem without a router .. and unless you purchased those addresses from your service provider and that's not a cheap option ..

Hope that's helpful
 
  


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
Routing for eth0 and wlan0 with static IPs on the same network. kelvinlo Linux - Wireless Networking 3 10-15-2007 04:54 PM
ADSL and multiple external static IPs adasko Linux - Networking 3 09-15-2005 07:01 PM
shorewall with 2 external static ips and DMZ gjmwalsh Linux - Networking 0 05-10-2004 09:31 PM
ADSL - Routing Static IPs NiM Linux - Networking 1 03-06-2004 06:57 AM
Problem accessing external IPs kevin_5050 Linux - Networking 7 02-08-2001 08:46 AM

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

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