cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10577
Views
0
Helpful
18
Replies

How to assign multiple IP in one or sub interface

fosiulalam
Level 1
Level 1

Hi

I have Cisco 2600 Router .

show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            xx.xx.xx.250  YES DHCP   up                    up 
FastEthernet0/1            172.16.0.2      YES NVRAM  up                    up

FastEthernet0/0 is connected to ISP modem, and I used to one static IP Which i used get via DHCP

From running-confnig:

interface FastEthernet0/0
description link-to-bt-router
ip address dhcp
ip nat outside
duplex auto
speed auto
!

Now ISP assign 5 Statci IP which i will get the same way via dhcp .

but whats the best way to get those Ip ?

shall i create 4 sub interface ??and assign, Ip address dhcp under each subinterface ??

I will have to do port forward aswell ..

Pleaes give me some idea with commands

Thanks

18 Replies 18

Richard Burts
Hall of Fame
Hall of Fame

Fosiul

The only way to create subinterfaces under a FastEthernet interface is to configure the interface for trunking. And trunking will not work to the ISP modem. Assuming that the new addresses from the ISP are in the same subnet as the original DHCP address, the usual solution is to configure address translation/port forwarding to associate the new public address with devices on the inside which use private addressing.

HTH

Rick

HTH

Rick

Hi Rick

Thanks for quick Response.

Assuming that the new addresses from the ISP are in the same subnet as the original DHCP address,  ::

Yes, all 5 Ips will be on Same Subnet mask

the usual solution is to configure address translation/port forwarding  to associate the new public address with devices on the inside which use  private addressing.

I really did not understand what you meant by that , Is there any way to explain little bit as I am not that experts in Cisco devices.

Dont i have get those 5 ip into the router ???

Thanks for your help and patiences

Fosiul

Configuring port forwarding is how you get those addresses into the router. They do not need to associated with a specific interface (and in fact in your situation they can not be associated with a specific interface).

Your router FastEthernet interface will learn one of the addresses. The ISP will forward traffic for the other addresses to your router. So your router needs to know what to do and how to forward the traffic when it arrives at the router. Port forwarding will be how the router knows what to do with this traffic.

HTH

Rick

HTH

Rick

Hi Rick

Thanks again


Ok , So you saying , I should keep the setting as it is,

interface FastEthernet0/0
description link-to-bt-router
ip address dhcp
ip nat outside
duplex auto
speed auto
!

Currently BT modem, Is forwarding every trafiq to this router.

Suppose if i have ip pool like this

1.1.1.1

1.1.1.2

1.1.1.3

1.1.1.4

1.1.1.5

Now suppose i type

telnet 1.1.1.5 80

it shold come into my network.. as

BT modem will forward anything comming via 1.1.1.5 into This Cisco router

and then this cisco router will forward that into internal network

am i understanding correctly ??

i will try this anyway

Thanks for advice and patience

Fosiul

You would need something that might look something like this if you want to do port forwarding

ip nat inside source static tcp 1.1.1.5 139 172.16.0.15 139

and this would forward any traffic from the ISP to your router with source address 1.1.1.5 on tcp port 139 to inside host 172.16.0.15 on tcp port 139.

or if you do not want to do port forwarding and want to just translate an outside address to an inside address you could use static NAT which might look something like this

ip nat inside source static 1.1.1.5 172.16.0.15

and this would forward any traffic arriving from the ISP with destination address 1.1.1.5 to the inside host at 172.16.0.15

HTH

Rick

HTH

Rick

James Hardman
Level 1
Level 1

I would advise adding a static route to null for your range.

bscialyl, if your assigned 1.1.1.0 /29 (1.1.1.0 - 1.1.1.7) then your ISP will be forwarding this range to your router.  You probably have a default route currently to send all traffic back to the ISP.  Therefore, yif you do not have any NATs/PATs or interfaces using all these IPs, you will send the traffic back to your ISP...who will send it back to you....and so on...causing a loop (your ISP proabably has counter measures for this but any ways).

If you add:

ip route 1.1.1.0 255.255.255.248 Null0

This will capture allt he traffic for your subnet.  If you do have any NATs/PATs or interfaces with one of the IPs in this range, the router shall then drop the packets and not route them out of your default route.

More information on this here:

http://www.cisco.com/en/US/tech/tk364/technologies_tech_note09186a00801c9a6e.shtml

To create a NAT (1.1.1.1 -> 192.168.1.1) you do not need to have an interface to have the IP address for each NAT, only one interface needs to be in that subnet to enable you to perform the forward:

i.e.

An itnerfae with the following IP:

Interface fastethernet 0/1
  ip address 1.1.1.1 255.255.255.248
no shut

This will then do the forwards for all the IPs in the subnet:

i.e.

1.1.1.1
1.1.1.2
1.1.1.3
1.1.1.4
1.1.1.5
1.1.1.6
1.1.1.7 (this is your broadcast so you cannot do any forwards with this).

Ciscos guide to NAT - http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094831.shtml

How that helps some how.

Regards

Jimmy

Hi thanks Both of them

I just spoke with ISP

What they saying is :

I will have to assign those 5 Static Ip addrees manually into router or where i want to use .

Example :

If i connect 5 Server directly with this BT Modem (ISP) and assign them with 5 Static Ip , this work

Or I need to assign this 5 Static IP in the cisco router ...

Now its getting more complex .

