LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-02-2013, 03:50 PM   #1
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
Newbie iptables loopback dns


I have a Zoom branded firewall running Zoom's linux firmware. I'm in the router and have a shell. The directions I've found for forcing a loopback dns lookup don't work with the device.

For example: http://www.smallbusinesstech.net/mor...cks-on-openwrt

This does not work.
Code:
iptables -t nat -A prerouting_rule -d 100.100.100.100 -p tcp --dport 80 -j DNAT --to 192.168.0.2
iptables -A forwarding_rule -p tcp --dport 80 -d 192.168.0.2 -j ACCEPT
iptables -t nat -A postrouting_rule -s 192.168.0.0/24 -p tcp --dport 80 -d 192.168.0.2 -j MASQUERADE
It returns "iptables: No chain/target/match by that name"

Code:
iptables -t mangle -L PREROUTING
This shows a PREROUTING rule, which is where I think I need to be.

I'm stuck as to what the incantation to port the loopback code to the mangle/PREROUTING would look like.

Any help is appreciated.

Last edited by mpapet; 09-02-2013 at 03:51 PM. Reason: iptables
 
Old 09-03-2013, 02:51 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
why are you asking about DNS when you're posting rules about TCP/80 i.e. http?

"prerouting_rule" would refer to a user defined table, and you'd need to create it first if it doesn't already exist. And once it exists, you'd need to chain onto it from a conventionally processed table, i.e. "PREROUTING". OR you just put it directly in "PREROUTING". Within the context of OpenWRT, i've no idea if this should or should not already exist.
 
Old 09-03-2013, 05:41 PM   #3
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Original Poster
Rep: Reputation: 72
Angry

Quote:
Originally Posted by acid_kewpie View Post
why are you asking about DNS when you're posting rules about TCP/80 i.e. http?
So computers inside the LAN making a request to a domain ON PORT 80 I host resolves to the local server.

Why does yogurt night have to be so difficult?!!?

Last edited by mpapet; 09-03-2013 at 05:52 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Route all traffic to Loopback with iptables altaf123 Linux - Networking 1 07-16-2013 12:37 PM
NAT Loopback and iptables 902849821 Red Hat 5 04-14-2013 08:53 AM
DNS listen only on loopback id_viorel Linux - Server 1 05-26-2009 08:32 AM
DNS requests go to loopback?? curiouspenguin Linux - Networking 5 09-20-2006 03:42 PM
sending out going traffic to the loopback interface with iptables hypexr Linux - Networking 1 09-22-2005 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration