PBR

From Frotmail Projects
Jump to navigation Jump to search
switch1#sh ip route
Gateway of last resort is not set
     192.168.99.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.99.8/29 [1/0] via 192.168.99.2
C       192.168.99.0/30 is directly connected, GigabitEthernet1/0/28
C    192.168.32.0/24 is directly connected, GigabitEthernet1/0/1
switch1#sh ip int brief
Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet1/0/1   192.168.32.3    YES manual up                    up      
GigabitEthernet1/0/28  192.168.99.1    YES manual up                    up     
switch1#sh run int gi1/0/1
interface GigabitEthernet1/0/1
 no switchport
 ip address 192.168.32.3 255.255.255.0
 spanning-tree portfast
end
switch1#sh run int gi1/0/28
interface GigabitEthernet1/0/28
 no switchport
 ip address 192.168.99.1 255.255.255.252
 ip policy route-map test
end
switch1#sh run
ip access-list standard loop0
 permit 192.168.99.10 log
 permit 192.168.99.12
!
route-map test permit 10
 match ip address loop0
 set ip next-hop 192.168.32.1		! default gateway van het 192.168.32.0/24 segment
!
route-map test permit 20
 set ip next-hop 192.168.32.9		! Niet bestaand ip, dus deze route werkt niet
!


switch2#sh ip route
Gateway of last resort is 192.168.99.1 to network 0.0.0.0

     192.168.99.0/24 is variably subnetted, 4 subnets, 2 masks
C       192.168.99.11/32 is directly connected, Loopback1
C       192.168.99.10/32 is directly connected, Loopback0
C       192.168.99.12/32 is directly connected, Loopback2
C       192.168.99.0/30 is directly connected, GigabitEthernet1/0/28
S*   0.0.0.0/0 [1/0] via 192.168.99.1
switch2#sh ip int brief
Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet1/0/28  192.168.99.2    YES manual up                    up      
Loopback0              192.168.99.10   YES manual up                    up      
Loopback1              192.168.99.11   YES manual up                    up      
Loopback2              192.168.99.12   YES manual up                    up     
switch2#sh run int gi1/0/28
interface GigabitEthernet1/0/28
 no switchport
 ip address 192.168.99.2 255.255.255.252
end
switch2#sh run int lo0     
interface Loopback0
 ip address 192.168.99.10 255.255.255.255
end
switch2#sh run int lo1
interface Loopback1
 ip address 192.168.99.11 255.255.255.255
end
switch2#sh run int lo2
interface Loopback2
 ip address 192.168.99.12 255.255.255.255
end
switch2#ping 1.1.1.1 source lo0    

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.99.10 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/4/9 ms
switch2#ping 1.1.1.1 source lo1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.99.11 
.....
Success rate is 0 percent (0/5)
switch2#ping 1.1.1.1 source lo2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.99.12 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/9 ms