Any idea ??

Thanks

Fosiul

If you have devices that you want to connect directly to the ISP modem (along with the router connection) you could connect them all through a small switch and that would work. But that is not the usual solution.

The usual solution is what we have already described and that is to configure address translation on the router and associating the new public addresses with addresses for hosts on the inside of your network.

I do not see that what the ISP is telling you is more complex than what we have already been describing.

HTH

Rick

HTH

Rick

Hi Rick

Sorry I appologies if i did not understand your post clearly .

configure address translation on the router and associating the new  public addresses with addresses for hosts on the inside of your network.

Will you be able to explain little further .. shall i follow what @James said

ip route 1.1.1.0 255.255.255.248 Null0

Assuming Ip ragess are : 1.1.1.0 , 1.1.1.1, 1.1.1.2,1.1.1.3,1.1.1.4 and Subnet : 255.255.255.248 ??

then

interface fastethernet 0/1
  ip address 1.1.1.1 255.255.255.248
no shut

Thanks

fosiulalam
Level 1
Level 1

Hi

So far i have done this  :

interface FastEthernet0/0
description link-to-bt-router
ip address 81.x.0.1 255.255.255.248 secondary
ip address 81.x.0.2 255.255.255.248 secondary
ip address 81.x.0.3 255.255.255.248 secondary
ip address 81.x.0.4 255.255.255.248 secondary
ip address 81.x.0.5 255.255.255.248
ip nat outside
duplex auto
speed autointerface FastEthernet0/0


ip nat inside source static tcp 172.16.0.1 80 interface FastEthernet0/0 80


but only ip 81.x.0.5 can forward request from port 80 to internal network

other ips cant

what will i have to do ??


or

The solution you were saying, i really did not understand,

can you explain your solution little bit more ??

thanks

Hi

I just tryed @james method..

it does not work

Can any one please please help me out ..

fosiul

Fosiul

The suggestion from James was to prevent a potential looping problem and never had any chance that it would make your addresses work.It does no harm to have that in the config, but it will certainly not be the solution to your problem.

I have posted two responses which said not to try to assign addresses to the interface. Now you have assigned addresses to the interfaces, and that does not work - as I said it would not.

I have explained that the usual solution to a situation such as yours is to use the extra addresses in address translation. And I have given examples of several approaches to address translation. But you seem not comfortable with these. So let us try to approach this from a different perspective.

Can you explain why the ISP gave you additional addresses? And can you explain what you want to use them for?

I assume that this is a running network. And so I assume that the inside subnet does have access to the Internet. This is probably accomplished by configuring ip nat inside on the inside interface, by configuring ip nat outside on the outside interface, and by configuring ip nat overload to translate the inside addresses as they go out to the Internet. Is this the case?

If that is working using the single IP address that your router learns by DHCP then how do you want to utilize the extra IP addresses? If we can figure out what you are trying to accomplish then we have a better chance of showing you what to do.

HTH

Rick

HTH

Rick

Hi Rick

Thanks again


I have posted two responses which said not to try to assign addresses to the interface.

Ok I can delete those entry. if i dont give any Ip, how you want me to procced ??

Please give me commands example and step by step as you can see, i am really new in cisco.

Can you explain why the ISP gave you additional addresses? And can you explain what you want to use them for?

I used to have 1 Static IP. and we run our own Web server , mail server, dns server

Please have a look at picture.

The Cisco router used to get IP from BT modem via dhcp ( its actually a static ip), and BT modem is forwarding everything to cisco router, and cisco router is forwarding to firewall (pfsense )

Here fowarding is : Internet to internal ( When user try to access, www.domain.com, it forward that to internal servers)

Now, we got 5 Static Ip. becase we need to run few websites and those website need individual Ips

so ISP provided another 5 Static IP.

Now what they saying is , i need to assign those IP statically into server . Here is the problem.

I need to assingn those IPs into router ( as you know ) and trying to find out a way how to assign those into router.

so that Every IP would be live .

by live i meant = when some one will type , ping 1.1.1.1. , it should reply to that ping or telnet 1.1.1.1 80, request will come via BT modem -> cisco rotuer->firewall ->server

so , I need to configure cisco router to have those 5 static iP

Now, i can connect BT connection directly to Cisco router ( i can disconnect BT modem, if that helps) but i need to try with BT modem , see if that works

Now its up to you, how you advise me .

but please give me step by step .

Thanks

Fosiul

It is helpful to know why you need these additional addresses. And knowing that you are running some servers (web, dns, mail) that each need a unique public address helps to determine which approach of the several that I have mentioned should be used.

So here is my advice.

- remove all of the secondary addresses. the Fast0/0 outside interface should have only a single IP address which it will learn from the BT modem by DHCP.

- configure static address translation using this as a model (obviously the addresses need to change to whatever your addressing really is - in my example 172.16.0.15 is the inside address of one of your servers and 1.1.1.5 is one of the new addresses given by the ISP)

ip nat inside source static 1.1.1.5 172.16.0.15

You would have one statement like this for each of the 5 new addresses.

Part of the issue in this ongoing discussion is your insistence that the addresses need to be assigned to the router and that this should be done by associating the address with an interface. I keep trying to explain that the address is assigned to the router if the router has a valid and active translate statement for the address. So try it my way - remove the extra addresses from the interface and configure the 5 translates. Then let us know what happens.

HTH

Rick

HTH

Rick