Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Question public subnet behind Linux Router

    following are my Linux router information

    eth1= WAN IP=
    eth0= LAN IP=

    Chain POSTROUTING (policy ACCEPT)
    target prot opt source destination
    MASQUERADE all --

    routing table is

    My ISP gave me IP Pool to use this on my LAN.
    my question is how can I use this IP pool on LAN side interface.
    i think now its simple. /24 is my LAN network and I can not change this, because i have near 180 PCs on my LAN.

    Help require.


  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    you were assigned the subnet, thus you can address exactly the subnet mask count of computers from the internet by nat forwarding packets for these single ip's to a /29 subnet within your LAN and assigning the router device to listen for all the IPs from the subnet.

    so, nat forwarding the subnets would be (the ? is variable): => 192.168.1.?/29

    i.e. =>

    it can be easily done with iptables. use the search button or ask google how to set up nat forward.
    Last edited by Kloschüssel; 08-05-2010 at 11:18 AM.

  3. #3
    I did this but still no victory


  4. $spacer_open
  5. #4
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    You did what? For each ip you need to configure 3 things:

    1] router must listen on that ip (man ifconfig)
    2] router must accept the packets for the ip (man iptables)
    3] router must nat forward the packets for that ip to the internal subnet ip address (man iptables)

    As you have a /29 subnet, you should have 2^(32-29) = 8 ip addresses starting with

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts