cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2025
Views
7
Helpful
10
Replies

point to point connection with cisco router to cisco switch

Ataur Rahaman
Level 1
Level 1

I want to create point to point connection with cisco router to cisco switch. I have cisco router where switchport not work but i can use subinterface, I have a layer 3 switch where i can create vlan.
Now how to create /30 point to point connection whereas i can pass all traffic of switch into router

1 Accepted Solution

Accepted Solutions

Example, using Packet Tracer:

JosephWDoherty_0-1699299790405.png

 

 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int g0/0/0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up
Router(config-if)#ip address 192.168.1.1 255.255.255.252
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up

Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int g1/0/1
Switch(config-if)#no switchport 
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up
Switch(config-if)#ip address 192.168.1.2 255.255.255.252
Switch(config-if)#end
Switch#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms

 

View solution in original post

10 Replies 10

M02@rt37
VIP
VIP

Hello @Ataur Rahaman,

Why not configuring a Trunk between Router and your Multilayer Switch ?

Trunk port on Switch side, and sub-interface (Router On A Stick) on Router side.

If you want a /30.... ip address on Router side and switchport mode access vlan X on Switch side, with X as vlan id and add interface vlan X with the /30.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Thanks for reply. I have have lots of VLAN with lots of subnets whose are using in my LAN. So I need to route into Router, There is not possible to use trunking port with others reason. Please suggest me how to add point to point connection based on above scenario. I cann't create vlan in my router but can create subinterface  

in router 

interface x 
ip add 10.0.0.1 255.255.255.0

no shut

in SW
interface x 
switchport access vlan x 
no shut 
interface vlan x 
ip add 10.0.0.2 255.255.255.0

no shut

that what you want 

Thanks A Lot
MHM

Joseph W. Doherty
Hall of Fame
Hall of Fame

Usually, for your ask, you configure router port as you would to connect to another router.

On a L3 switch, you configure a "routed port", i.e. no switchport, IP address, etc.

Example, using Packet Tracer:

JosephWDoherty_0-1699299790405.png

 

 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int g0/0/0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up
Router(config-if)#ip address 192.168.1.1 255.255.255.252
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up

Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int g1/0/1
Switch(config-if)#no switchport 
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up
Switch(config-if)#ip address 192.168.1.2 255.255.255.252
Switch(config-if)#end
Switch#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms

 

KJK99
Level 3
Level 3

@Ataur Rahaman 

In a nutshell without going into any specifics of the router or the switch.
First of all, you need inter-VLAN routing up and running on the L3 switch. Then, pick a subnet that is different from those on the router and the switch, say 10.10.10.0/30. Use this subnet in the link between the switch and the router. This subnet has two usable IP addresses, 10.10.10.1 and 10.10.10.2. One of them will be on the router side and the other on the switch side, say 10.10.10.1 on the router and 10.10.10.2 on the switch.
On the router
Create a subinterface with 10.10.10.1.
Also, for each subnet you have on the switch, create a static route with the next hop 10.10.10.2.
On the switch
Create a new VLAN or a routed port with 10.10.10.2. If a new VLAN, add an access port to it and use it in the link.
Also, make 10.10.10.1 the default gateway for the switch.
I think that’s really all you need to do.
Kris K


@KJK99 wrote:
On the router
Create a subinterface with 10.10.10.1.

Why a subinterface?  Doing so, would require the router<>switch link, on the switch, be defined as a trunk port, I believe.


@KJK99 wrote:
On the router
Also, for each subnet you have on the switch, create a static route with the next hop 10.10.10.2.

Good point, as router, by default, would only know of directly connected subnets.

Same issue, though, on switch.  I.e. it too would only know of its directly connected subnets.

As @KJK99 suggests, you can use static route statements on router, and on switch, and on other L3 devices, or perhaps use a dynamic routing protocol.  Doing so, can also avoid the need for additional static routes for subnets more that one hop away.


@KJK99 wrote:
On the switch
Also, make 10.10.10.1 the default gateway for the switch.

When using L3 switches, that are routing, you don't use a default gateway.   In fact (?), although such a configuration command is retained in config, if IP routing is active, I believe that configuration statement is ignored.  L3 switches, can be accessed as hosts on any IPed interface, even loopbacks.

KJK99
Level 3
Level 3

“Why a subinterface?  Doing so, would require the router<>switch link, on the switch, be defined as a trunk port, I believe.”

I may be wrong here, not sure. I actually use a VLAN interface, but my router is not CISCO and does not support subinterfaces.

“When using L3 switches, that are routing, you don't use a default gateway.   In fact (?), although such a configuration command is retained in config, if IP routing is active, I believe that configuration statement is ignored.  L3 switches, can be accessed as hosts on any IPed interface, even loopbacks.”

In my CISCO CBS switch, it is “ip default-gateway a.b.c.d” That translates into a static route with the Destination IP Address of 0.0.0.0 and the Prefix Length of 0, with makes is a default route and it is needed for Internet destinations.

Kris K

"In my CISCO CBS switch"

Interesting - different from Cisco Enterprise switches.

@Ataur Rahaman what specific router and switch models, and their IOSs, you're asking for?

The original poster says " I cann't create vlan in my router". This is a fairly common misunderstanding when attempting to connect a router to a switch. The router does not need a vlan to communicate with a vlan on the switch. The OP is clear that there are many vlans in the switch environment (and many subnets) and wants to route the switch subnets to the router. The simple answer, as others have already suggested) is the router interface with an IP address, connected to an access port on the switch, which is in a vlan with a vlan interface having the IP address of the /30. An alternative would be to use the no switchport as Joseph suggests and configure the IP on the switch interface.

HTH

Rick
Review Cisco Networking for a $25 gift card