Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

routing question

Status
Not open for further replies.

mikeleahy

Technical User
Joined
Jan 12, 2005
Messages
266
Location
IE
hi
suppose i have two subnets 192.168.1.x and 192.168.2.x i have a router with the following command on it

router rip
network 192.168.1.0 255.255.255.0
network 192.168.2.0 255.255.255.0

so the router should route between the two subnets. how can the router have an interface in both subnets if it only has one ethernet interface??? am i doing this right??

rgds
mike
 
..not quite sure if i'm understanding the question..
...i tired.
..but here goes..
...you could create a loopback interace..give it the ip address of the other subnet..
..now rip is advertising both subnets..


..so if it is connected to another router that is also running rip...that router will be able to ping the loopback interface..

...so two connected routers can ping each other on there directly connected interfaces..(without routing protocol or static statment)
..but without routing protocol or static routing statement cannot ping there loopback interfaces or any other interface that is not being advertised by rip..
...uhhhh maybe somebody else can explain it better...

 
What kind of router do you have?
 
With router rip, you would only put in the ip address of the networks that are directly connected, not the subnet mask.
router(config)#router rip
router(config-router)#net 192.168.1.0
router(config-router)#net 192.168.2.0

Now if you used vlsm, you would have to type this is after router rip...
router(config-router)#ver 2
But that does not answer your question...
You can advertise as many networks you want, but only the directly connected routes will get included in the routing table, as long as THOSE routes are in the router rip network statements.
You cannot have more than one ip address on any given interface, but you can advertise more than one interface in you configure sub-interfaces, but that is only for 802.10, 802.1q and frame relay. 802.1q is for vlans.

Tim
 
ok . but if i have a host in 192.168.1.x that wants to ping a host in 192.168.2.x subnet, how do i do it using the router. cisco 2801. when u say directly connected, if the ethernet interface is 192.168.1.1 and the sub interface is 192.168.2.1 will both those networks be shown up in the routing table and if a hosts gateway ip address is the router then will they be able to ping the other subnet
 
If you have a 2801 with a fastethernet interface with a address and a subinterface address then the link to the access device is a trunk which will run both subnets across that link to the access layer device . The devices on the access switch are put into their respective vlans at the port level , they then would be able to talk between the vlans up thru the router . The device default gateway will be the router interface address of the particular vlan they are attached to at the access device . Both address ranges should show in the routing table , for more info go to cisco.com and do a search , they have lots of info on trunking router interfaces...
 
oh yeah sorry. i understand that trunking is connecting one or more switches for vlan transporting. but why do u say trunking over a router.
if my router config was roughly

ip routing

interface ethernet 0
ip address 192.168.1.1 255.255.255.0
ip address 192.168.2.1 255.255.255.0 secondary

would that route packets between a host on the 192.168.1.x subnet and 192.168.2.x subnet if the router were configured as the gateway for the pcs
 
interface FastEthernet0/0.100
encapsulation dot1Q 1 native
ip address 1.1.2.1 255.255.255.252

..above you see this routers fa0/0.100 subinterface is built with dot1q encapsulation..and trunked to switch..
..the 1 after dot1q is matching vlan 1..


perimeter_route(config-subif)#encapsulation dot1Q ?
<1-4095> IEEE 802.1Q VLAN ID required, range 1 - 0xFFF.

 
but why would u trunk to a switch from a router. can you explain what the above is doing
 
...ok, so your router is connected to the switch that has multiple vlans with different subnets..

...you configure several subinterfaces on the router for various reasons..

...most time people do this to configure "router on a stick"

..to route between different vlans

..check below for better explanation and diagram



 
Breaks up the broadcast domain is one reason to separate the users into more than 1 vlan . If using secondary everyone will see all broadcasts . It also gives you more control over the traffic via acl's if need be when vlans are used.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top