11-05-2023 09:07 AM
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
Solved! Go to Solution.
11-06-2023 11:46 AM - edited 11-06-2023 12:28 PM
Example, using Packet Tracer:
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
11-05-2023 09:18 AM - edited 11-05-2023 09:19 AM
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.
11-06-2023 07:56 AM
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
11-05-2023 09:47 AM - last edited on 11-29-2023 09:45 AM by Translator
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
11-06-2023 08:04 AM
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.
11-06-2023 11:46 AM - edited 11-06-2023 12:28 PM
Example, using Packet Tracer:
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
11-06-2023 11:52 AM
11-06-2023 12:24 PM
@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.
11-06-2023 01:07 PM
“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.
11-06-2023 03:10 PM
"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?
11-07-2023 12:19 PM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide