Reply To: [SOLVED] Accesing local servers using the domain name.

Home Page Forums Network Management ZeroShell [SOLVED] Accesing local servers using the domain name. Reply To: [SOLVED] Accesing local servers using the domain name.

#50334

rsansores
Member

Thanks for the quick reply.

Im still having problems, I think what you suggest but I havent been able to excecute your solution. (I lack of knowledge of zeroshell and iptables 🙁 )

What I undestand is that I should have a POSROUTING rule indicating that everithing that goes out from an ip 192.168.2.0 and goes to my server(192.168.2.2) should be forwarded using your custom_postroute.

I tried two aproaches, first I opened the shell connecting to zeroshell via SSH and searched for iptables configuration file to add this lines. I wasnt able to find the iptables conf file so I tried to excecute in the shell the lines. That doesn’t produced error but didnt worked. The problem persist.

My NAT table looked like this after excecuting in shell your commands:


Chain PREROUTING (policy ACCEPT 516K packets, 39M bytes)
pkts bytes target prot opt in out source destination
1886 104K DNAT tcp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:192.168.2.2:80
3287 197K DNAT tcp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:21 to:192.168.2.2:21
59 3180 DNAT tcp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:8100 to:192.168.2.2:8100
0 0 DNAT udp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 udp dpt:8100 to:192.168.2.2:8100
0 0 DNAT tcp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:600 to:192.168.2.95:600
0 0 DNAT udp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 udp dpt:600 to:192.168.2.95:600
25 1500 DNAT tcp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:54352 to:192.168.2.2:54352
8 412 DNAT tcp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 to:192.168.2.2:443
5653 283K Proxy tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
35 2040 DNAT tcp -- ETH01 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:3690 to:192.168.2.2:3690

Chain POSTROUTING (policy ACCEPT 445 packets, 27948 bytes)
pkts bytes target prot opt in out source destination
364K 25M SNATVS all -- * * 0.0.0.0/0 0.0.0.0/0
359K 25M MASQUERADE all -- * ETH01 0.0.0.0/0 0.0.0.0/0
5538 364K MASQUERADE all -- * ETH02 0.0.0.0/0 0.0.0.0/0
0 0 MASQUERADE all -- * ETH00 0.0.0.0/0 0.0.0.0/0
0 0 MASQUERADE all -- * ETH03 0.0.0.0/0 0.0.0.0/0
0 0 custom_postroute all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW

Chain SNATVS (1 references)
pkts bytes target prot opt in out source destination

I dont know how to interpret this output, I would be expecting something like this:


0 0 custom_postroute all -- * * 192.168.2.0/24 192.168.2.2/32

Anyway I tried in the setup cron tab adding your lines as script and the result was the same but duplicated lines in the nat table.


Chain POSTROUTING (policy ACCEPT 445 packets, 27948 bytes)
pkts bytes target prot opt in out source destination
364K 25M SNATVS all -- * * 0.0.0.0/0 0.0.0.0/0
359K 25M MASQUERADE all -- * ETH01 0.0.0.0/0 0.0.0.0/0
5538 364K MASQUERADE all -- * ETH02 0.0.0.0/0 0.0.0.0/0
0 0 MASQUERADE all -- * ETH00 0.0.0.0/0 0.0.0.0/0
0 0 MASQUERADE all -- * ETH03 0.0.0.0/0 0.0.0.0/0
0 0 custom_postroute all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
0 0 custom_postroute all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
0 0 custom_postroute all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW

What Im doing wrong? Thanks again for the help.

PS. In my first post I told you that my subnet was 192.168.1.0/24 and that was wrong my subnet is 192.168.2.0/24