Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In order to get my iBGP session working I want to configure a static route from the loopback interface on router A (198.18.1.1/30) to the loopback interface on router B (198.18.1.2/30) and vice versa. How do I do this?

share|improve this question
    
Can you give us an example of the routing table on both routers and what networks you're trying to route for? You don't route for the directly connected interfaces (which is a network unto itself) you route for networks "behind" each of the routers. What networks lie "behind" the routers, meaning what networks lie behind the ethernet or other non-directly connected interfaces? –  joeqwerty Feb 25 '11 at 11:08

5 Answers 5

There is no reason to have your loopback addresses with /30 masks. We can get around this issue as mentioned above with more specific static routes, but its bad practice to make a loopback with a /30 netmask.

Router A:

config t

int loopback 0
 ip address 198.18.1.1 255.255.255.255

ip route 198.18.1.2 255.255.255.255 ip.of.interface.on.router.B.plugged.into.router.A

router bgp 64535
 neighbor 198.18.1.2 remote-as 64535
 neighbor 198.18.1.2 update-source loopback0


Router B:

config t

int loopback 0
 ip address 198.18.1.2 255.255.255.255

ip route 198.18.1.1 255.255.255.255 ip.of.interface.on.router.A.plugged.into.router.B

router bgp 64535
 neighbor 198.18.1.1 remote-as 64535
 neighbor 198.18.1.1 update-source loopback0

You may find the following link helpful:

http://www.cisco.com/en/US/tech/tk365/technologies_configuration_example09186a0080093f25.shtml#ibgpconfigure

share|improve this answer

You don't need a static route as they are in the same subnet (given that they are directly connected), it should work right off the bat.

EDIT: Actually, I don't think it really matters what IPs you use for the loopbacks, it could be 4.4.4.4 and 5.5.5.5, as long as the two routers are directly connected and the loopback address is included in the routing process, the route gets advertised.

share|improve this answer
    
It doesn't work right of the bat. I can't ping the loopback on one router from the other router. I tried doing a static route from one loopback to the other loopback and that didn't work. –  bleomycin Feb 25 '11 at 8:20
    
The only thing that seems to work (but makes no sense to me) is to do on router A 'code'ip route 198.18.1.2 255.255.255.255 ip.of.interface.on.router.B.plugged.into.router.A –  bleomycin Feb 25 '11 at 8:31

Connected interface have 0 administrative distance. Static route have 1 administrative distance. 198.18.1.1/30 network have 2 address(198.18.1.1,198.18.1.2). You need create route to 198.18.1.2/32.

ip route 198.18.1.2 255.255.255.255 ROUTER_B_ADDRESS

it will probably work because 198.18.1.2/32 have smaller mask.

Or redistribute 198.18.1.2/32 from B in iBGP.

share|improve this answer

I don't think you can. Those loopbacks are on the same IP subnet, therefore each thinks its local and won't route out another interface. You need to make them different networks first.

share|improve this answer
    
I tried changing the loopbacks to 10.0.1.1 and 10.0.2.1 and neither EIGRP or the static route I came up with worked. Can you give me a solid example of something that would work? –  bleomycin Feb 25 '11 at 8:43

You should make the loopbacks be /32s. Then, you have the question, how can the loopbacks see each other? Generally, the right way to do this is to use a separate routing protocol to inform the routers of each other's loopbacks.

A is 198.18.1.1 and B is 198.18.1.2 (both /32)

Let's say the /30 link between them is 198.18.2.0/230 with .2.1 on A and .2.2 on B

Static routing:

A:

    ip route 198.18.1.2 255.255.255.255 198.18.2.2

B:

    ip route 198.18.1.1 255.255.255.255 198.18.2.1

Or you can use OSPF;

A:
router ospf 1
network 198.18.1.1 0.0.0.0 area 0
network 198.18.2.0 0.0.0.3 area 0

B:
router ospf 1
network 198.18.1.2 0.0.0.0 area 0
network 198.18.2.0 0.0.0.3 area 0
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.