INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

AIX firewall accept established connection

AIX firewall accept established connection

(OP)
I'm trying to configure a firewall for AIX to accept incoming connections on ports 22 and 443 and deny everything else. All is ok; the server accepts connections only on 22 and 443, but after that I also need to accept all outgoing connections -- ssh and telnet, for example. So I started with

CODE -->

genfilt -v 4 -a P -s 0.0.0.0 -m 0.0.0.0 -d x.x.x.x -M 255.255.255.255 -c tcp -o any -p 0 -O eq -P 22 -w I -i all
genfilt -v 4 -a P -s 0.0.0.0 -m 0.0.0.0 -d x.x.x.x -M 255.255.255.255 -c tcp -o any -p 0 -O eq -P 443 -w I -i all
genfilt -v 4 -a D -s 0.0.0.0 -m 0.0.0.0 -d x.x.x.x -M 255.255.255.255 -c tcp -o any -p 0 -O any -P 0 -w I -i all 
Afterwards, I had to accept outgoing connections, so I introduced another rule:

CODE -->

genfilt -v 4 -a P -s 0.0.0.0 -m 0.0.0.0 -d x.x.x.x -M 255.255.255.255 -c tcp -o any -p 0 -O eq -P 22 -w I -i all
genfilt -v 4 -a P -s 0.0.0.0 -m 0.0.0.0 -d x.x.x.x -M 255.255.255.255 -c tcp -o any -p 0 -O eq -P 443 -w I -i all
**genfilt -v 4 -a P -s x.x.x.x -m 255.255.255.255 -d 0.0.0.0 -M 0.0.0.0 -c tcp -o any -p 0 -O any -P 0 -r L -w O -i all**
genfilt -v 4 -a D -s 0.0.0.0 -m 0.0.0.0 -d x.x.x.x -M 255.255.255.255 -c tcp -o any -p 0 -O any -P 0 -w I -i all 
and after that tried more rules:

CODE -->

genfilt -v 4 -a P -s 0.0.0.0 -m 0.0.0.0 -d 0.0.0.0 -M 0.0.0.0 -c tcp/syn -o any -p 0 -O any -P 0 -w O -i all
genfilt -v 4 -a P -s 0.0.0.0 -m 0.0.0.0 -d 0.0.0.0 -M 0.0.0.0 -c tcp -o any -p 0 -O any -P 0 -w O -i all 
But outgoing connections still not working, does anyone have any knowledge about this?

RE: AIX firewall accept established connection

hmm,
it works for me but I did it as follows - simple example for adding additional ssh/22 rule on existing configuration:

CODE --> example

# rmfilt -v 4 -n all
Filter rule 3 for IPv4 has been removed successfully.
Filter rule 4 for IPv4 has been removed successfully.
Filter rule 5 for IPv4 has been removed successfully.
# genfilt -v 4 -a P -s 10.10.10.49 -m 255.255.255.0 -d 10.10.10.244 -M 255.255.255.0 -g Y -O eq -P 22 -w I -i all
Filter rule 3 for IPv4 has been added successfully.
# genfilt -v 4 -a D -s 0.0.0.0 -m 0.0.0.0 -d 0.0.0.0 -M 0.0.0.0 -O eq -P 22 -w I -i all
Filter rule 4 for IPv4 has been added successfully.
# mkfilt -v 4 -u -g start

----==== adding new ====------
# genfilt -v 4 -a P -s 192.168.10.207 -m 255.255.254.0 -d 0.0.0.0 -M 0.0.0.0 -O eq -P 22 -w I -i all
Filter rule 5 for IPv4 has been added successfully.
# ckfilt -v 4 -O
Beginning of IPv4 filter rules.
2|*** Dynamic filter placement rule for IKE tunnels ***|no
3|permit|10.10.10.49|255.255.255.0|10.10.10.244|255.255.255.0|yes|all|any|0|eq|22|both|inbound|no|all packets|0|all|0|||
4|deny|0.0.0.0|0.0.0.0|0.0.0.0|0.0.0.0|yes|all|any|0|eq|22|both|inbound|no|all packets|0|all|0|||
5|permit|192.168.10.207|255.255.254.0|0.0.0.0|0.0.0.0|yes|all|any|0|eq|22|both|inbound|no|all packets|0|all|0|||
0||0.0.0.0|0.0.0.0|0.0.0.0|0.0.0.0|no|0|???|0|???|0|?????|????????|no|???????|0||0|||
# IP=192.168.10.207;PORT=22;mvfilt -v4 -p $(lsfilt -v4 -O|awk -F\| -vr=${PORT} -vc=${IP} '$2=="permit"&&$3==c&&$12==r{print$1}') -n $(lsfilt -v4 -O|awk -F\| -vr=${PORT} '$2=="deny"&&$12==r{print$1}')
Filter rule 5 for IPv4 has been moved to 4 successfully.
# ckfilt -v 4 -O
Beginning of IPv4 filter rules.
2|*** Dynamic filter placement rule for IKE tunnels ***|no
3|permit|10.10.10.49|255.255.255.0|10.10.10.244|255.255.255.0|yes|all|any|0|eq|22|both|inbound|no|all packets|0|all|0|||
4|permit|192.168.10.207|255.255.254.0|0.0.0.0|0.0.0.0|yes|all|any|0|eq|22|both|inbound|no|all packets|0|all|0|||
5|deny|0.0.0.0|0.0.0.0|0.0.0.0|0.0.0.0|yes|all|any|0|eq|22|both|inbound|no|all packets|0|all|0|||
0||0.0.0.0|0.0.0.0|0.0.0.0|0.0.0.0|no|0|???|0|???|0|?????|????????|no|???????|0||0|||
# mkfilt -v 4 -u -g start
# 

I just can't now explain the difference between rules:
|permit|192.168.10.207|255.255.254.0|0.0.0.0|0.0.0.0|yes|all|any|0|eq|22|both|inbound|no|all packets|0|all|0|||
and
|permit|0.0.0.0|0.0.0.0|192.168.10.207|255.255.254.0|yes|all|any|0|eq|22|both|inbound|no|all packets|0|all|0|||

-- the host with IP 192.168.10.207 can ssh access the host with any of above rule...(doesn't matter 192.168.10.207|255.255.254.0 is on source side or on target in the rule)


RE: AIX firewall accept established connection

(OP)
Hi @w5000, ssh works from localhost but I need all ports to work from localhost to other hosts, like telnet, wget..80, 443, etc..

RE: AIX firewall accept established connection

hello,
I have checked and my setting doesn't block any connection from local-host to other hosts. It only grants access co incoming ssh connection for the two IPs (permit rules).

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close