Hot Downloads



The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1


Simple MASQUERADING in Linux 14 years 9 months ago #5413

  • Maskkkk
  • Maskkkk's Avatar Topic Author
  • Offline
  • Frequent Member
  • Frequent Member
  • Posts: 42
  • Thank you received: 0
I'm just trying to do some simple MASQUERADING with a linux box I setup as a router on my internal network. The router resides behind another linksys router which is connected to my internet connection.

eth1 of the linux router is on the network behind the linksys router on the network with an IP address of

eth0 of the router is on the network with an IP of
This network ( has my laptop connected to it with an IP of

The linux router can talk to the internet from the linksys router via eth1.

Now my question is (and I've read the NAT tutorial) and Rusty's guide to Iptables how do I do ipmasquerading on the linux box so that my laptop can share the internet connection through the linux router?

The best I've been able to come up with is that I need to try this....
(but it doesn't work)

# eth1 - Incoming Interface
# (Incoming interface from the network)
# eth0 - Outgoing Interface
# (Outgoing interface from the private network)
# Make all the packets from the internal private
# network look as though they came from the router
# by Source NATing their source address when they
# exit the router.
# (i.e. change the packets source address so it matches
# that of the router.)
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

After running this script in the router I still can't ping any of the computers on the network.

Also, what file is the mapping in the router done in?
Is it the /proc/net/ip_conntrack?

One more thing, does it have something to do with the route command? I always need to type that to get my laptop to work with my linux router, I know it has to do with giving the laptop a route to other networks and assigning a gateway, but I don't fully understand the route command.

Thank you,
[img] in the Ozone Layer.gif

- A Man is not an island...that's why we have fourms!
  • Page:
  • 1
Time to create page: 0.099 seconds


Cisco Routers

  • SSL WebVPN
  • Securing Routers
  • Policy Based Routing
  • Router on-a-Stick

VPN Security

  • Understand DMVPN
  • GRE/IPSec Configuration
  • Site-to-Site IPSec VPN
  • IPSec Modes

Cisco Help

  • VPN Client Windows 8
  • VPN Client Windows 7
  • CCP Display Problem
  • Cisco Support App.

Windows 2012

  • New Features
  • Licensing
  • Hyper-V / VDI
  • Install Hyper-V


  • File Permissions
  • Webmin
  • Groups - Users
  • Samba Setup