Re: Routing help....
Tony Nugent <[email protected]>
| Newsgroups | gmane.linux.redhat.release.enigma |
|---|---|
| Organization | Linux Works |
| Message-ID | <[email protected]> |
On Thu Apr 17 2003 at 01:45, "System" wrote: > Thankx a lot. Will try this out. Do I have to add any route using > /sbin/route command? > > Tina... Note that /sbin/route and /sbin/ifconfig are essentially obselete. The new networking configuration tool is /sbin/ip. See: http://lartc.org/howto/ > > > I have got two network cards on my PC. > > > 1. 192.168.1.101 > > > 2. 192.168.1.102 Two NICs in the same subnet? (I assume that they are not plugged into the same hub). What are the netmasks on each of the addresses assigned to these NICs? For that to work properly with each card on different wires, at least one of the netmasks would need to be /32 with static routes added to describe the topology of the subnets on each of the two wires. Can you please give the output of these two commands? /sbin/ip address /sbin/ip route (Note: "ip a" and "ip r" also work, also see "ip help" and "ip r he" etc. Try: "ip route show table all", or "ip r s t all"). Why not use two different 192.168/16 subnets on each interface? In your case it seems that you could renumber the first NIC, and doing that would isolate the 192.168.1/24 network to only the second NIC on .1.102 (eth1). The route to the .1.0/24 network would then become much less confusing: 192.168.1.0/24 dev eth1 scope link src 192.168.1.102 Meanwhile... > > > I have a DSL connection. gateway IP 192.168.1.1. > > > I need to put the DSL cable in network card having > > > ip 192.168.1.102 Ok, so that gateway is your default route. In your case you may need to add a route to tell your box where that IP can be found, and then create the default route to it: /sbin/ip route add 192.168.1.1/32 dev eth1 /sbin/ip route add default via 192.168.1.1/32 dev eth1 src 192.168.1.102 The first route shouldn't normally be necessary (if the above 192.168.1.0/24 network route exists). > > > route all the Internet connections comming from 192.168.1.1 to > > > 192.168.1.102. I assume that the router at .1.1 also knows that .1.102 is on the same wire, and that .1.1 is using .1.102 as the next hop router for passing any traffic destined for .1.102, .1.101 and whatever networks reside beyond your .1.101 (eth0) interface. Can you also post the output of "ip a" and "ip r" on that box as well? Cheers Tony