cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1312
Views
0
Helpful
1
Replies

Interface with Secondary IP address

snarayanaraju
Level 4
Level 4

Hi Experts,

I am doing a lab testing with 2 routers R1 & R2

R1 ETH 0/0 IP Address:

ip add 192.168.1.1 255.255.255.0

ip add 172.16.1.1 255.255.255.0 second

R2 ETH 0/0 IP Address:

ip add 172.16.1.12 255.255.255.0

When i ping from R1 to R2's IP Address 172.16.1.12 it was not pinging. Then i run "debug ip routing" & "debug ip packet" commands. I attached the output for your reference.

My understanding is, when the traffic is sent from R1 it is taking the source ip address 192.168.1.1 and R2 is having no route for 192.168.1.0 and thus R2 is dropping the packet

Then i added a route in R2 as "ip route 192.168.1.0 255.255.255.0 192.168.1.1 . It started working

Is there any solution available to make this work without adding route in R2

It may be a fundamental and basic concept which i am missing. Please guide me

Sairam

1 Accepted Solution

Accepted Solutions

John Blakley
VIP Alumni
VIP Alumni

When you use a secondary address on an interface, traffic that comes out of that interface will use the primary address as it's source generally. R2 doesn't know how to get to 192.168.1.0 without the static address, or a routing protocol, so the traffic is dropped because you're not sourcing the ping from R1's secondary address since it can only be sourced from that interface.

I may be missing something in your question, but you'll need either to run a routing protocol like eigrp, ospf, or rip, or have a static route to the 192.168.1.0 network, like you did, on the R2 router to get to the 192 subnet.

HTH,

John

HTH, John *** Please rate all useful posts ***

View solution in original post

1 Reply 1

John Blakley
VIP Alumni
VIP Alumni

When you use a secondary address on an interface, traffic that comes out of that interface will use the primary address as it's source generally. R2 doesn't know how to get to 192.168.1.0 without the static address, or a routing protocol, so the traffic is dropped because you're not sourcing the ping from R1's secondary address since it can only be sourced from that interface.

I may be missing something in your question, but you'll need either to run a routing protocol like eigrp, ospf, or rip, or have a static route to the 192.168.1.0 network, like you did, on the R2 router to get to the 192 subnet.

HTH,

John

HTH, John *** Please rate all useful posts ***
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card