港湾NetHammer M582路由器启用DHCP

一台港湾NetHammer M582路由器,原客户端为静态IP方式上网,简要配置如下:

access-list 1 permit any
!
interface eth0/0
description to-lan
ip address 172.16.101.1/24
ip nat inside
!
interface eth0/1
description to-internet
ip address 218.90.xxx.xxx/28
ip nat outside
!
ip route 0.0.0.0/0 218.90.xxx.xxx
!
ip nat on
ip nat flush disable
ip nat inside source list 1 interface eth0/1
!

现在需在内网中增加一新网段172.172.1.0/24,网关为172.172.1.254,客户端可以通过DHCP方式获取地址来上网,同时不影响原静态IP上网的用户,操作如下:

NetHammer582> en
password:
NetHammer582# conf t
NetHammer582(config)# service ip dhcp
NetHammer582(config)# inter eth0/0
NetHammer582(config-if-eth0/0)# ip address 172.172.1.254/24 secondary
NetHammer582(config-if-eth0/0)# quit
NetHammer582(config)# dhcp subnet 172.172.1.0 mask 255.255.255.0
NetHammer582(config-dhcp-subnet)# range 172.172.1.1 172.172.1.150
NetHammer582(config-dhcp-subnet)# option routers 172.172.1.254
NetHammer582(config-dhcp-subnet)# option domain-name-servers 221.228.255.1
NetHammer582(config-dhcp-subnet)# quit
NetHammer582(config)# quit
NetHammer582# wr
Generate running-config…
write running-config to flash…
Write flash success!

摘要配置如下(红色为增加部分):

access-list 1 permit any
!
service ip dhcp
!
interface eth0/0
description to-lan
ip address 172.16.101.1/24
ip address 172.172.1.254/24 secondary
ip nat inside
!
interface eth0/1
description to-internet
ip address 218.90.xxx.xxx/28
ip nat outside
!
ip route 0.0.0.0/0 218.90.xxx.xxx
!
ip nat on
ip nat flush disable
ip nat inside source list 1 interface eth0/1
!
dhcp subnet 172.172.1.0 mask 255.255.255.0
range 172.172.1.1 172.172.1.150
option routers 172.172.1.254
option domain-name-servers 221.228.255.1

!

Leave a Reply