Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to change this:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
178.212.120.5   192.168.1.254   255.255.255.255 UGH   0      0        0 eth2.2
208.67.222.222  192.168.1.254   255.255.255.255 UGH   0      0        0 eth2.2
192.168.1.0     *               255.255.255.0   U     0      0        0 eth2.2
192.168.10.0    *               255.255.255.0   U     0      0        0 br0
239.0.0.0       *               255.0.0.0       U     0      0        0 br0
default         192.168.1.254   0.0.0.0         UG    0      0        0 eth2.2

into this:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
178.212.120.5   192.168.1.254   255.255.255.255 UGH   0      0        0 ra0
208.67.222.222  192.168.1.254   255.255.255.255 UGH   0      0        0 ra0
192.168.1.0     *               255.255.255.0   U     0      0        0 ra0
192.168.10.0    *               255.255.255.0   U     0      0        0 br0
239.0.0.0       *               255.0.0.0       U     0      0        0 br0
default         192.168.1.254   0.0.0.0         UG    0      0        0 ra0

and configure NAT the way that:

  1. Public NAT interface is ra0 with IP 192.168.1.3
  2. NAT internal subnet is 192.168.10.0/24 on br0

The problem I got is that I know how to use Linux route and ifconfig commands but I know nothing about iptables.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

A "rough and ready" answer would be to use route and ifconfig to set up the ra interface and routing, and then issue an iptables command -

/sbin/iptables -t nat -I POSTROUTING -o ra0 -j MASQUERADE

This will masquerade (all) traffic going out ra0 but not br0. I note however that the "NAT interface of ra0 is not actually a real world IP address, so either you will be doing double nat or that IP address is incorrect.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.