cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2216
Views
0
Helpful
15
Replies

ip vaste

pcfreak49
Level 7
Level 7

how can you put a fixed IP address on an interface because when did it but do not have internet how can you solve that

and what is the difference with the dhcp server

15 Replies 15

cadet alain
VIP Alumni
VIP Alumni

On what a router,a L3 switch, a firewall ? Let's suppose this is on a router then

-static: ip address x.x.x.x y.y.y.y  where x.x.x.x is ip address and y.y.y.y is  subnet mask

-dhcp: ip address dhcp

Regards.

Alain.

Don't forget to rate helpful posts.

I've done that on a router but I do not have internet? how can you solve that?

To get to the Internet you need a default route( which is given by the dhcp server). And For hosts inside your LAN you need NAT.

Post your config.

Regards.

Alain.

Don't forget to rate helpful posts.

Current configuration : 7143 bytes
!
! Last configuration change at 20:36:55 UTC Sat May 14 2011 by Tim
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
logging buffered 51200 warnings
!
aaa new-model
!
!
aaa authentication login default local
!
!
!
!
!
aaa session-id common
!
!
!
memory-size iomem 10
service-module wlan-ap 0 bootimage autonomous
!
crypto pki trustpoint TP-self-signed-3945582034
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-3945582034
revocation-check none
rsakeypair TP-self-signed-3945582034
!
!
crypto pki certificate chain TP-self-signed-3945582034
certificate self-signed 01
  30820245 308201AE A0030201 02020101 300D0609 2A864886 F70D0101 04050030
  31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274
  69666963 6174652D 33393435 35383230 3334301E 170D3131 30343236 31333137
  30345A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649
  4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D33 39343535
  38323033 3430819F 300D0609 2A864886 F70D0101 01050003 818D0030 81890281
  8100900D 6293E313 40744659 1E2A4047 E9844B53 240B241D 711B5B64 E75F2063
  2D6CDE1B 52A3F448 BFEC9B67 16816048 04DBBD55 85235244 048CC4C4 DEDAA702
  9954D740 D50B2ED8 3DF3F681 A5553D5B AEA90921 FB6C2757 C23B12D1 B8121A23
  4B752336 A329E1A8 7E74AB8F 043D73AE D41FE2CA 1B3A238F 9071779C EF2B3A37
  E2F70203 010001A3 6D306B30 0F060355 1D130101 FF040530 030101FF 30180603
  551D1104 11300F82 0D52322E 63757273 6973742E 6265301F 0603551D 23041830
  1680144A 5C914FA9 9D03D187 6DE957BE ED699CB0 46CB0530 1D060355 1D0E0416
  04144A5C 914FA99D 03D1876D E957BEED 699CB046 CB05300D 06092A86 4886F70D
  01010405 00038181 0027B4A2 5B66B9E9 5E579320 F280E047 3BDC4B0F AB852BFA
  1C480D16 3C3E3A86 998EB525 56375C41 E92CA8DC D9EB2583 E685145D B536B4BD
  7E1B3213 086CC86C FB20A91F 4A0A8A67 C5848F49 89BDF700 D6EA83FB 6533E802
  6A0BA747 54476B9C 1060D035 DDA6C526 B6FED37E 0D1CB29F 7A8C4B11 46BAF5CD
  706666CF 00E710A2 C9
        quit
ip source-route
!
!
!
ip dhcp pool R2.LAN
   import all
   network 10.10.20.0 255.255.255.0
   default-router 10.10.20.0
   lease infinite
!
ip dhcp pool R2.CISCO_Private
   import all
   network 20.20.10.0 255.255.255.0
   default-router 20.20.10.1
   dns-server 195.130.131.132 195.130.130.4
   lease infinite
!
!
!
ip cef
ip domain name cursist.be
ip name-server 195.130.131.132
ip name-server 195.130.130.4
ipv6 unicast-routing
ipv6 cef
!
!
!
!
archive
log config
  logging enable
