A Router Into a Switch
zoro_2009
Member Posts: 26 ■■■□□□□□□□
in CCNA & CCENT
Hello,
I have an 1800 series router, it has 2 interfaces attached to it, what I would like to do is to make it behave just like an ordinary switch, and since the "switchport" command didn't recognized on those interfaces configuration I couldn't figure out what to do !
Thanks alot for any clarification !:)
I have an 1800 series router, it has 2 interfaces attached to it, what I would like to do is to make it behave just like an ordinary switch, and since the "switchport" command didn't recognized on those interfaces configuration I couldn't figure out what to do !
Thanks alot for any clarification !:)
Comments
-
Jollycork Member Posts: 149A router is a router. Same thing with a switch. A switch is a switch [with the exception of a layer 3 switch which can perform routing functions].
So on a router, what's the interfaces? the same question can be asked about a switch. What are the interfaces on a switch [leaving out trunk ports and a switch that's layer 3]? -
Magmadragoon Member Posts: 172 ■■■□□□□□□□I assume you have a 1841 router which has two fast ethernet ports 0/0 & 0/1. To connect them to a switch you use a port on the switch but you must turn the connection on by assigning one of the ports an IP address and using the no shutdown command or use the connection as a trunk link.
Switchport mode does not work on a router because a router is doing layer 3 work.
Switchport mode works on switches that do layer 2 or layer 2 + layer 3 switches. -
zoro_2009 Member Posts: 26 ■■■□□□□□□□Thanks for the replies, I'm little newbie !
Basically what I'm trying to accomplish here is:
Router (Providing Internet and performing NAT)
|
|
1840 Router (Acting like a simple switch)
|
|
Switch
|
|
Clients
So, the 1840 has nothing necessary to do except for the basic switching !
The reason why I am doing this is that I don't have a switch but instead I have an 1840 router free, so thought transforming that router into a switch !Magmadragoon wrote: »I assume you have a 1841 router which has two fast ethernet ports 0/0 & 0/1. To connect them to a switch you use a port on the switch but you must turn the connection on by assigning one of the ports an IP address and using the no shutdown command or use the connection as a trunk link.
Switchport mode does not work on a router because a router is doing layer 3 work.
Switchport mode works on switches that do layer 2 or layer 2 + layer 3 switches.
I used to add 16SW module into 3750 router in GNS3, than do the "switchport" on those interfaces, that made 'em "switchable", Doesn't the same apply here ?
Thanks -
Magmadragoon Member Posts: 172 ■■■□□□□□□□I think you are talking about the NM-16ESW Cisco 16 port module in GNS3
-
zoro_2009 Member Posts: 26 ■■■□□□□□□□Magmadragoon wrote: »I think you are talking about the NM-16ESW Cisco 16 port module in GNS3
Yes thats the one ! -
Magmadragoon Member Posts: 172 ■■■□□□□□□□I might not be correct but for a 1840 router you will only be able to do routing. The 3700 in GNS3 with the NM-16ESW has autosensing ports that will tell the router it has a limited switch capability. The only switch capability add-on for the 1800 series is the 4-port HWIC add on.
For example, In my home lab I have a home ISP router that is in bridge mode, connected to my 1841 router in which does dhcp at the router and is connected to my 2950 Switches. -
theodoxa Member Posts: 1,340 ■■■■□□□□□□You can configure NAT and DHCP on the 1841. This won't make it a switch, but it will allow your clients to reach the internet through it.
R1(config)# interface FastEthernet 0/0
R1(config-if)# ip address dhcp
R1(config-if)# ip nat outside
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface FastEthernet 0/1
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# ip nat inside
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# ip dhcp excluded-address 192.168.10.1
R1(config)# ip dhcp pool INSIDE
R1(dhcp-config)# network 192.168.10.0 /24
R1(dhcp-config)# default-router 192.168.10.1
R1(dhcp-config)# dns-server 8.8.8.8 8.8.4.4
R1(dhcp-config)# exit
R1(config)# ip route 0.0.0.0 0.0.0.0 FastEthernet 0/0
R1(config)# access-list 10 permit 192.168.10.0 0.0.0.255
R1(config)# ip nat inside source list 10 interface FastEthernet 0/0 overloadR&S: CCENT → CCNA → CCNP → CCIE [ ]
Security: CCNA [ ]
Virtualization: VCA-DCV [ ] -
zoro_2009 Member Posts: 26 ■■■□□□□□□□Thanks for the replies !You can configure NAT and DHCP on the 1841. This won't make it a switch, but it will allow your clients to reach the internet through it.
R1(config)# interface FastEthernet 0/0
R1(config-if)# ip address dhcp
R1(config-if)# ip nat outside
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface FastEthernet 0/1
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# ip nat inside
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# ip dhcp excluded-address 192.168.10.1
R1(config)# ip dhcp pool INSIDE
R1(dhcp-config)# network 192.168.10.0 /24
R1(dhcp-config)# default-router 192.168.10.1
R1(dhcp-config)# dns-server 8.8.8.8 8.8.4.4
R1(dhcp-config)# exit
R1(config)# ip route 0.0.0.0 0.0.0.0 FastEthernet 0/0
R1(config)# access-list 10 permit 192.168.10.0 0.0.0.255
R1(config)# ip nat inside source list 10 interface FastEthernet 0/0 overload
I see you are configuring the DHCP, Isn't this a configuration of a router with a DHCP enabled !
All I want is to make the router a transparent equipment for the users(switch), so the users will get directly the Internet routers address as the default gateway (NOT the 1840 router) -
awitt11 Member Posts: 50 ■□□□□□□□□□You need to be more clear about what you are trying to accomplish. Acting as a 'simple switch' or bridge is not what the 1841 was designed for. It could be set up as a proxy or zone-based IOS firewall, but that might be more configuration than you are looking for here. You showed a switch in your diagram but then said you don't have a switch....
-
zoro_2009 Member Posts: 26 ■■■□□□□□□□You need to be more clear about what you are trying to accomplish. Acting as a 'simple switch' or bridge is not what the 1841 was designed for. It could be set up as a proxy or zone-based IOS firewall, but that might be more configuration than you are looking for here. You showed a switch in your diagram but then said you don't have a switch....
That switch is already used and cannot be replaced !
So the only way is to use the 1840 router as a switch !
What I am doing is transforming the 1840 router to a basic switch (layer 2 switch) so it can be transparent equipement in the network (i.e a switch)
If this cannot be done, how can I transform the ports in a switchable manner (one Trunk and the other for clients) ! -
deth1k Member Posts: 312if you want router to do just switching then you need to disable routing:
no ip routing
and configure IRB
bridge irb
!
bridge 1 protocol ieee
!
int fa0/0
bridge-group 1
!
int fa0/1
bridge-group 1 -
gorebrush Member Posts: 2,743 ■■■■■■■□□□if you want router to do just switching then you need to disable routing:
no ip routing
and configure IRB
bridge irb
!
bridge 1 protocol ieee
!
int fa0/0
bridge-group 1
!
int fa0/1
bridge-group 1
I'd have thought that ought to do it.
Though, quite why you'd need to turn a two port device into a switch beats me... Unless you've got some epic application for it. -
Magmadragoon Member Posts: 172 ■■■□□□□□□□I'd have thought that ought to do it.
Though, quite why you'd need to turn a two port device into a switch beats me... Unless you've got some epic application for it.
I thought I was the only one confused with the OP request. It would be much easier to use a switch. -
Jollycork Member Posts: 149But [shrug] guess if one wants to use a router for a switch I've seen stranger configs.
-
JeanM Member Posts: 1,117I think the OP is wanting to use this router as a L2 switch because it's got a switch module installed in it...maybe the switch he's got is out of ports and he wants to add this 1800 series with the switch module installed to the existing switch (trunk) in order to provide more switch ports?
Not sure....but why not just get the right component for the job? IE. another switch.2015 goals - ccna voice / vmware vcp. -
theodoxa Member Posts: 1,340 ■■■■□□□□□□I think the OP is wanting to use this router as a L2 switch because it's got a switch module installed in it...maybe the switch he's got is out of ports and he wants to add this 1800 series with the switch module installed to the existing switch (trunk) in order to provide more switch ports?
Not sure....but why not just get the right component for the job? IE. another switch.
If he was a switch module, then those ports (but not FastEthernet 0/0 or 0/1 as these are Layer 3 ports) can be configured just like a switch. Only caveat is that he has to use only the switch ports (the ones on the module). Connect one to his existing switch and the other(s) to his clients.R&S: CCENT → CCNA → CCNP → CCIE [ ]
Security: CCNA [ ]
Virtualization: VCA-DCV [ ] -
theodoxa Member Posts: 1,340 ■■■■□□□□□□I see you are configuring the DHCP, Isn't this a configuration of a router with a DHCP enabled !
Yes. That is the configuration to setup the router as a router that can be used behind an existing router.All I want is to make the router a transparent equipment for the users(switch), so the users will get directly the Internet routers address as the default gateway (NOT the 1840 router)
Is there a reason you want to use the 1841 as a switch? Does it have a switch module (HWIC-4ESW) installed? The only reason I know of for a 2 port switch (bridge) was to connect two hubs together, but divide them into separate collision domains. This might have been done 10 or 20 years ago, but not anymore. Switch ports are cheap enough now that nobody uses Hubs, except for Troubleshooting when they don't know how to configure SPAN.R&S: CCENT → CCNA → CCNP → CCIE [ ]
Security: CCNA [ ]
Virtualization: VCA-DCV [ ] -
JeanM Member Posts: 1,117theodoxa - check his reply #7 , but then if he was trying to have more switch ports, wouldn't you connect the 1841 with it's switch ports to the existing switch and not the other way around , reply #5 with diagram...2015 goals - ccna voice / vmware vcp.
-
zoro_2009 Member Posts: 26 ■■■□□□□□□□if you want router to do just switching then you need to disable routing:
no ip routing
and configure IRB
bridge irb
!
bridge 1 protocol ieee
!
int fa0/0
bridge-group 1
!
int fa0/1
bridge-group 1
That did the trick, thank you very much !
Guys please understand, I don't have a free switch, in the other hand I have this spare router in my hands, so I thought why not, after all this is just temporary and for tests purposes only !
Thanks ! -
ebohlman Member Posts: 26 ■■■□□□□□□□The only reason I know of for a 2 port switch (bridge) was to connect two hubs together, but divide them into separate collision domains. This might have been done 10 or 20 years ago, but not anymore. Switch ports are cheap enough now that nobody uses Hubs, except for Troubleshooting when they don't know how to configure SPAN.
Admittedly not very common cases, but at least two other reasons:
1) Connecting two devices that would otherwise require a cable longer than the per-segment maximum (100M for copper).
2) Connecting two hosts when you don't have a crossover cable handly.