Asked by duncanb7
at 2024-07-24 05:22:28
Point:500 Replies:32 POST_ID:828605USER_ID:11059
Topic:
Apache Web Server;Linux Networking;Network Operations
before I go to do port forwarding my domain to other exteranl website , and
I go to know more w my system first, I login my root of CentOS6 Linux and try ifconfig command
and found out the result that is not same as the link mentioned
https://www.whoi.edu/CIS/networking/configure/dhcp_linux.html
Question-1:
Why it is not eth0 or eth1 device name intead of venet0 and venet0:0
What is different ?
Question-2:
How to do port forwarding to exteranl website ?
For example , forward my domain(212.1.213.76) to yahoo.com(98.138.253.109)
I try the suggestion of iptables command from http://www.servermom.com/how-to-build-openvpn-server-on-centos-6-x/732/
Command:
==========
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 98.138.253.109 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -o venet0:0 -j SNAT --to-source 212.1.213.76
iptables -t nat -A POSTROUTING -s 98.138.253.109 -j SNAT --to-source 212.1.213.76
iptables -t nat -A POSTROUTING -j SNAT --to-source 212.1.213.76
But there is no effect when typing my domain IP(212.1.213.76) at FF or Chrome
and can not forward to yahoo.com(98.138.253.109), Why ?
Please advise
Ducan
My machine ifconfig command output
================================================
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1083 errors:0 dropped:0 overruns:0 frame:0
TX packets:1083 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:179865 (175.6 KiB) TX bytes:179865 (175.6 KiB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:2258 errors:0 dropped:0 overruns:0 frame:0
TX packets:1988 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:635095 (620.2 KiB) TX bytes:262172 (256.0 KiB)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:212.1.213.76 P-t-P:212.1.213.76 Bcast:212.1.213.76 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
I go to know more w my system first, I login my root of CentOS6 Linux and try ifconfig command
and found out the result that is not same as the link mentioned
https://www.whoi.edu/CIS/networking/configure/dhcp_linux.html
Question-1:
Why it is not eth0 or eth1 device name intead of venet0 and venet0:0
What is different ?
Question-2:
How to do port forwarding to exteranl website ?
For example , forward my domain(212.1.213.76) to yahoo.com(98.138.253.109)
I try the suggestion of iptables command from http://www.servermom.com/how-to-build-openvpn-server-on-centos-6-x/732/
Command:
==========
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 98.138.253.109 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -o venet0:0 -j SNAT --to-source 212.1.213.76
iptables -t nat -A POSTROUTING -s 98.138.253.109 -j SNAT --to-source 212.1.213.76
iptables -t nat -A POSTROUTING -j SNAT --to-source 212.1.213.76
But there is no effect when typing my domain IP(212.1.213.76) at FF or Chrome
and can not forward to yahoo.com(98.138.253.109), Why ?
Please advise
Ducan
My machine ifconfig command output
================================================
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1083 errors:0 dropped:0 overruns:0 frame:0
TX packets:1083 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:179865 (175.6 KiB) TX bytes:179865 (175.6 KiB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:2258 errors:0 dropped:0 overruns:0 frame:0
TX packets:1988 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:635095 (620.2 KiB) TX bytes:262172 (256.0 KiB)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:212.1.213.76 P-t-P:212.1.213.76 Bcast:212.1.213.76 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1