OpenWrt Forum Archive

Topic: How Masquerading works and how can i use it on my PC?

The content of this topic has been archived on 17 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have a router which has LAN Masquerading. I do not know how to work on it. Explain how LAN Masquerading works and what I need to configure on my LAN PC (Ubuntu 12.04LTS) ?

lets start with what you are trying to do

masquerade function is a network address translation (NAT) technique implemented in linux netfiilter code
any router have NAT (masquerade) and you need just an assigned ip address and default routing set to your router to use NAT

(Last edited by stas2z on 19 Jul 2016, 08:46)

Hello stas2z,

I have a WAN IP, WAN gateway, LAN DHCP server and LAN gateway for my router. From LAN client able to reach Internet.
WAN IP: 10.102.1.x
WAN Gateway: 10.102.1.1
LAN Interface IP: 192.168.1.1
LAN IP: 192.168.1.219
LAN Subnet Mask: 255.255.255.0

Also I have a separate DHCP server on my LAN client.
DHCP server: 192.168.100.1
IP range: 192.168.100.1-254
Subnet Mask: 255.255.255.0

By LAN Masquerade,Can I share my internet to Clients of my LAN client?

Router <--> LAN PC-1 (eth0) <--> LAN PC-1 (eth1) DHCP server <--> LAN PC-2

(Last edited by arutkavig1081 on 19 Jul 2016, 15:20)

yes, but you need to enable NAT at your LAN client, your router will not help you with it
for Windows it called Internet Connection Sharing (ICS)

an other way is to setup routing (to use routers nat), in such case you need to write a custom routing rule on your router (192.168.100.0/24 through 192.168.1.219 as example, be sure this IP is static for yr "LAN Client") and enable forwarding at your "LAN client"

(Last edited by stas2z on 19 Jul 2016, 12:50)

stas2z,

enable forwarding at your "LAN client"

If I enable the forwarding in LAN client, it forwards all packets including internet packets. Then there is no need to enabling "LAN  Masquerade". Without enabling LAN masquerade I can able to access internet from "ETH1" interface. Kindly update how to use LAN Masquerade?

The discussion might have continued from here.