R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int f0/0
R1(config-if)#ip address dhcp
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#
*Jan 18 12:12:05.275: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Jan 18 12:12:06.275: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config)#exit
R1#
*Jan 18 12:12:08.011: %SYS-5-CONFIG_I: Configured from console by console
*Jan 18 12:12:15.335: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.122.107,
mask 255.255.255.0, hostname R1
Comprobamos que tenemos acceso a internet. (Success es éxito -> Internet OK)
R1#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/28 ms
R1#
Vemos la configuracion ip de la interfaces:
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.122.107 YES DHCP up up
FastEthernet1/0 unassigned YES NVRAM administratively down down
FastEthernet1/1 unassigned YES NVRAM administratively down down
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int f1/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#exi
*Jan 18 12:20:32.391: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up
*Jan 18 12:20:33.391: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
R1(config)#exit
R1#
*Jan 18 12:20:33.907: %SYS-5-CONFIG_I: Configured from console by console
Comprobamos la asignacion de ip en el router.
R1#sh ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.122.107 YES DHCP up up
FastEthernet1/0 192.168.1.1 YES manual up up
FastEthernet1/1 unassigned YES NVRAM administratively down down
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#service dhcp
R1(config)#ip dhcp pool ELCA
R1(dhcp-config)#network 192.168.1.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.1.1
R1(dhcp-config)#dns-server 8.8.8.8
R1(dhcp-config)#exit
R1(config)#exit
R1#
*Jan 18 12:39:59.591: %SYS-5-CONFIG_I: Configured from console by console
R1#
Nos vamos al VPCS-1. Lo arrancamos, si no lo está, y entramos en la consola:
VPCS-1> ip dhcp
DDORA IP 192.168.1.2/24 GW 192.168.1.1
VPCS-1> ping 8.8.8.8
8.8.8.8 icmp_seq=1 timeout
8.8.8.8 icmp_seq=2 timeout
8.8.8.8 icmp_seq=3 timeout
8.8.8.8 icmp_seq=4 timeout
8.8.8.8 icmp_seq=5 timeout
VPCS-1>
Combrobamos que no tiene conexión a internet, pero si esta conectado al router. Hay que dar permisos en el router para permitir el tráfico (configurar la NAT).
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int f0/0
R1(config-if)#ip nat outside
R1(config-if)#exit
R1(config)#int f1/0
R1(config-if)#ip nat inside
R1(config-if)#exit
R1(config)#access-list 100 permit ip 192.168.1.0 0.0.0.255 any
R1(config)#ip nat inside source list 100 interface f0/0 overload
R1(config)#exit
R1#write
Vamos al VPCS-1 y hacemos ping a 8.8.8.8
VPCS-1> ping 8.8.8.8
84 bytes from 8.8.8.8 icmp_seq=1 ttl=50 time=30.775 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=50 time=46.843 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=50 time=30.485 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=50 time=45.536 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=50 time=30.545 ms
VPCS-1>
Vemos que ya tenemos internet en el PC1.
Vamos al VPCS-2. Lo iniciamos, si esta apagado. Entramos en la consola del PC y activamos dhcp y comprobamos con ping si tenemos conexión a internet.
VPCS-2> ip dhcp
DDORA IP 192.168.1.3/24 GW 192.168.1.1
VPCS-2> ping 8.8.8.8
84 bytes from 8.8.8.8 icmp_seq=1 ttl=50 time=30.880 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=50 time=30.500 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=50 time=30.154 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=50 time=31.613 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=50 time=29.050 ms
VPCS-2>
Con esto terminamos esta práctica.