网络设计与管理实践 DHCP 和网络地址转换 首都师范大学信息工程学院
DHCP 服务配置 # ip dhcp pool global (配置一个根地址池, global 是地址 池的名称,你可以采用有意义的字符串来表示) #network (动态分配的地址段) #domain-name ghq.com (为客户机配置域后缀) #dns-server (为客户机配置 DNS 服务器) #netbios-name-server (为客户机配置 wins #netbios-node-type h-node (为客户机配置 h 节点模式) #lease 30 (地址租用期为 30 天) #next-server (配置 PXE 引导 TFTP 服务位 置)
DHCP 排除地址 IP 地址 至 不能用于 动态分配 ip dhcp excluded-address 取消地址冲突记录日志 no ip dhcp conflict logging
网络地址转换
网络地址转换 NAT
Inside addressing
Outside addressing
Interface Configuration ip nat { inside | outside } 标记接口是内部还是外部
Defining a pool ip nat pool { netmask | prefix-length } [ type { rotary } ] 定一个地址池
Defining ACLs access-list 1 permit access-list 1 permit
Enabling translation of inside source addresses ip nat inside source list pool [overload] ip nat inside source static
Enabling translation of inside destination addresses ip nat inside destination list pool ip nat inside destination static
Enabling translation of outside source addresses ip nat outside source list pool ip nat outside source static }
Configuring translation timeouts ip nat translation timeout ip nat translation udp-timeout ip nat translation dns-timeout ip nat translation tcp-timeout ip nat translation finrst-timeout
CONFIGURATION EXAMPLES translates between inside hosts addressed from either the or nets to the globally-unique /28 network. 内部 或者 外部 /28
CONFIGURATION EXAMPLES ip nat pool net netmask ip nat inside source list 1 pool net-20 ! interface Ethernet0 ip address ip nat outside ! interface Ethernet1 ip address ip nat inside ! access-list 1 permit access-list 1 permit
CONFIGURATION EXAMPLES translates between inside hosts addressed from the net to the globally unique /28 network. Packets from outside hosts addressed from net (the "true" net) are translated to appear to be from net /24.
CONFIGURATION EXAMPLES ip nat pool net netmask ip nat pool net netmask ip nat inside source list 1 pool net-20 ip nat outside source list 1 pool net-10 ! interface Ethernet0 ip address ip nat outside ! interface Ethernet1 ip address ip nat inside ! access-list 1 permit
More flexible pool configuration ip nat pool { netmask | prefix-length } [ type { rotary } ] Router(config)#ip nat pool fred prefix- length 24 Router(config-ipnat-pool)#address Router(config-ipnat-pool)#address
Translating to interface's address ip nat inside source list interface overload ip nat inside source list 1 interface Serial0 overload
Static translations with ports ip nat inside source static { tcp | udp } ip nat inside source static tcp
SSH 配置 hostname 和 ip domain-name Router#configure terminal Router(config)#hostname HOSTNAME HOSTNA(config)#ip domain-name ie.cnu.edu.cn
SSH 配置登录用户名和密码(以本地认证为例) (config)#username test password 0 test 配置 SSH 服务 crypto key generate rsa hoose the size of the key modulus in the range of 360 to 2048 for your General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes. How many bits in the modulus [512]: Generating 512 bit RSA keys...[OK]
SSH c2621XM-B#sh ip ssh SSH Enabled - version 1.5 Authentication timeout: 120 secs; Authentication retries: 3 停止 SSH 服务 crypto key zeroize rsa
SSH 设置 SSH 参数 ip ssh {[time-out seconds]} | [authentication- retries interger]}