I've reached the GRE tunnel section of my CCNA studies and I seem to be running into a wall. I am following along in the Odom book where the author sets up a tunnel between two private networks, 10.1.1.0/24 and 10.1.2.0/24, using tunnel IPs 10.1.3.1 and 10.1.3.2 going out the routers' serial interfaces (1.1.1.1 and 2.2.2.2 respectively). As far as I understand it, 1.1.1.1 is a public IP address for R1's outgoing serial interface connected to the Internet, and 2.2.2.2 is the same for R2. R1 is directly connected to the 10.1.1.0/24 private network. The tunnel config for R1 would look like so:
R1# [B]config term[/B]
R1(config)# i[B]nt tunnel 1[/B]
R1(config-int)# i[B]p address 10.1.3.1 255.255.255.0[/B]
R1(config-int)# [B]tunnel source s0/0/0[/B]
R1(config-int)# [B]tunnel destination 2.2.2.2[/B]
R2 would have a mirrored configuration for its tunnel:
R2# [B]config term[/B]
R2(config)# i[B]nt tunnel 11[/B]
R2(config-int)# i[B]p address 10.1.3.2 255.255.255.0[/B]
R2(config-int)# [B]tunnel source s0/0/1[/B]
R2(config-int)# [B]tunnel destination 1.1.1.1[/B]
In Odom's running-config examples, both R1 and R2 have OSPF configured with 10.1.0.0 0.0.255.255 area 0.
As I understand it, this is the logic behind the configurations: the private network on one side needs a secure way to communicate with the private network on the other side. This is provided through the GRE tunnel. A packet from a host on R1's LAN would send a packet to its default gateway (in the 10.1.1.0/24 subnet), which is R1. R1 would then route the packet to R2 via the tunnel, which acts as a sort of virtual serial link using 10.1.3.1 and 10.1.3.2. The public IP addresses on R1 and R2's serial interfaces are there to set up the tunnel by connecting to each other through the internet. However, this is where my understanding breaks down.
Why would a router use the tunnel interface to route a packet if there is already a route between R1's s0/0/0 and R2's s0/0/1 interfaces (1.1.1.1 to 2.2.2.2)? That route has to exist in order for the routers to know about each other in the first place, so it's not like you could just restrict OSPF to the 10.1.x.x address range - because the routers would not be able to set up their tunnel in the first place; afer all, it has to have something to tunnel *through* - but Odom seems to have done exactly that with his restricted OSPF network configuration command. Does he have static routes that he isn't showing, or another OSPF area or something? In short, how do you set up a tunnel without advertising a route between R1 and R2's serial interfaces, and with that route, why would the router ever use the tunnel?
I'm simulating this with PacketTracer and the results are unfailingly frustrating. If I have OSPF set up covering all IP addresses (network 0.0.0.0 255.255.255.255), both tunnels are up/up and I can ping from one end to the other, but the routers don't use the tunnel. If I restrict OSPF to just the tunnel interface (network 10.1.0.0 0.0.255.255), the tunnels go to up/down and I can't ping anything at all.
Help! I've stayed up all night banging my head against this wall and I've read the chapter front to back four times in a row... please tell me I'm missing something really basic that will make this very simple concept work?