Sponsored Content
Top Forums UNIX for Advanced & Expert Users ipf/ipnat NAT/port forward issues Post 302575347 by spakov on Monday 21st of November 2011 10:56:27 AM
Old 11-21-2011
ipf/ipnat NAT/port forward issues

I've been going crazy trying to get this working. Here's the situation: we have a Solaris 10 box that connects an internal network to an external network. We're using ipf/ipnat on it. We've added a couple of new boxes to the internal network (192.168.1.100, .101) and want to be able to get to port 80 on them from the external network (say, at ports 81 and 82). We'd also like to allow the internal boxes to get to the rest of the world using NAT. ipf/ipnat seems like it can do this.

Here's an ifconfig -a from the Solaris box:
Code:
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 192.168.0.2 netmask ffffff00 broadcast 192.168.0.255
        ether 8:0:27:b6:64:40
e1000g1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 192.168.1.1 netmask ffffff00 broadcast 192.168.1.255
        ether 8:0:27:24:f0:95
e1000g2: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 4
        inet 10.0.4.15 netmask ffffff00 broadcast 10.0.4.255
        ether 8:0:27:90:3c:a

e1000g0 is connected to the external network. e1000g1 is connected to the internal network. e1000g2 is connected to the Internet.

I've got these rules in ipnat.conf:
Code:
map e1000g1 192.168.1.0/24 -> 0/32 portmap tcp/udp 10000:20000
map e1000g1 192.168.1.0/24 -> 0/32
rdr e1000g1 0.0.0.0/0 port 81 -> 192.168.1.100 port 80

ipf.conf is configured to allow all traffic.

Network connectivity is solid. Everything is connected the way it's supposed to be and I can get to everything from everywhere I'd expect to be able to.

Here's the problem: my maps and rdrs don't work. I can try to do something that gets me to the outside from the internal box (192.168.1.100) and I get this in ipnat -l, but the connection doesn't actually work:
Code:
List of active MAP/Redirect filters:
map e1000g1 192.168.1.0/24 -> 0.0.0.0/32 portmap tcp/udp 10000:20000
map e1000g1 192.168.1.0/24 -> 0.0.0.0/32
rdr e1000g1 192.168.0.0/24 port 81 -> 192.168.1.100 port 80 tcp

List of active sessions:
MAP 192.168.1.1     <- -> 192.168.1.1     [192.168.1.100]

If I try to get to http://192.168.0.2:81/ from the external network, though, I get no new "active sessions" entry from ipnat -l (and obviously the page doesn't load).

Any thoughts as to what I'm doing wrong here? Hopefully it's something stupid I've just overlooked. I've spent way more time on this than I'd hoped to when I started. I've tried any number of variations and have Googled extensively to no avail.

Any help is appreciated.
 

10 More Discussions You Might Find Interesting

1. IP Networking

NAT Packets/Port Openine

Firstly, I have no knowledge of hubs, so please keep any advice simple! I have a UNIX hub, connecting three PCs and would like to know if the hub has NAT translation for incoming packets and if th hub is able to NAT translate packets coming in to a local (internal) LAN address.. (3 Replies)
Discussion started by: MartinD
3 Replies

2. IP Networking

Destination NAT using ipnat in Solaris 8

Hello People, Please can someone help me with destination IP address NAT and Port transalation using ipnat in Solaris 8. Scenario: Box A(192.168.100.1/24) and Box B (192.168.100.50/24) are connected phyically and logically(vlan) on the same network switch. Box A hosts an... (0 Replies)
Discussion started by: mandarawachat
0 Replies

3. UNIX for Advanced & Expert Users

ssh port forward over three server

Hello there, I have a big problem, and I hope somebody can help me. I try to realize a port forward over three server. Here is a picture... Client Server1 | Server2 ------- ------- | ------- |...... | |...... | | |...... ... (2 Replies)
Discussion started by: Art007
2 Replies

4. Cybersecurity

IPF pass in connection to port 21 even with no explicit rule

I'm running IPF on solaris 10 bash-3.00# ipf -V #display ipf version ipf: IP Filter: v4.1.9 (592) Kernel: IP Filter: v4.1.9 Running: yes Log Flags: 0 = none set Default: pass all, Logging: available Active list: 1 Feature mask: 0x107 with the following rules bash-3.00# ipfstat -o -i... (0 Replies)
Discussion started by: h@foorsa.biz
0 Replies

