Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mandriva 2010 (cooker) with Bind9, Sendmail, Postgresql and Apache2 servers
Posts: 63
Rep:
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!)
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.
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.
Distribution: #1 PCLinuxOS -- for laughs -> Ubuntu, Suse, Mepis
Posts: 315
Rep:
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 ..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.