The scenario is as follows:
Fa4 = WAN port = 1.2.3.4/30
Fa1 – 3 = VLAN1 = 10.0.0.1/24
All of the clients connected to FastEthernet port 1 to 3 of the router needs:
- Automatic host configuration with DHCP
Gateway: 10.0.0.1
DNS1: 4.3.2.1
DNS2: 1.2.3.4 - Internet access via NAT
- The machine at 10.0.0.2 should be excluded from DHCP,
and have port 80 forwarded to it.
DHCP configuration
router(config)# ip dhcp excluded-address 10.0.0.1 10.0.0.2
router(config)# service dhcp
router(config)# ip dhcp pool Clients
router(dhcp-config)# network 10.0.0.0 255.255.255.0
router(dhcp-config)# domain-name clients.lan
router(dhcp-config)# default-router 10.0.0.1
router(dhcp-config)# dns-server 4.3.2.1 1.2.3.4
router(dhcp-config)# lease 0 1
This give 0 day and 1 hour leases (leasetime 1 hour)
NAT configuration
router(config)# interface vlan 1
router(config-if)# ip nat inside
router(config-if)# interface Fa 4
router(config-if)# ip nat outside
router(config-if)# exit
router(config)# access-list 20 permit 10.0.0.0 0.0.0.255
router(config)# ip nat pool ovrld 1.2.3.4 1.2.3.4 prefix-length 24
router(config)# ip nat inside source list 20 pool ovrld overload
The forwarding of port 80 to 10.0.0.2
router(config)# ip nat inside source static tcp 10.0.0.2 80 interface Fa4 80
That should be all, if there are any errors, please comment!
Follow me on twitter