5. Solaris

Solaris 11 Express NAT performance issues

Hi all, I decided to replace my linux router/firewall with Solaris 11 express. This is a pppoe connection directly to my server...no router boxes. I got everything setup, but the performance is terrible on the NAT....really slow. A web page that loads on the server instantly will take... (3 Replies)
Discussion started by: vectox
3 Replies

6. IP Networking

iptables forward public IP, no NAT, Debian i386

Hello all, got kinda problem. Have two machines in LAN, one of them connected to Internet directly, another one must be forwarded through the first one. Masquerading works perfectly, but is not what is needed here. Both machines have public IP addresses, when the second machine is forwarded its... (0 Replies)
Discussion started by: Action
0 Replies

7. Debian

Iptables Nat forward port 29070

Hello, the Nat and the forward worked on my debian server up to the reboot of machines. The following rules*: /sbin/iptables -t nat -A PREROUTING -p tcp -i eth2 -d xxx.xxx.xxx.xxx --dport 29070 -j DNAT --to-destination 10.0.1.7:29070 /sbin/iptables -A FORWARD -p tcp -i eth2 -o eth0 -d... (0 Replies)
Discussion started by: titoms
0 Replies

8. UNIX for Dummies Questions & Answers

Issues with sort and forward slash

I have some directories I am trying to sort. When I attempt to sort them and they are in this format, everything works great: file /vol/trees10 /vol/trees2 /vol/trees7 cat file |sort -ts -k2 -n /vol/trees2 /vol/trees7 /vol/trees10 This makes thefiles in the order... (9 Replies)
Discussion started by: newbie2010
9 Replies

9. IP Networking

Debugging NAT / prerouting issues (iptables)

Hello, Recently I discovered an issue with packet routing in the latest Android releases (4.4+ KitKat & Lollipop). It seems that the problem Android specific, but essentially it comes from the Linux kernel. I already filed a bug report to Google. You can see the details by searching for... (0 Replies)
Discussion started by: Vladislav
0 Replies

10. Red Hat

Port Forward to VPN client.

Hi all, I can't port forward from WAN to VPN Client. VPN Client Ubuntu 18 192.168.0.16 Port 6000 VPN Gateway for LAN clients Centos 192.168.0.12 Router 192.168.0.1 I can forward to the VPN Client if VPN is not connected if I forward Port 6000 from 192.168.0.1 directly to 192.168.0.16.... (2 Replies)
Discussion started by: stinkefisch
2 Replies
tgt-setup-lun(8)					      System Manager's Manual						  tgt-setup-lun(8)

NAME
tgt-setup-lun - creates a target, adds a device to the target and defines initiators that can connect to the target SYNOPSIS
tgt-setup-lun -d device -n target_name [initiator_IP1 initiator_IP2 ...] [-h] DESCRIPTION
Starts tgtd if necessary and creates a target according to the supplied target_name. The format of the target name is as follows: iqn.2001-04.com.<hostname>-<target_name> The target name must be unique. The script then adds the requested device to the target. If specific IP addresses are defined, it adds them to the list of allowed initia- tors for that target. If no IP addresses is defined, it defines that the target accepts any initiator. EXAMPLES
Create a target that uses /dev/sdb1 and allows connections only from 192.168.10.81: tgt-setup-lun -d /dev/sdb1 -n my_target 192.168.10.81 Create a target that uses /dev/sdb1 and allows connections only from 192.168.10.81 and 192.168.10.82: tgt-setup-lun -d /dev/sdb1 -n my_target 192.168.10.81 192.168.10.82 Create a target that uses /dev/sdb1 and allows connections from any initiator: tgt-setup-lun -d /dev/sdb1 -n my_target Display help: tgt-setup-lun -h AUTHOR
Written by Erez Zilber REPORTING BUGS
Report bugs to <erezz@voltaire.com>. COPYRIGHT
Copyright (C) Voltaire Ltd. 2008. tgt-setup-lun(8)
All times are GMT -4. The time now is 08:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy