marksy
04-16-2002, 03:16 PM
I don't want to dork this up, so I'm asking for your help. We've been using IPs from one class C for a project machine and need to use some from another class C. The second class C has a different gateway of course - how can I add this? Can't have 2 default gateways. I figured
/sbin/route add net 204.246.142.0 netmask 255.255.255.0 gw 204.246.142.1 eth0
but it says:
Network is Unreachable
Here's our routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
204.246.134.0 * 255.255.255.0 U 0 0 0 eth0
204.246.134.0 * 255.255.255.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 204.246.134.1 0.0.0.0 UG 0 0 0 eth1
default 204.246.134.1 0.0.0.0 UG 0 0 0 eth0
What am I dorking up? Do need to add the /sbin/route add etc to startup files?
billyjoe
04-16-2002, 04:17 PM
For that to work, you're going to need a direct path to the second gateway (204.246.142.1). I.E. you have to be able to get to 204.246.142.1 without going through your default gateway.
palmtree
04-17-2002, 12:50 AM
Billy is correct..
Perhaps adding another NIC with access to that other network?
laterz,
palmtree
dot.K
04-17-2002, 07:21 AM
Hmm, just to make sure if I get this correct :
You have a PC in a class C network and you want to reach a gateway in a different Class C network ?
If so, just do the routing on the gateway in your Class C space.
palmtree
04-17-2002, 09:19 AM
But they are in a different subnet, thus different subnet masks... How would he accomplish this?
laterz,
palmtree
dot.K
04-17-2002, 09:23 AM
Originally posted by palmtree
But they are in a different subnet, thus different subnet masks... How would he accomplish this?
laterz,
palmtree
There always HAS to be a router betweer different subnets, wether it's a station with 2 nic's or a dedicated router ..
Maybe it's best the topic starter draws a little sketch of his network layout.
My english isn't the best there is :) So I'd prolly have some 'read-errors'
billyjoe
04-17-2002, 09:45 AM
I agree that the original topic starter should probably provide more detail on how his network is set up and what he's trying to do if he wants a better answer. From his original post, it sounds to me like they ran out of IP addresses on one subnet, so they're trying to borrow IP addresses from a different subnet, which just simply is not going to work. You can't just take addresses from the 204.246.142.0/24 subnet, throw them onto the 204.246.134.0/24 subnet, and expect it to work. If he's trying to dual home the machine with 2 network cards, thats a different story however, but then he wouldn't need a second gateway to reach 204.246.142.0/24 like he seems to be attempting to do.
marksy
04-17-2002, 04:20 PM
We're colo'd and have a class C (call it a.b.c), /etc/sysconfig/network has the default gateway as a.b.c.1
We need to start using another Class C a.b.d (a and b are the same as 1st class C) who's gateway is a.b.d.1
bitserve
04-17-2002, 04:30 PM
http://www.webhostingtalk.com/showthread.php?s=&threadid=30684
palmtree
04-17-2002, 08:08 PM
Originally posted by marksy
We're colo'd and have a class C (call it a.b.c), /etc/sysconfig/network has the default gateway as a.b.c.1
We need to start using another Class C a.b.d (a and b are the same as 1st class C) who's gateway is a.b.d.1
As mentioned, this is not possible without using some sort of router, either that being a dedicated router (like a cisco or something) or making a linux box act like a dedicated router (which is what I would guess the person above meant by stating he did it with Webmin)..
My suggestion above would also work by installing a new ethernet card in your server and having that card access the new network. You could also make this new NIC the gateway for other servers if you have other servers that need access to the new subnet..
Laterz,
palmtree