Search this Blog

Tuesday, January 11, 2011

Is it possible to receive four IP addresses on one INTERFACE ?

Just for training purpose in my lab , we would like to know if it is possible to receive 4 IP addresses on 1 INTERFACE ?

To be more clear :

My ISP allow and give me 4 IP addresses from a DHCP POOL, at the moment my CISCO 1841 ROUTER only use one , for most of the cases it is OK , but we were wondering how we could use :

DHCP IP 1 to VLAN 10

DHCP IP 2 to VLAN 20

DHCP IP 3 to VLAN 30

DHCP IP 4 to VLAN 40

In other words :

My ISP arive in

INT FA0/0

and come out in

INT FA0/0/0

INT FA0/0/1

INT FA0/0/2

INT FA0/0/3

This is what does NOT work :

interface FastEthernet0/0.10

description VLAN 10

encapsulation dot1Q 10

ip address dhcp

ip access-group dri-acl-in in

ip nat outside

ip virtual-reassembly

no cdp enable

!

interface FastEthernet0/0.20

description VLAN 20

encapsulation dot1Q 20

ip address dhcp

ip access-group dri-acl-in in

ip nat outside

ip virtual-reassembly

no cdp enable

interface FastEthernet0/0.30

description VLAN 30

encapsulation dot1Q 30

ip address dhcp

ip access-group dri-acl-in in

ip nat outside

ip virtual-reassembly

no cdp enable

interface FastEthernet0/0.40

description VLAN 40

encapsulation dot1Q 40

ip address dhcp

ip access-group dri-acl-in in

ip nat outside

ip virtual-reassembly

no cdp enable

interface FastEthernet0/0/0

switchport access vlan 10

spanning-tree portfast

!

interface FastEthernet0/0/1

switchport access van 20

spanning-tree portfast

!

interface FastEthernet0/0/2

switchport access van 30

spanning-tree portfast

!

interface FastEthernet0/0/1

switchport access van 40

spanning-tree portfast

!

ip nat inside source list NAT interface FastEthernet0/0 overload

ip nat inside source list NAT10 interface FastEthernet0/0.10 overload

ip nat inside source list NAT20 interface FastEthernet0/0.20 overload

ip nat inside source list NAT30 interface FastEthernet0/0.30 overload

ip nat inside source list NAT40 interface FastEthernet0/0.40 overload

This is just a example how we would like to see it.

Tips:

It will work if your ISP also uses sub interfaces. Here is what I did on my lab

On the ISP side:

ip dhcp excluded-address 1.1.1.1
ip dhcp excluded-address 2.2.2.1
ip dhcp excluded-address 3.3.3.1
!
ip dhcp pool CISCO
network 1.1.1.0 255.255.255.0
domain-name CISCO.COM
default-router 1.1.1.1
!
ip dhcp pool CISCO2
network 2.2.2.0 255.255.255.0
domain-name CISCO2.COM
default-router 2.2.2.1
!
ip dhcp pool CISCO3
network 3.3.3.0 255.255.255.0
domain-name CISCO3.COM
default-router 3.3.3.1
!
interface GigabitEthernet1/0
no ip address
negotiation auto
!
interface GigabitEthernet1/0.1
encapsulation dot1Q 1 native
ip address 1.1.1.1 255.255.255.0
!
interface GigabitEthernet1/0.2
encapsulation dot1Q 2
ip address 2.2.2.1 255.255.255.0
!
interface GigabitEthernet1/0.3
encapsulation dot1Q 3
ip address 3.3.3.1 255.255.255.0

On the client side:

interface GigabitEthernet1/0
no ip address
negotiation auto
!
interface GigabitEthernet1/0.1
encapsulation dot1Q 1 native
ip address dhcp
!
interface GigabitEthernet1/0.2
encapsulation dot1Q 2
ip address dhcp
!
interface GigabitEthernet1/0.3
encapsulation dot1Q 3
ip address dhcp

Router#sh ip int bri | ex una
Interface IP-Address OK? Method Status Protocol
GigabitEthernet1/0.1 1.1.1.2 YES DHCP up up
GigabitEthernet1/0.2 2.2.2.2 YES DHCP up up
GigabitEthernet1/0.3 3.3.3.2 YES DHCP up up

Another thing, you can't use the Vlan on another interface on the client side.

Since you are NAT out, you can simply create another Vlan and IP subnet with the 'interface vlan' command and NAT that out. For instance:

interface FastEthernet0/0/0

switchport access vlan 100

spanning-tree portfast

interface vlan 100

ip address 192.168.1.x 255.255.255.0

access-list 1 permit 192.168.1.x

ip nat inside source list 1 interface FastEthernet0/0.10 overload

Citation - This blog post does not reflect original content from the author. Rather it summarizes content that are relevant to the topic from different sources in the web. The sources might include any online discussion boards, forums, websites and others.

No comments :

Post a Comment

 
/* Google Analytics begin ----------------------------------------------- */ /* Google Analytics end ----------------------------------------------- */