path flash:R2.standard.running-config
username Tim privilege 15 secret 5 $1$SQFs$zojYx5GmAMV.1q33BwRxu0
username Cisco privilege 15 secret 5 $1$CdKz$SOMtjCVR5AO6GW6Ug23Rq/
!
!
ip ssh rsa keypair-name R2.cursist.be
ip ssh version 2
ip scp server enable
!
!
!
!
!
!
!
interface BRI0
no ip address
encapsulation hdlc
shutdown
isdn termination multidrop
!
!
interface FastEthernet0
!
!
interface FastEthernet1
!
!
interface FastEthernet2
!
!
interface FastEthernet3
!
!
interface FastEthernet4
!
!
interface FastEthernet5
!
!
interface FastEthernet6
!
!
interface FastEthernet7
!
!
interface FastEthernet8
description WAN
ip address dhcp client-id FastEthernet8
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
!
interface GigabitEthernet0
description WAN
ip address 84.197.168.249 255.255.240.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map R2.CMAP
!
!
interface wlan-ap0
description Service module interface to manage the embedded AP
ip unnumbered Vlan1
arp timeout 0
!
!
interface Wlan-GigabitEthernet0
description Internal switch interface connecting to the embedded AP
switchport mode trunk
!
!
interface Vlan1
ip address 10.10.20.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
!
ip forward-protocol nd
ip http server
ip http access-class 20
ip http authentication local
ip http secure-server
ip http timeout-policy idle 60 life 86400 requests 10000
!
!
ip nat inside source list ACL interface GigabitEthernet0 overload
ip nat inside source static tcp 10.10.20.1 22 interface GigabitEthernet0 4000
ip nat inside source static tcp 20.20.10.1 22 interface GigabitEthernet0 5000
ip nat inside source list R2-ACL interface GigabitEthernet0 overload
ip nat inside source static tcp 20.20.10.6 3389 interface GigabitEthernet0 3389
ip route 0.0.0.0 0.0.0.0 20.20.10.2
!
ip access-list extended R2-ACL
deny   ip 10.10.20.0 0.0.0.255 10.10.10.0 0.0.0.255
permit ip 10.10.20.0 0.0.0.255 any
deny   ip 20.20.10.0 0.0.0.255 20.20.20.0 0.0.0.255
permit ip 20.20.10.0 0.0.0.255 any
deny   ip 30.30.40.0 0.0.0.255 30.30.30.0 0.0.0.255
permit ip 30.30.40.0 0.0.0.255 any
deny   ip 40.40.30.0 0.0.0.255 40.40.40.0 0.0.0.255
permit ip 40.40.30.0 0.0.0.255 any

Hi,

default-router 10.10.20.0

This is not a valid host address, try to change it to 10.10.20.1

and exclude this address from the pool: ip dhcp excluded-address 10.10.20.1

I pinged this address: ip address 84.197.168.249 255.255.240.0  with success.

Now that the default-gw address of hosts is solved you have to verify if NAT is ok.

ping from one of your host 8.8.8.8 and then on the router: show ip nat translation

You should see an entry with icmp and the ip address of your host and 8.8.8.8

ip nat inside source static tcp 10.10.20.1 22 interface GigabitEthernet0 4000

10.10.20.1 is Vlan 1 address, you must put a host ip addresss instead. But if the goal is to ssh the router itself then no need for NAT.

ip dhcp pool R2.CISCO_Private

What is it? and why this default route to .2 ?

Regards.

Alain.

Don't forget to rate helpful posts.

I changed the default-router 10.10.20.1
I have static ip nat inside source tcp 10.10.20.1 22 interface GigabitEthernet0 4000 geconfigureert for remote ssh to leach on to the router and that works

ip dhcp pool and R2.CISCO_Private is a dhcp for my wireless connection

but I still can not connect to the Internet?

Hi,

It's not needed to do static NAT to manage the router remotely  but that's not the problem here.

You need a default route pointing to your ISP not your WLAN. But then I wonder how I can ping your external IP and you can ssh remotely.

ok I just did a traceroute to this IP aand this is not your router I'm hitting but one from your ISP.

I think you should get an IP address from your ISP with DHCP along with default gateway and dns.

Where is Gi0 connected?

Regards.

Alain.

Don't forget to rate helpful posts.

Gi0 the gate when it is inside the compound, if I make dhcp work only if I get a static ip address it does not work

Honestly, I don't understand a word in your answer.

But the static IP you configured is the one from a router from your ISP so I wonder how you can ssh to it.

Regards.

Alain.

Don't forget to rate helpful posts.

yes I can ssh into the router and that works because I get an ip address via Gi0 but when I put static ip address on Gi0 does not work

ok so when you get an IP with DHCP on Gi0 you can ssh to it? But you can't go to Internet from your LAN or from the router?

Regards.

Alain.

Don't forget to rate helpful posts.

yes I can ssh into the router, but if I use static I get on the Internet at an even ssh

So what is the exact problem?  not going to internet from LAN when DHCP address?

Regards.

Alain.

Don't forget to rate helpful posts.

yes that's right I want a static ip address to assign Gi0 with dns server but can not get anything on the Internet?