Quote:
Originally posted by Centinul
How about trying this
Code:
route add -net default gw X.X.X.X dev ethX
Hope this helps!
|
Looks like knight-rider already has a default route, though (look at the last line-- 0.0.0.0).
knight-rider, I am not sure I understand what you are trying to accomplish, but routing is dead simple:
+ Routing comes into play when your computer needs to send a packet somewhere. If you do not have IP forwarding enabled, that means it will only happen when the packets originate locally on that machine. Otherwise, the packets can also come in over one of the NICs.
+ When deciding where to send the packets, the routing machinery consults the routing table. Each entry has a destination and a netmask.
+ The netmask is applied to the destination address for the packets, and it is compared to the destination entry in the routing table. If it's a match, then the packets can be sent there.
+ Sometimes there could be several matches. In that case, the most specific match is made. For example, if I am sending packets to 192.168.1.7, and I have entries:
Destination Netmask
192.168.0.0 255.255.0.0
192.168.1.0 255.255.255.0
The second entry will be chosen because it has the more specific network (there are more bits set in its netmask).
That's about all there is to it.
So there are some things you *can't* do just by routing. Say I have a web server and an FTP server, and I have two NICs. Let's further suppose that I want all my web traffic to go out over NIC 1, and all FTP traffic to go out over NIC 2. Well, for a given destination, there is going to be exactly 1 route, so if a particular host uses both FTP and a web browser, my plan is not going to work.
Instead, I would probably have to set up netfilter to forward the packets to the correct interface. You could use the command line utility, iptables, to do that.
Does that help at all?