ipf/ipnat NAT/port forward issues


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users ipf/ipnat NAT/port forward issues
# 1  
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.
# 2  
Old 02-13-2012
That has nothing to do with ipf nor ipnat, and you're talking about Linux, not Solaris. You should start a new thread.

Last edited by jim mcnamara; 02-13-2012 at 06:20 PM.. Reason: post removed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question

Featured Tech Videos