Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I expect that you have also a wan interface on your server (where you use iptables). I will use eth0 here for your wan interface. eth1 will be your internal interface (local gw - 192.168.0.1):
Quote:
iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
iptables -A FORWARD --in-interface eth1 -j ACCEPT
You also need to ensure that ip forwarding is enabled. You should see the following output:
Quote:
cat /proc/sys/net/ipv4/ip_forward
1
Regarding the DNS - I believe that you were referring to your wan IP with the DNS name. So if your hostname resolves to you WAN IP you should be good after the above IP tables settings.
If your hostname does not resolve you need to set up DNS (either your own or the authoritative server for your zone)
Hua, firstly thanks a million for taking the time to reply. This has been doing my head in for a few days!
In my setup, i bridge my eth1 and wlan0, so it becomes br0. eth0 connects to my modem.
gw on br0 is 192.168.0.1
Does this change slightly now?
Also i use bubble upnp on my server which i can access from an external network no problem using my ddns address looking at port 58050,so i guess something is working, its just my tvbox i cant access remotely on port 8005.
Thanks
Please provide more details of you network structure. What devices you have? Your IP addresses of WAN LAN NICs ...
It seems that there is a confusion in your network configuration. You are trying to NAT a port which hits your internal GW to a internal IP. This is not how it should work. You should try to forward requests hitting your external IP into your internal network/IP (LAN).
-> modem -> linux router -> TVbox
for all devices - interfaces, IP addresses (external WAN, internal LAN)
Also describe from where you are trying to access the TVbox (when it doesn't work). What are you using to access it (domain name, WAN IP ??)
It's hard to recommend iptables rules until it's not clear what is you network structure...
Hi hua, thanks again for replying and your patience! I think I've copied below the relevant bits from my system.
if you need more information, please let me know.
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0 eth1 wlan0
iface lo inet loopback
iface eth0 inet dhcp
dns-nameservers xx.222.18.xx xx.222.18.xx
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.