Re: nat problem on rh8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Willem van der Walt wrote:

Hi,
By the sound of it, you need to create a file that contains some iptables
instructions to masquerade or nat your internal IPs to the outside.
You need then to execute this file on bootup.
You also need to enable IP forwarding in the kernel.
These few lines might be a start althiough it is not quite what you want to
do.
echo 1 > /proc/sys/net/ipv4/ip_forward
# This enable ip forwarding by the kernel


iptables -t nat -A POSTROUTING -o eth1 -s <internal ip> -j SNAT --to <external ip>
iptables -t nat -A PREROUTING -d <external ip> -j DNAT --to <internal ip>
#This is the nat in both directions when using static ip
#Replace <internal ip> with your 192 webserver address and
#<external ip> with the assigned public ip address from the ISP.
hth
Willem


On Wed, 23 Apr 2003, eric wrote:




Dear free bsd.org:

I am unsing redhat8, with my isp assigned dynamic ip and internal ip(192,168.1.xxx-I can type it in my url of mozilla to see test webpage, but can not do either dy ip or this internal ip or registered domain name to see my site from outside)
to broadcast web(ie apache), do you know what kind file I should modify to make it work
(I can not find /etc/rc.conf file in my rh8)


I came from visiting natd.html












since I do not have 2 cards, I do not have eth1, and change it to eth0
after i follow your advice

I type www.myFQDN in the URL of mozilla, it repsonse can not be found check the name and try again(it improve from refused to timeout, or maybe not)
if I type my internal ip in the URL of mozilla, it work
if I type my external ip in the URL of mozilla, it response: connection was refused when attempt to contact <external ip>


I also tried telnet

[root@linuxspc xinetd.d]# telnet linuxspc.dyndns.org
linuxspc.dyndns.org: Host name lookup failure
[root@linuxspc xinetd.d]# telnet 68.18.6.21
Trying 68.18.6.21...
telnet: Unable to connect to remote host: Connection refused
[root@linuxspc xinetd.d]# telnet 192.186.1.96 ( this still on my ifconfig's eth0's inet address)
Trying 192.186.1.96...
telnet: Unable to connect to remote host: Connection timed out


in my dyndns.org's register, I registered the ip as external ip(they autodetect it for me), should I change it to my internal ip? (I ever tried it before, that make me can see my webpage when I type in myFQDN in URL of mozilla in my local computer)

highly apprecaite your or any advanced linux user's help
sincerely Eric

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux