ConfigurationLinux KernelAnd useIptablesPort CreationIngThe specific work is as follows:
Host IP Address: 192.168.1.100
Destination IP Address: 192.168.2.101
Requests to host 192.168.1.100: 11101 must be mapped to the sshd service port of the destination machine on the Intranet, that is, 192.168.2.101: 22.
Configure the Linux kernel (taking 2.6.18 as an example)
If the following information appears when you run iptable-L, you need to reconfigure and compile the kernel:
Iptables v1.4.2: can't initialize iptables table 'filter': Table does not exist (do you need to insmod ?)
Perhaps iptables or your kernel needs to be upgraded.
Configuration Options:
Networking -->
Networking options -->
[*] Network packet filtering (replaces ipchains)->
Core Netfilter Configuration->
<*> Netfilter Xtables support (required for ip_tables)
IP: Netfilter Configuration->
<*> Connection tracking (required for masq/NAT)
<*> IP tables support (required for filtering/masq/NAT)
<*> IP range match support
<*> Packet filtering
<*> REJECT target support
<*> Full NAT
The preceding configuration is only for port ing. If you need other functions, add relevant configurations as needed.
The steps for compiling and installing the kernel are skipped.
Iptabes
The iptables rules are as follows:
Iptables-t nat-a prerouting-p tcp-dport 11101-d 192.168.1.100-j DNAT-to-destination 192.168.2.101: 22