Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

iptable port forward

#If both returns 1 it's ok. If not do the following:

sysctl net.ipv4.conf.eth0.forwarding=1
#or
echo '1' | sudo tee /proc/sys/net/ipv4/conf/ppp0/forwarding
echo '1' | sudo tee /proc/sys/net/ipv4/conf/eth0/forwarding

#Second thing - DNAT could be applied on nat table only. So, your rule should be extended by adding table specification as well (-t nat):

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 8001 -j DNAT --to-destination 192.168.1.200:8080
iptables -A FORWARD -p tcp -d 192.168.1.200 --dport 8080 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

#Both rules are applied only to TCP traffic (if you want to alter UDP as well, you need to provide similar rules but with -p udp option set).
#Last, but not least is routing configuration. Type:

ip route

#and check if 192.168.1.0/24 is among returned routing entries.
Comment

PREVIOUS NEXT
Code Example
Shell :: bash array of strings 
Shell :: sudo: effective uid is not 0 
Shell :: mac ram size cli 
Shell :: erlang clear shell 
Shell :: how to update to latest LTS version of ubuntu 
Shell :: get size of file linux 
Shell :: sudo systemctl restart networking 
Shell :: slow internet wifi speed on ubuntu 18.04 
Shell :: git Already up to date. 
Shell :: spyder 4.2.5 requires pyqt5<5.13, but you have pyqt5 5.15.4 which is incompatible. 
Shell :: which zsh theme im using 
Shell :: set multiple git username and password 
Shell :: choco installation 
Shell :: remote origin already exists. 
Shell :: volume buttons not working ubuntu 18.04 
Shell :: wine ubuntu 
Shell :: check lines of code in a folder 
Shell :: ubuntu install yarn 
Shell :: how to install from git clone 
Shell :: git ignore still sending files 
Shell :: how to set up git in linux terminal 
Shell :: Error: Command failed: adb shell am start -n 
Shell :: git clone only one branch 
Shell :: enospc no space left on device 
Shell :: linux grep recursive 
Shell :: flutter path mac 
Shell :: doom emacs 
Shell :: fatal: remote origin already exists. 
Shell :: wsl install 
Shell :: how to uninstall a aur package 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =