Skip to contentSkip to conversation

Universal Address Translation

DISCUSSION Rio Martin. 3 participants 7 messages Jul 24, 2004

lore
Share & tools
lore
#0 lore raw

Dear folks,
I am so curious to find out more how to use Universal Address Translation with iptables.
Is there any document related to this ?

Thanks before.

Regards,
Rio Martin.

#1 lore raw
Quoted 2 lines · Rio Martin.

I am so curious to find out more how to use Universal Address Translation with iptables.

What is "Universal Address Translation" please ?

Signature · 2 lines
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
Quoted 2 lines
Quoted 2 lines

Hi! I'm your friendly neighbourhood signature virus. Copy me to your signature file and help me spread!

#6 lore raw
In reply to Rio Martin.
Quoted 3 lines · Rio Martin.

Dear folks,
I am so curious to find out more how to use Universal Address Translation with iptables.

What do you mean by "universal" address translation?

Quoted 1 line

Is there any document related to this ?

Well, there's this, but I don't know if it is quite what you're looking for:
http://www.netfilter.org/documentation/HOWTO/NAT-HOWTO.html
it discusses how to do Network Address Translation with netfilter.

You could also try Oskar's excellent tutorial:
http://iptables-tutorial.frozentux.net/chunkyhtml/targets.html#DNATTARGET
http://iptables-tutorial.frozentux.net/chunkyhtml/targets.html#SNATTARGET
http://iptables-tutorial.frozentux.net/chunkyhtml/targets.html#MASQUERADETARGET

Regards,

Antony.

Signature · 7 lines
These clients are often infected by viruses or other malware and need to be 
fixed.  If not, the user at that client needs to be fixed...

 - Henrik Nordstrom, on Squid users' mailing list

                                                     Please reply to the list;
                                                           please don't CC me.
#2 lore raw
In reply to Cedric Blancher
Quoted 4 lines · Cedric Blancher
Quoted 2 lines · Rio Martin.

I am so curious to find out more how to use Universal Address Translation with iptables.

What is "Universal Address Translation" please ?

I did googling first before i posted to this list:
http://www.google.com/search?hl=en&ie=UTF-8&q=%22Universal+Address+Translation%22&btnG=Google+Search

and found interesting link:

[isp-wireless] RE: How do Hotels, Starbucks, Hot Spots do this? ... ... Better yet most of the vendors below support Universal Address Translation,
which allows a user to connect no matter what the ip or static vs. dhcp. ... isp-lists.isp-planet.com/ isp-wireless/0404/msg01168.html - 21k - Cached - Similar pages

Actually the idea is the same as link above. UAT (Universal Address Translation) works to handle Address Translation for Hotspot Client Access, which clients no need to change anything for their PCs or Notebooks to access to Internet. Eventhough they put wrong TCP/IP Configuration, they still able to surf to Internet.

Thats what i got for the definition and meaning of Universal Address Translation.
Perhaps anyone would like to correct or add some information more regarding this ? Please..

Regards,
Rio Martin.

#3 lore raw
Quoted 7 lines · Rio Martin.

[isp-wireless] RE: How do Hotels, Starbucks, Hot Spots do this? ... ... Better yet most of the vendors below support Universal Address Translation,
which allows a user to connect no matter what the ip or static vs. dhcp. ... isp-lists.isp-planet.com/ isp-wireless/0404/msg01168.html - 21k - Cached - Similar pages

Quoted 5 lines

Actually the idea is the same as link above. UAT (Universal Address Translation) works to handle Address Translation for Hotspot Client Access, which clients no need to change anything for their PCs or Notebooks to access to Internet. Eventhough they put wrong TCP/IP Configuration, they still able to surf to Internet.

This sounds to me like it has to work at the MAC / ethernet / 802.11 layer, below IP.

If you intercept all traffic at the MAC layer, and make sure to put whatever IP address the client thinks it has in the IP headers of reply packets, then you'd be able to communicate with any machine no matter how it's configured (so long as it *has* an IP address, and expects to find a gateway router somewhere).

I'd suggest ebtables might be a good direction to investigate, since it does things at the next layer down, below IP, much more than iptables does.

Other than that, a little fiddling around with point-to-point routing,
iproute2, and arp cache manipulation may do what you want. (eg: capture all
packets, discover source IP address, insert p-t-p route for that IP address, masquerade everything going out of your upstream link, hope nobody comes along with a laptop configured with an IP address belonging to Google, or your upstream ISP etc)

Regards,

Antony.

Signature · 7 lines
"There is no reason for any individual to have a computer in their home."

 - Ken Olsen, President of Digital Equipment Corporation (DEC, later consumed 
by Compaq, later merged with HP)

                                                     Please reply to the list;
                                                           please don't CC me.
#4 lore raw
In reply to Rio Martin.
Quoted 4 lines · Rio Martin.

[isp-wireless] RE: How do Hotels, Starbucks, Hot Spots do this? ... ... Better yet most of the vendors below support Universal Address Translation, which allows a user to connect no matter what the ip or static vs. dhcp. ...

That's what I though it was :)

There's not exactly a NAT issue. There's nat, but the issue is to grab traffic to the gateway in order to have it route it the right place and NAT it correctly. In fact, what you have to do is to set sort of universal proxy ARP that is able to answer any ARP request with gateway MAC address.

I've quite successfully achieve this using arpd daemon used with honeyd. This daemon answers any ARP request with a given MAC address (its MAC address). So any traffic within the LAN is directed to arpd host.

Now we must handle DNS requests, for which we just have to DNAT UDP and TCP destined to port 53 to our proper DNS server :

iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to $DNS iptables -t nat -A PREROUTING -p tcp --dport 53 -j DNAT --to $DNS

For normal traffic, I use default route to send packets away and SNAT the usual way :

iptables -t nat -A POSTROUTING -o $EXTIF -j SNAT --to-source $EXTIP

To handle returning packets properly regarding routing, because we don't want them to hit default route. As far as I can remember, I used packet marking and nfmark based routing :

iptables -t mangle -A PREROUTING -i $EXTIF -j MARK --mark 0x01

So I knew a packet marked is a returning packet that has to get routed directly to internal interface (see LARTC[1] for fwmark routing configuration).

I didn't do much testing on this, but things seemed to go quite well. I guess this is what I set up. You can try and give feedback.

[1] http://lartc.org/

Signature · 2 lines
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
Quoted 2 lines
Quoted 2 lines

Hi! I'm your friendly neighbourhood signature virus. Copy me to your signature file and help me spread!

#5 lore raw

And one thing I forgot... I didn't solve IP addresses collisions (two clients can have the same IP), but here are some ideas. You have to isolate clients one from any other.

On wired network, it's what Cisco calls Private VLAN settings : a given ethernet port is only allowed to speak to gateway's port. Only the gateway can see all ports.

On wireless network, you have to forbid frames bridging between clients. At Cisco's, they call this PSPF (Publicly Secure Packet Forwarding). If you use hostap[1] driver, you just have to set related sysctl entry (don't remember name, but it's self explanary) to 0 and you're done.

Signature · 2 lines
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
Quoted 2 lines
Quoted 2 lines

Hi! I'm your friendly neighbourhood signature virus. Copy me to your signature file and help me spread!