3. Building
We'll be building the network step by step.
3.1. User network
First a hint: always work from GNS3. If you start the vpc's separately, they will not connect correctly to the network.
Start user1 and open a console.
For the user PC, we'll use 10.128.101.100. In the VPC-window, type
ip 10.128.101.100 255.255.255.0 10.128.101.1
Next is the user-router r4. In config mode:
ip address 10.128.101.1 255.255.255.0 no shut
While we're on r4, we'll also configure the core-interface
int e0/0 ip address 10.128.1.4 255.255.255.0 no shut
Now ping from user1 to r4 should work:
user1> ping 10.128.101.1 84 bytes from 10.128.101.1 icmp_seq=1 ttl=255 time=10.001 ms 84 bytes from 10.128.101.1 icmp_seq=2 ttl=255 time=7.588 ms 84 bytes from 10.128.101.1 icmp_seq=3 ttl=255 time=7.053 ms 84 bytes from 10.128.101.1 icmp_seq=4 ttl=255 time=8.238 ms 84 bytes from 10.128.101.1 icmp_seq=5 ttl=255 time=7.610 ms user1> ping 10.128.1.4 84 bytes from 10.128.1.4 icmp_seq=1 ttl=255 time=9.227 ms 84 bytes from 10.128.1.4 icmp_seq=2 ttl=255 time=8.108 ms 84 bytes from 10.128.1.4 icmp_seq=3 ttl=255 time=7.840 ms 84 bytes from 10.128.1.4 icmp_seq=4 ttl=255 time=7.331 ms 84 bytes from 10.128.1.4 icmp_seq=5 ttl=255 time=7.855 ms
3.2. The core
First, we'll configure all the e0/0 interfaces of the routers. This is basicaly the
same as for the user-router:
router
|
interface
|
ipaddress
|
r1
|
e0
|
10.128.1.1
|
r2
|
e0
|
10.128.1.2
|
r3
|
e0
|
10.128.1.3
|
r4
|
e0
|
10.128.1.4
|
Because the 16 ESW card acts as a switch, all routers can now ping eachother.
3.3. Enable routing
We'll go for the easy way: we'll use rip. On all the routers:
router rip version 2 no auto-summary network 10.128.1.0
and on r4:
network 10.128.101.0
Because we're now routing, user1 can ping all the routers:
user1> ping 10.128.1.2 84 bytes from 10.128.1.2 icmp_seq=1 ttl=254 time=13.610 ms 84 bytes from 10.128.1.2 icmp_seq=2 ttl=254 time=17.965 ms 84 bytes from 10.128.1.2 icmp_seq=3 ttl=254 time=18.455 ms 84 bytes from 10.128.1.2 icmp_seq=4 ttl=254 time=18.108 ms 84 bytes from 10.128.1.2 icmp_seq=5 ttl=254 time=18.003 ms
3.4. The r1-network
In our first attempt to get a working network, we'll use 10.128.2.0/24 for the network behind
r1.
On r1:
int e0/1 ip address 10.128.2.1 255.255.255.0 no shut router rip network 10.128.2.0
And we'll provision the servers with:
#!/bin/bash apt-get install traceroute ifconfig eth1 10.128.2.101 netmask 255.255.255.0 route add -net 10.128.0.0 netmask 255.255.0.0 gw 10.128.2.1 echo BOX 1 ifconfig -a netstat -rn
(for precise 2 etc we use the equivalent). When provisioning, this gives:
[[ lines removed for brevity ]] ==> precise2: eth0 Link encap:Ethernet HWaddr 08:00:27:12:96:98 ==> precise2: inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 ==> precise2: inet6 addr: fe80::a00:27ff:fe12:9698/64 Scope:Link ==> precise2: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 ==> precise2: RX packets:427 errors:0 dropped:0 overruns:0 frame:0 ==> precise2: TX packets:330 errors:0 dropped:0 overruns:0 carrier:0 ==> precise2: collisions:0 txqueuelen:1000 ==> precise2: RX bytes:98691 (98.6 KB) TX bytes:37706 (37.7 KB) ==> precise2: ==> precise2: eth1 Link encap:Ethernet HWaddr 08:00:27:7b:9a:67 ==> precise2: inet addr:10.128.2.102 Bcast:10.128.2.255 Mask:255.255.255.0 ==> precise2: inet6 addr: fe80::a00:27ff:fe7b:9a67/64 Scope:Link ==> precise2: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 ==> precise2: RX packets:3 errors:0 dropped:0 overruns:0 frame:0 ==> precise2: TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 ==> precise2: collisions:0 txqueuelen:1000 ==> precise2: RX bytes:471 (471.0 B) TX bytes:0 (0.0 B) ==> precise2: ==> precise2: lo Link encap:Local Loopback ==> precise2: inet addr:127.0.0.1 Mask:255.0.0.0 ==> precise2: inet6 addr: ::1/128 Scope:Host ==> precise2: UP LOOPBACK RUNNING MTU:16436 Metric:1 ==> precise2: RX packets:0 errors:0 dropped:0 overruns:0 frame:0 ==> precise2: TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 ==> precise2: collisions:0 txqueuelen:0 ==> precise2: RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) ==> precise2: BOX 2 ==> precise2: Kernel IP routing table ==> precise2: Destination Gateway Genmask Flags MSS Window irtt Iface ==> precise2: 0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0 ==> precise2: 0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0 ==> precise2: 10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 ==> precise2: 10.128.0.0 10.128.2.1 255.255.0.0 UG 0 0 0 eth1 ==> precise2: 10.128.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
And we'll be able to ping the servers form our user1:
user1> ping 10.128.2.101 84 bytes from 10.128.2.101 icmp_seq=1 ttl=62 time=39.953 ms 84 bytes from 10.128.2.101 icmp_seq=2 ttl=62 time=25.692 ms 84 bytes from 10.128.2.101 icmp_seq=3 ttl=62 time=39.988 ms 84 bytes from 10.128.2.101 icmp_seq=4 ttl=62 time=25.149 ms 84 bytes from 10.128.2.101 icmp_seq=5 ttl=62 time=25.152 ms user1> ping 10.128.2.102 10.128.2.102 icmp_seq=1 timeout 84 bytes from 10.128.2.102 icmp_seq=2 ttl=62 time=23.082 ms 84 bytes from 10.128.2.102 icmp_seq=3 ttl=62 time=29.684 ms 84 bytes from 10.128.2.102 icmp_seq=4 ttl=62 time=21.853 ms 84 bytes from 10.128.2.102 icmp_seq=5 ttl=62 time=29.929 ms user1> ping 10.128.2.103 10.128.2.103 icmp_seq=1 timeout 84 bytes from 10.128.2.103 icmp_seq=2 ttl=62 time=26.572 ms 84 bytes from 10.128.2.103 icmp_seq=3 ttl=62 time=28.058 ms 84 bytes from 10.128.2.103 icmp_seq=4 ttl=62 time=30.783 ms 84 bytes from 10.128.2.103 icmp_seq=5 ttl=62 time=30.273 ms user1>
This means that our infrastructure is working.