However, if I issue this command: 1) route add default gw 192.168.1.1 eth1 SIOCADDRT: Network is unreachable
Why does it give me an error message? Also, why can I cross routes / subnets without any problems?? If I issue a route statement that ties the 0.1 subnet to eth0, why does it work??? eth0 is part of the 1.1 subnet......
There should only be one default (gateway) route. If your computer wanted to send a packet to eg. 64.38.34.49 then which (default) route should it use?
Without more information about what you want to do, I'm thinking you're wanting something like these:
route add -net 192.168.1.0 netmask 255.255.255.255.0 gw 192.168.1.1 eth0 so that all packets to the network 192.168.1.0/255.255.255.0 is sent from eth0, through the gateway 192.168.1.1
route add -net 192.168.0.0 netmask 255.255.255.255.0 gw 192.168.0.1 eth1 so that all packets to the network 192.168.0.0/255.255.255.0 is sent from eth1, through the gateway 192.168.0.1
route add default gw 192.168.0.1 eth1 so that the default is to send the packets (ie. all packets to destinations other than the above rules) from eth1, through the gateway 192.168.0.1.
I recommend you work out what you want to do and have a thorough read of 'man route'.
-- Ben M.
---------------- What are Software Patents for? To protect the small enterprise from bigger companies.
What do Software Patents do? In its current form, they protect only companies with big legal departments as they: a.) Patent everything no matter how general b.) Sue everybody. Even if the patent can be argued invalid, small companies can ill-afford the typical $500k cost of a law-suit (not to mention years of harassment).
Don't let them take away your right to program whatever you like. Make a stand on Software Patents before its too late.
Thanks for replying. Actually, since I have 2 NIC's in my Linux box, I want to be able to use BOTH routes. It matters not which one is chosen. I just know that since I have 2 DSL lines, I want to take advantage of the additional bandwidth and use both lines......
Will what you posted, the route add statements, accomplish this?
> There should only be one default (gateway) route. If your computer > wanted to send a packet to eg. 64.38.34.49 then which (default) route > should it use?
> Without more information about what you want to do, I'm thinking you're > wanting something like these:
> route add -net 192.168.1.0 netmask 255.255.255.255.0 gw 192.168.1.1 eth0 > so that all packets to the network 192.168.1.0/255.255.255.0 is sent > from eth0, through the gateway 192.168.1.1
> route add -net 192.168.0.0 netmask 255.255.255.255.0 gw 192.168.0.1 eth1 > so that all packets to the network 192.168.0.0/255.255.255.0 is sent > from eth1, through the gateway 192.168.0.1
> route add default gw 192.168.0.1 eth1 > so that the default is to send the packets (ie. all packets to > destinations other than the above rules) from eth1, through the gateway > 192.168.0.1.
> I recommend you work out what you want to do and have a thorough read of > 'man route'.
> -- > Ben M.
> ---------------- > What are Software Patents for? > To protect the small enterprise from bigger companies.
> What do Software Patents do? > In its current form, they protect only companies with > big legal departments as they: > a.) Patent everything no matter how general > b.) Sue everybody. Even if the patent can be argued > invalid, small companies can ill-afford the > typical $500k cost of a law-suit (not to mention > years of harassment).
> Don't let them take away your right to program > whatever you like. Make a stand on Software Patents > before its too late.
> Thanks for replying. Actually, since I have 2 NIC's in my Linux box, > I want to be able to use BOTH routes. It matters not which one is > chosen. I just know that since I have 2 DSL lines, I want to take > advantage of the additional bandwidth and use both lines......
> Will what you posted, the route add statements, accomplish this?
Have a look at the Advanced Routing and Traffic Control HOWTO. It deals with load-balancing multiple links.
> There should only be one default (gateway) route. If your computer > wanted to send a packet to eg. 64.38.34.49 then which (default) route > should it use?
> Without more information about what you want to do, I'm thinking you're > wanting something like these:
> route add -net 192.168.1.0 netmask 255.255.255.255.0 gw 192.168.1.1 eth0 > so that all packets to the network 192.168.1.0/255.255.255.0 is sent > from eth0, through the gateway 192.168.1.1
> route add -net 192.168.0.0 netmask 255.255.255.255.0 gw 192.168.0.1 eth1 > so that all packets to the network 192.168.0.0/255.255.255.0 is sent > from eth1, through the gateway 192.168.0.1
> route add default gw 192.168.0.1 eth1 > so that the default is to send the packets (ie. all packets to > destinations other than the above rules) from eth1, through the gateway > 192.168.0.1.
> I recommend you work out what you want to do and have a thorough read of > 'man route'.
> -- > Ben M.
> ---------------- > What are Software Patents for? > To protect the small enterprise from bigger companies.
> What do Software Patents do? > In its current form, they protect only companies with > big legal departments as they: > a.) Patent everything no matter how general > b.) Sue everybody. Even if the patent can be argued > invalid, small companies can ill-afford the > typical $500k cost of a law-suit (not to mention > years of harassment).
> Don't let them take away your right to program > whatever you like. Make a stand on Software Patents > before its too late.
One other thing I am looking for is a way to tell IF both lines are being used. I mean, just because I can ping both routers does not mean that Linux is piping through both lines.......so I am looking for a way just to make sure that both lines are being used by the OS to send data.....
> > Thanks for replying. Actually, since I have 2 NIC's in my Linux box, > > I want to be able to use BOTH routes. It matters not which one is > > chosen. I just know that since I have 2 DSL lines, I want to take > > advantage of the additional bandwidth and use both lines......
> > Will what you posted, the route add statements, accomplish this?
> Have a look at the Advanced Routing and Traffic Control HOWTO. It deals > with load-balancing multiple links.
Cameron Kerr wrote: > Arthur <ame...@iwc.net> wrote:
>>Hi Ben,
>>Thanks for replying. Actually, since I have 2 NIC's in my Linux box, >>I want to be able to use BOTH routes. It matters not which one is >>chosen. I just know that since I have 2 DSL lines, I want to take >>advantage of the additional bandwidth and use both lines......
>>Will what you posted, the route add statements, accomplish this?
> Have a look at the Advanced Routing and Traffic Control HOWTO. It deals > with load-balancing multiple links.
Yes, this seems to be what you be wanting to do (load-balancing).
Be warned that this is can be a complex thing to setup (efficiently).
-- Ben M.
---------------- What are Software Patents for? To protect the small enterprise from bigger companies.
What do Software Patents do? In its current form, they protect only companies with big legal departments as they: a.) Patent everything no matter how general b.) Sue everybody. Even if the patent can be argued invalid, small companies can ill-afford the typical $500k cost of a law-suit (not to mention years of harassment).
Don't let them take away your right to program whatever you like. Make a stand on Software Patents before its too late.
> Thanks for replying to my post my routing table and such. I took your > advice, and my routing tble now looks like this:
> Kernel IP routing table > Destination Gateway Genmask Flags Metric Ref Use Iface > 192.168.1.0 192.168.1.1 255.255.255.0 UG 0 0 0 eth0 > 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 > 192.168.0.0 192.168.0.1 255.255.255.0 UG 0 0 0 eth1 > 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 > 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo > 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 > 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0
This isn't quite right.
> 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 > 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 > 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0
are extraneous (probably original entries by DHCP). These shouldn't make any difference but should be removed anyways for neatness.
Make sure 192.168.0.1 and 192.168.1.1 really are your gateway addresses. I just put down the most common setup but it might be different for your networks (you might not even have gateways from the looks of things).
> I have a couple of questions and I was hoping you could help.........
> If I have 2 DSL lines, and 2 IP's, then shouldn't data be piped over > both of them? What decides which DSL line the data goes out over?
Just adding routes won't do what you want to do there. You want to do "load-balancing" - see my other post.
> Also, here is something interesting: I can telnet and SSH into one of > the routes, but not the other......why is that? Shouldn't both be > open?
If you are trying from the internet, then it is probably (almost definitely in the case of SSH) because network traffic is going out on a different route to the return. (Packets always leave your computer through eth0, the 192.168.1.x network.)
> Thanks for all your help........I know it's a alot to ask, but I am > lost and really in need of help....
Only glad to help, you seem to be genuinely and thoroughly searching for a solution here. Make sure you read my other post in this thread.
-- Ben M.
---------------- What are Software Patents for? To protect the small enterprise from bigger companies.
What do Software Patents do? In its current form, they protect only companies with big legal departments as they: a.) Patent everything no matter how general b.) Sue everybody. Even if the patent can be argued invalid, small companies can ill-afford the typical $500k cost of a law-suit (not to mention years of harassment).
Don't let them take away your right to program whatever you like. Make a stand on Software Patents before its too late.
You've been quite helpful, but one of your comments mystifys me.
> If you are trying from the internet, then it is probably (almost > definitely in the case of SSH) because network traffic is going out on a > different route to the return. (Packets always leave your computer > through eth0, the 192.168.1.x network.)
If packets are leaving on the 1.x network, then would that mean that I'm not using both DSL lines? I would think that I should be able to connect to either. And, once I establish a connection on one or the other, that is where my traffic for my connection will be.......
SSH is just a process running. I do not think that if only listens on one network......
> > Thanks for replying to my post my routing table and such. I took your > > advice, and my routing tble now looks like this:
> > Kernel IP routing table > > Destination Gateway Genmask Flags Metric Ref Use Iface > > 192.168.1.0 192.168.1.1 255.255.255.0 UG 0 0 0 eth0 > > 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 > > 192.168.0.0 192.168.0.1 255.255.255.0 UG 0 0 0 eth1 > > 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 > > 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo > > 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 > > 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0
> This isn't quite right. > > 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 > > 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 > > 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0 > are extraneous (probably original entries by DHCP). These shouldn't make > any difference but should be removed anyways for neatness.
> Make sure 192.168.0.1 and 192.168.1.1 really are your gateway addresses. > I just put down the most common setup but it might be different for your > networks (you might not even have gateways from the looks of things).
> > I have a couple of questions and I was hoping you could help.........
> > If I have 2 DSL lines, and 2 IP's, then shouldn't data be piped over > > both of them? What decides which DSL line the data goes out over?
> Just adding routes won't do what you want to do there. You want to do > "load-balancing" - see my other post.
> > Also, here is something interesting: I can telnet and SSH into one of > > the routes, but not the other......why is that? Shouldn't both be > > open?
> If you are trying from the internet, then it is probably (almost > definitely in the case of SSH) because network traffic is going out on a > different route to the return. (Packets always leave your computer > through eth0, the 192.168.1.x network.)
> > Thanks for all your help........I know it's a alot to ask, but I am > > lost and really in need of help....
> Only glad to help, you seem to be genuinely and thoroughly searching for > a solution here. Make sure you read my other post in this thread.
> -- > Ben M.
> ---------------- > What are Software Patents for? > To protect the small enterprise from bigger companies.
> What do Software Patents do? > In its current form, they protect only companies with > big legal departments as they: > a.) Patent everything no matter how general > b.) Sue everybody. Even if the patent can be argued > invalid, small companies can ill-afford the > typical $500k cost of a law-suit (not to mention > years of harassment).
> Don't let them take away your right to program > whatever you like. Make a stand on Software Patents > before its too late.
> You've been quite helpful, but one of your comments mystifys me.
>>If you are trying from the internet, then it is probably (almost >>definitely in the case of SSH) because network traffic is going out on a >>different route to the return. (Packets always leave your computer >>through eth0, the 192.168.1.x network.)
> If packets are leaving on the 1.x network, then would that mean that > I'm not using both DSL lines? I would think that I should be able to > connect to either. And, once I establish a connection on one or the > other, that is where my traffic for my connection will be.......
Not necessarily...
> SSH is just a process running. I do not think that if only listens on > one network......
Its not. It's listening on *both* networks but is transmitting with just the *one* (the default route). Here's what I reckon is happening:
Call 192.168.0.x 192.168.1.x network A and network B respectively. Call the DSLs connected to network A and network B, DSL1 and DSL2 resp.
I said that ssh probably requires (for security reasons) the routes for incomimg traffic and outgoing traffic to be the same. I also said that all packets leave your computer from network B.
So suppose you ssh via DSL2 on network B. The client computer (on the internet) sends packets via DSL2 through network B to the server. The server then sends its response out through eth0 (default route), through network A, out DSL2 to the client on the internet.
Now suppose you ssh via DSL1 on network A. The client computer (on the internet) sends packets via DSL1 through network A to the server. The server then sends its response out through eth0 (default route), through network A, out DSL2 to the client on the internet. The client spots that the connection was sent to DSL1 but was recieved from DSL2 and so doesn't trust it, resulting in a 'broken' connection.
Of course, I might be totally wrong here. If anybody knows better, please put me straight.
-- Ben M.
---------------- What are Software Patents for? To protect the small enterprise from bigger companies.
What do Software Patents do? In its current form, they protect only companies with big legal departments as they: a.) Patent everything no matter how general b.) Sue everybody. Even if the patent can be argued invalid, small companies can ill-afford the typical $500k cost of a law-suit (not to mention years of harassment).
Don't let them take away your right to program whatever you like. Make a stand on Software Patents before its too late.