Changing TCP Ports for FTP
Problem
You have an FTP server that uses a nonstandard TCP port number.
Solution
The FTP protocol includes IP address information in the packet payload. Normally, Cisco’s NAT implementation rewrites IP address information in the payloads of FTP packets by looking in every packet sent on TCP port 21, which is the port that FTP uses to pass session control information by default. So when an FTP server uses a nonstandard TCP port number for session control, you have to configure the NAT router to expect FTP packets on this new port number:
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#access-list19permitRouter(config)#192.168.55.5ip nat service list19ftp tcp portRouter(config)#8021ip nat service list19ftp tcp portRouter(config)#21endRouter#
Discussion
As we mentioned in the Introduction to this chapter, the common FTP protocol includes IP address information in the packet payload. Cisco routers expect this, and rewrite the information appropriately. But some FTP servers use a nonstandard TCP port number, which means that NAT will break the protocol. So in IOS Version 11.3, Cisco introduced the ability to look for FTP payload information on alternate TCP port numbers.
The example configures the router to expect FTP packets for the
server 192.168.55.5 on both the
default port number 21 and the
nonstandard port number 8021. You can easily configure similar commands for other servers as well, or expand ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access