cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1631
Views
10
Helpful
11
Replies

How to make the switch 2960 to get to internet?

jrevet
Level 1
Level 1

Hello,

As you can see in this topology, on the left side we have 2 router that are connect by a switch.

That switch need to get on the internet. The R3 router is the one that gets out in the internet, how we can make that switch do the same thing?

Thank you,

 

4 Accepted Solutions

Accepted Solutions

Hi

 It may depend on your setup. If you are using Vmware as network adapter, you just need to make the router gets ip address using DHCP from your local network. You can configure the interface f1/0 as dhcp.

But, if you are using VirtualBox, then, it is better to configure NAT on the router. It seems to me that VirtualBox has some block when it comes to two mac address on the same interface.

View solution in original post

Actually, now looking better the switch config, you dont have any routing on it. You need to add a route

The route I saw was on the router. As you put both config in sequence, it was hard to see what is router and what is switch.

 

Add a route on the switch like:

ip route 0.0.0.0 0.0.0.0 "ip router"

View solution in original post

Hi,

 

Evrika, it works. 

Thank you for helping me. Although, I have a question: why I need to put ip route on switch, basically, can you explain the logic behind this command?

 

 

View solution in original post

 You can use two command on this situation:

ip route 0.0.0..0 0.0.0.0 "router´s IP"

Or

ip default-gateway "router´s IP"

 

I prefer the first.

 

This is necessary because, although the switch is Layer 2, it needs to reply packets when you try to access it from outside. So, what you are doing is saying to him:

"dont matter who send you a packet you need to reply to your gateway, which on this case is the router"

 

View solution in original post

11 Replies 11

Hi

 It may depend on your setup. If you are using Vmware as network adapter, you just need to make the router gets ip address using DHCP from your local network. You can configure the interface f1/0 as dhcp.

But, if you are using VirtualBox, then, it is better to configure NAT on the router. It seems to me that VirtualBox has some block when it comes to two mac address on the same interface.

Hi there,

 

Thank you for this solution, but now i have another issue, what command should i issue in order to make that switch to get out in internet?

That switch is a layer 2 one.

 

 

 

Which software are you using? Vmware or Virtualbox? Depending on the software the solution will change.

Hello, I'm using GNS3. 

I'm trying to connect with ssh on all devices in the network, it works but on that switch we can't.

Bellow you my config on router 3 and that switch.

R3:

 

Current configuration : 2554 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
no ip dhcp use vrf connected
!
ip dhcp pool PC3
network 10.0.29.0 255.255.255.192
dns-server 10.0.29.1
default-router 10.0.29.1
!
!
no ip domain lookup
ip domain name R3.com
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
username admin password 0 cisco
!
!
ip tcp synwait-time 5
ip ssh version 2
!
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
ip address dhcp
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet2/0
ip address 10.0.29.78 255.255.255.252
ip nat inside
ip virtual-reassembly
ip ospf priority 240
duplex auto
speed auto
!
interface FastEthernet3/0
ip address 10.0.29.67 255.255.255.248
ip nat inside
ip virtual-reassembly
ip ospf priority 240
duplex auto
speed auto
!
interface FastEthernet4/0
ip address 10.0.29.1 255.255.255.192
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
auto-cost reference-bandwidth 1000
network 10.0.29.0 0.0.0.63 area 0
network 10.0.29.64 0.0.0.7 area 0
network 10.0.29.76 0.0.0.3 area 0
default-information originate
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 dhcp
!
!
no ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet1/0 overload
!
access-list 100 permit tcp 10.0.0.0 0.0.15.255 eq 22 192.168.122.0 0.0.0.255 eq 22
access-list 100 permit tcp 10.0.24.0 0.0.3.255 eq 22 192.168.122.0 0.0.0.255 eq 22
access-list 100 permit tcp 10.0.16.0 0.0.7.255 eq 22 192.168.122.0 0.0.0.255 eq 22
access-list 100 permit tcp 10.0.28.0 0.0.0.255 eq 22 192.168.122.0 0.0.0.255 eq 22
access-list 100 permit tcp 10.0.29.0 0.0.0.63 eq 22 192.168.122.0 0.0.0.255 eq 22
access-list 100 permit ip any any
access-list 100 permit tcp 10.0.29.64 0.0.0.7 eq 22 192.168.122.0 0.0.0.255 eq 22
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
password cisco
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login local
transport input ssh
transport output ssh
!
!
end

 

S1:

 

Current configuration : 3765 bytes
!
! Last configuration change at 12:59:19 UTC Thu Jun 9 2022
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname SW1
!
boot-start-marker
boot-end-marker
!
!
!
username admin password 0 cisco
no aaa new-model
!
!
!
!
!
!
!
!
ip domain-name SW1.com
ip cef
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface GigabitEthernet0/0
switchport trunk encapsulation dot1q
switchport trunk native vlan 99
switchport mode access
negotiation auto
!
interface GigabitEthernet0/1
negotiation auto
!
interface GigabitEthernet0/2
negotiation auto
!
interface GigabitEthernet0/3
switchport trunk encapsulation dot1q
switchport trunk native vlan 99
switchport mode access
negotiation auto
!
interface GigabitEthernet1/0
negotiation auto
!
interface GigabitEthernet1/1
negotiation auto
!
interface GigabitEthernet1/2
negotiation auto
!
interface GigabitEthernet1/3
negotiation auto
!
interface GigabitEthernet2/0
negotiation auto
!
interface GigabitEthernet2/1
negotiation auto
!
interface GigabitEthernet2/2
negotiation auto
!
interface GigabitEthernet2/3
negotiation auto
!
interface GigabitEthernet3/0
negotiation auto
!
interface GigabitEthernet3/1
negotiation auto
!
interface GigabitEthernet3/2
negotiation auto
!
interface GigabitEthernet3/3
negotiation auto
!
interface Vlan1
ip address 10.0.29.66 255.255.255.248
!
ip default-gateway 10.0.29.67
ip forward-protocol nd
!
ip http server
ip http secure-server
!
ip ssh version 2
ip ssh server algorithm encryption aes128-ctr aes192-ctr aes256-ctr
ip ssh client algorithm encryption aes128-ctr aes192-ctr aes256-ctr
!
!
!
!
!
!
control-plane
!
banner exec ^C
**************************************************************************
* IOSv is strictly limited to use for evaluation, demonstration and IOS *
* education. IOSv is provided as-is and is not supported by Cisco's *
* Technical Advisory Center. Any use or disclosure, in whole or in part, *
* of the IOSv Software or Documentation to any third party for any *
* purposes is expressly prohibited except as otherwise authorized by *
* Cisco in writing. *
**************************************************************************^C
banner incoming ^C
**************************************************************************
* IOSv is strictly limited to use for evaluation, demonstration and IOS *
* education. IOSv is provided as-is and is not supported by Cisco's *
* Technical Advisory Center. Any use or disclosure, in whole or in part, *
* of the IOSv Software or Documentation to any third party for any *
* purposes is expressly prohibited except as otherwise authorized by *
* Cisco in writing. *
**************************************************************************^C
banner login ^C
**************************************************************************
* IOSv is strictly limited to use for evaluation, demonstration and IOS *
* education. IOSv is provided as-is and is not supported by Cisco's *
* Technical Advisory Center. Any use or disclosure, in whole or in part, *
* of the IOSv Software or Documentation to any third party for any *
* purposes is expressly prohibited except as otherwise authorized by *
* Cisco in writing. *
**************************************************************************^C
!
line con 0
password cisco
logging synchronous
login
line aux 0
line vty 0 4
login local
transport input ssh
transport output ssh
!
!
end

Please help!!

Hi

 Can you ping that switch?

Did you enable SSH on the switch?

 

No sure about this config:

 

ip route 0.0.0.0 0.0.0.0 dhcp

 

If you are not pinging the switch from your machine, I´d recommend to change this to

 

ip route 0.0.0.0 0.0.0.0  "router´s IP address"

 

 

 

 

 

 

 

Hi,

 

Can't ping that switch, idk why...

And if I modify the ip route, nothing will work.

 

Thanks,

Actually, now looking better the switch config, you dont have any routing on it. You need to add a route

The route I saw was on the router. As you put both config in sequence, it was hard to see what is router and what is switch.

 

Add a route on the switch like:

ip route 0.0.0.0 0.0.0.0 "ip router"

Hi,

 

Evrika, it works. 

Thank you for helping me. Although, I have a question: why I need to put ip route on switch, basically, can you explain the logic behind this command?

 

 

 You can use two command on this situation:

ip route 0.0.0..0 0.0.0.0 "router´s IP"

Or

ip default-gateway "router´s IP"

 

I prefer the first.

 

This is necessary because, although the switch is Layer 2, it needs to reply packets when you try to access it from outside. So, what you are doing is saying to him:

"dont matter who send you a packet you need to reply to your gateway, which on this case is the router"

 

jrevet
Level 1
Level 1

Hello again,

 

After all your help, now if possible, can you help me on this issue?

I'm making a python script and want to sort this column, call one minute as shown in the pictures bellow.

 

Thanks,

 

I am not a programmer  but we can try. 

Are you storing the output in a file?

 I have some example, let me find it and I share with you. 

Review Cisco Networking for a $25 gift card