How to set up IP forwarding on Nexenta (Solaris)?

Posted by Gleb on Server Fault See other posts from Server Fault or by Gleb
Published on 2012-10-29T22:44:02Z Indexed on 2012/10/30 5:05 UTC
Read the original article Hit count: 513

Filed under:
|
|
|
|

I am trying to set up IP forwarding on my Nexenta box:

root@hdd:~# uname -a
SunOS hdd 5.11 NexentaOS_134f i86pc i386 i86pc Solaris

The box has 2 network interfaces:

root@hdd:~# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
e1000g1: flags=1001100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4,FIXEDMTU> mtu 1500 index 2
    inet 192.168.12.2 netmask ffffff00 broadcast 192.168.12.255
    ether 68:5:ca:9:51:b8
myri10ge0: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 9000 index 3
    inet 10.10.10.10 netmask ffffff00 broadcast 10.10.10.255
    ether 0:60:dd:47:87:2
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
    inet6 ::1/128

192.168.12.0 is my normal LAN with 192.168.12.1 being the firewall/gateway

10.10.10.0 is a separate LAN for iSCSI (with no internet access)

I want to set up IP forwarding so that a computer on 10.10.10.0 will be able to access the internet by using 10.10.10.10 as a gateway (I don't need any port forwarding)

I have turned on IP forwarding:

root@hdd:~# routeadm
          Configuration   Current              Current
                 Option   Configuration        System State
---------------------------------------------------------------
           IPv4 routing   disabled             disabled
           IPv6 routing   disabled             disabled
        IPv4 forwarding   enabled              enabled
        IPv6 forwarding   disabled             disabled

       Routing services   "route:default ripng:default"

Routing daemons:

                  STATE   FMRI
               disabled   svc:/network/routing/rdisc:default
               disabled   svc:/network/routing/route:default
               disabled   svc:/network/routing/legacy-routing:ipv4
               disabled   svc:/network/routing/legacy-routing:ipv6
               disabled   svc:/network/routing/ripng:default
                 online   svc:/network/routing/ndp:default

But when I dry to start ipnat, I get an error:

root@hdd:~# ipnat -CF -f /etc/ipf/ipnat.conf
ioctl(SIOCGNATS): I/O error

Here is the config:

root@hdd:~# cat /etc/ipf/ipnat.conf
#!/sbin/ipnat -f -
#
map e1000g1 10.10.10.10/24 -> 192.168.12.2/32

So the question is how to fix this.. Thanks in advance!

© Server Fault or respective owner

Related posts about ip

Related posts about solaris