Intervlan routing and internet access

400 pts.
Tags:
Cisco
Cisco switch configuration
Cisco switches
NAT
I configure 2 vlan on my l3 switch 3560,  1) vlan 1 192.168.1.0/24

2) vlan 2 192.168.2.0/24, Intervlan routing is working fine. Now i connected one router 1841 to l3 switch on port fa0/4 (which i issue command no switch port and give ip address 192.168.3.5/24) router interface is f0/1 ip address 192.168.3.6/24. and f0/0

I can ping from Switch to Router ip 192.168.3.6. But My host in lan are not able to connect or ping to the same ip.

My aim is to connect my lan to internet  please suggest configuration

 

 



Software/Hardware used:
cisco 3560 and cisco 1841
ASKED: December 23, 2009  5:01 AM
UPDATED: February 8, 2011  7:28 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

On your 3560, make the following route:

ip route 0.0.0.0 0.0.0.0 192.168.3.6

This will add a default route that will direct traffic to the router if the destination address is not in the switch’s routing table.

You can also use the interface: ip route 0.0.0.0 0.0.0.0 fa0/4

**********
if his suggestion doesn’t work, try to configure fa0/4 as a trunk since you have more than 1 vlan..

—————————————————–

You can ping the 192.168.3.6 from your switch because the interface its cabled into is on the same subnet. Hosts connected to your switch on either of the other 2 VLANS will never connect to the internet, because, as mentioned before, there is no VLAN trunking taking place from your switch to your router…

Try the following config instead:

Cisco 3560:
Set up VLAN interfaces to be “trunk-ready”

3560(config)#interface VLAN 1
3560(config-if)#ip address 192.168.1.2 255.255.255.0
3560(config-if)#no shut
3560(config-if)#exit
3560(config)#Int VLAN 2
3560(config-if)#ip address 192.168.2.2 255.255.255.0
3560(config-if)#no shut
3560(config-if)#exit

Now set up your trunk:
3560(config)#int fa0/4
3560(config-if)#switchport trunk encapsulation dot1q
3560(config-if)#switchport mode trunk
3560(config-if)#switchport trunk native vlan 1
3560(config-if)#switchport trunk allowed vlan add 2 (or “sw trunk allowed vlans all”)
3560(config-if)#end
(save config if you wish)

Cisco 1841:
Now set up the trunk port on the router:

1841(config)#int fa0/0
1841(config-if)#no ip address
1841(config-if)#no shutdown
1841(config-subif)#int fa0/0.1
1841(config-subif)#encapsulation dot1Q 1
1841(config-subif)#ip address 192.168.1.1 255.255.255.0
1841(config-subif)#int fa0/0.2
1841(config-subif)#encapsulation dot1Q 2
1841(config-subif)#ip address 192.168.2.1 255.255.255.0
1841(config-subif)#exit

if its done right, you should see something similar to this:

%LINK-5-CHANGED: Interface FastEthernet0/4, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up

Configure the 1841 to get to you ISP as needed, and all users should be able to get online easily from here. Test pings from the devices used to assist in this config show the following results:

3560#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 = 31/31/31 ms

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

Let us know how it goes…

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Ekansh
    this attemp i have already done. please suggest natting if any
    400 pointsBadges:
    report
  • mshen
    You need to setup a similar route on your router. ip route 192.168.2.0 255.255.255.0 fa 0/1 ip route 192.168.3.0 255.255.255.0 fa 0/1 Run traceroute from a client in the LAN and post the results.
    27,385 pointsBadges:
    report
  • Darkstar911
    you should make the port that's connected to the router a trunk link.Configure the port on the router to route traffic between vlan and also pass traffic to the internet by doing NAT.
    790 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following