Find the answer to your Linux question:
Results 1 to 2 of 2
I have eth0 for administration, and vlans eth0.2 eth0.3 and br0 for resource seperation. My esternal interface is ra0. each internal interface is on a seperate subnet, and I have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    15

    iptables NAT to multiple vlans?


    I have eth0 for administration, and vlans eth0.2 eth0.3 and br0 for resource seperation. My esternal interface is ra0.

    each internal interface is on a seperate subnet, and I have dhcpd giving connecting devices ip addresses out of their assigned network. I want all of the devices to be able to access the internet through NAT, and I need to allow them to communicate with port 80 on eth0's subnet

    eth0 10.0.0.0/24
    eth0.2 10.2.0.0/24
    eth0.3 10.3.0.0/24
    br0 10.4.0.0/24

    -ben

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    Code:
    -A POSTROUTING -o iface -j MASQUERADE
    Change iface to you interface that is facing outwards.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

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