1a105
![]() |
|
|
|
|
|||||||
| Firewalls IPFW, PF, IPF (but not limited) related discussion |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello, I'm trying to get my jails working but I have a problem. Indeed, only ICMP connections work, I can't stat the problem.
Here is my pf.conf Code:
#Macro
int_if = "fxp0"
# Tables
table <flood> persist
table <*beep**beep**beep**beep*er> persist
# Rules
set skip on lo0
set skip on lo1
scrub in all
nat on $int_if from lo1 to any -> ($int_if)
antispoof for fxp0 inet
block log all # Drop all
pass quick log on $int_if proto { icmp icmp6 } # Allow ping
pass out log on $int_if all
pass in quick on $int_if proto tcp from 192.168.1.29 to 192.168.1.40 port ssh
#pass in log on $int_if inet proto tcp from any to 192.168.1.40 port 30000 synproxy state (max-src-conn-rate 3/20, overload <flood> flush global)
#pass in quick log on $int_if proto tcp from 192.168.1.0/24 to 192.168.1.40 port 9050
#pass in log on $int_if proto tcp from {!192.168.1.0/24, 10.0.0.0/24} to 192.168.1.40 port 9001
pass in quick log on $int_if from 192.168.50.2 to any
#block quick on $int_if from <flood>
#block quick on $int_if from <*beep**beep**beep**beep*er>
Thank you. |
|
#2
|
||||
|
||||
|
What exactly is the problem? You can't resolve your jail hostnames or you can't resolve anything inside a jail?
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#3
|
|||
|
|||
|
Sorry, I can ping everything but resolving google.fr for example times out.
|
|
#4
|
||||
|
||||
|
Ah, so it's resolving inside the jail that's the issue. Is /etc/resolv.conf set up properly in the jail?
There are also no rules allowing TCP/UDP port 53 out for DNS.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#5
|
|||
|
|||
|
Code:
cat /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4 Quote:
Code:
pass out log on $int_if all I told that ICMP connections worked, and I had to allow raw sockets for debugging
|
|
#6
|
||||
|
||||
|
It depends, that allows queries back into your network. But you are using Google's DNS servers, so they are external. Somewhere on your network they need a way out.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#7
|
|||
|
|||
|
I only have one interface on my server.
|
|
#8
|
||||
|
||||
|
Have a look with tcpdump(1). Pay close attention to the source addresses of the queries (the NAT might not work properly).
# tcpdump -nvvi fxp0 port 53
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#9
|
|||
|
|||
|
Code:
tcpdump -nvvi fxp0 port 53 Quote:
So the problem is that the server doesn't forward the query to jail. How may I fix this ? |
|
#10
|
||||
|
||||
|
Is the jail bound to lo1? And what IP address does it have?
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#11
|
|||
|
|||
|
No, she is not. I was looking for this, how do I do so ?
Its ip is 192.168.1.52(/24) |
|
#12
|
||||
|
||||
|
If the jail has 192.168.1.52 then why are the DNS queries coming from 192.168.1.40?
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#13
|
|||
|
|||
|
Because of the nat rule. I know it's not compulsory but I'd like doing that way.
|
|
#14
|
||||
|
||||
|
And it's probably what's causing the issues. Remove it. As you don't have anything bound to lo1 anyway it's rather useless.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#15
|
|||
|
|||
|
But it might work with nat, no ?
|
|
#16
|
||||
|
||||
|
You don't need NAT.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#17
|
||||
|
||||
|
Please can you share the exact network range for fpx0 lo1 ? As I understood it your jail IP is behind lo1 interface.
Also share the output from: # netstat -nrfinetThis is just my opinion, but it's better to call your external interface "ext_if" rather than "int_if" (short for external/internal). Also if you start to use macros use them throughout the whole configuration (e.g. line 10 vs line 11 /not counting spaces/). There's more way to do it, but as you started creating custom interfaces you must pay attention to what is visible and what not to external network. One way is to put all IPs to fxp0 and setup the jail. You don't need NAT for that. Or you can setup the custom interface with private range and NAT it through IP on fxp0.
__________________
..when you do things right, people won't be sure you've done anything at all.. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can not access own web server from within own box with FQDN | MNIHKLOM | General | 6 | October 25th, 2012 10:13 |
| How to resolve this problem? | enhhn17 | Userland Programming & Scripting | 6 | March 1st, 2012 13:15 |
| Jails: Host should ignore IPs of Jails | Thorny | Networking | 12 | February 22nd, 2012 09:15 |
| Unable to resolve LAN, can resolve internet | v0idE | Networking | 6 | April 28th, 2010 15:46 |
| [Solved] Unable to mount nullfs for Jails on ZFS | volatilevoid | General | 6 | January 21st, 2010 17:12 |