Monday, June 7, 2010

DHCP & NAT

DHCP message format:
OP Code (1B), Hardware type (1B), Hardware address length (1B), Hops (1B).
Transaction Identifier (4B)
Seconds (2B), Flags (2B)
Client IP Address (CIADDR: 4B)
Your IP Address (YIADDR: 4B)
Server IP Address (SIADDR: 4B)
Gateway IP Address (GIADDR: 4B)
Client Hardware Address (CHADDR: 16B)
Server Name (SNAME: 64B)
Boot Filename (128B)
DHCP Options (variable bytes)

To turn off DHCP server function:
(config)#no service dhcp
(config)#ip dhcp excluded-address a.b.c.d
(config)#ip dhcp excluded-address low_address [high address]
(config)#ip dhcp pool PoolNAME
(dhcp-config)#network a.b.c.d m.m.m.m
(dhcp-config)#default-router g.g.g.g
(dhcp-config)#dns-server a.b.c.d
(dhcp-config)#domain-name us.army.mil
(dhcp-config)#lease { days [hours] [minutes] | infinite }
(dhcp-config)#netbios-name-server b.b.b.b [c.c.c.c]
(config)#interface fa0/0
(config-if)#ip address dhcp
(config-if)#ip helper-address x.x.x.x
(config-if)#ip forward-protocol 58
(config-if)#no shut

#show ip dhcp server statistics
#show ip dhcp binding
#show ip dhcp pool
#show ip dhcp confict
#debug ip dhcp server events
#debug ip dhcp server packet



NAT
(config)#ip nat inside source static local_ip global_ip
(config)#interface f 0/0
(config-if)#ip nat inside
(config)#int s 0/0/0
(config-if)#ip nat outside
(config)#ip nat pool MYNAME 141.63.7.16 141.63.7.31 netmask m.m.m.m
(config)#ip nat inside source list access-list-num s0/1/0 overload
(config)#ip nat inside source list access-list-num pool MYNAME [overload]
(config)#no ip nat inside source
--> remove the dynamic source translation. "overload" enables PAT.
(config)#ip nat translation timeout seconds

#clear ip nat translation *
#show ip nat translations [verbose]
#show ip nat statistics
#debug ip nat [detailed]

No comments:

Post a Comment