You can accomplish the redirection with iptables:
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
Related Contents:
- Network usage top/htop on Linux [closed]
- Increasing the maximum number of TCP/IP connections in Linux
- Find the IP address of the client in an SSH session
- Freeing up a TCP/IP port? [closed]
- How to detect the physical connected state of a network cable/connector?
- How can I get the current network interface throughput statistics on Linux/UNIX? [closed]
- Setting the hostname: FQDN or short name?
- How can I port forward with iptables?
- What is this IP address: 169.254.169.254?
- How to determine the hostname from an IP address in a Windows network?
- SSHFS mount that survives disconnect
- How to get TX/RX bytes without ifconfig?
- What is the “slash” after the IP? [duplicate]
- What does mdev mean in ping(8)?
- How do I force Linux to reacquire a new IP address from the DHCP server?
- Will increasing net.core.somaxconn make a difference?
- Is there a linux terminal command that lets you see the amount of data coming in to your tcp connections in real time?
- Port forwarding on Linux without iptables?
- IP Forwarding = when and why is this required?
- Forward SSH through SSH tunnel
- What does “!Z” and “!X” mean in a traceroute?
- How can I monitor network I/O usage per process under Linux?
- How to set the preferred network interface in linux
- Difference between /etc/hosts and /etc/resolv.conf
- Maximizing rsync performance and throughput – directly-connected gigabit servers
- iftop – how to generate text file with its output?
- netstat -ntap doesn’t show pid/process name for some connections?
- Monitor network traffic volume over interface
- How to generate netflow data in linux
- How to find the number of open ports in linux?
- How do I clear the interface stats on Linux
- How to completely, dynamically disable IPv4 stack from Linux?
- Limit incoming and outgoing bandwidth and latency in linux
- How can I measure the cumulative network usage of a process, from execution beginning to end
- Max number of socket on Linux
- Restarting networking on Debian Jessie
- Adding a route to specific host go out a specific interface
- Linux Networking – “ip X” instead of ifconfig/route/etc?
- Linux networking port exhaustion
- How do I get the number of (currently) established TCP connections for a specific port?
- linux: traceroute send operation not permitted for remote server
- How virbr0-nic is created?
- resume file copy linux
- Keepalived for more than 20 virtual addresses
- Interpreting ethtool Coalesce output
- Linux TC class/filter numbering
- How to list all requests to udp sockets?
- tcp_tw_reuse vs tcp_tw_recycle : Which to use (or both)?
- Listen on a network port and save data to a text file [closed]
- How can I set a static IP address in a Docker container?