Solved

jlivie firewall script

Posted on 2004-08-31
10
179 Views
Last Modified: 2010-04-22
hi you gave me a script a while back and i was wondering where i put my ip address for the line below from file call ./iptables-gw

# Uncomment the following  if the inside machines are trustworthy and
# there are services on the firewall, like DNS, web, etc., that they need to
# access. And remember to change the  IP to be that of the INSIDE interface
# of the firewall.
#
$IPT -A INPUT -i $INSIDE -d $INSIDE_IP -j ACCEPT


and
at the moment i only what one LOCAL PC to login via SSH on the internal LAN is this done in the script or SSHD_CONFIG file
0
Comment
Question by:jaxxman
  • 5
  • 5
10 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 11948989
INSIDE_IP is defined near the top of the file after the initial comment block.

If you only want a single IP on the inside to be able to use ssh you could use:

$IPT -A INPUT -i $INSIDE -s ssh-machine-ip -d $INSIDE_IP -p tcp --dport 22 -j ACCEPT

instead of allowing any machine on the inside to connect on any protocol, which is what the line in the question above does.
0
 

Author Comment

by:jaxxman
ID: 12031906
Sorry its took so long for me to get back i am a bit confussed this bit in the line
ssh-machine-ip
Is this the IP address of the PC which is going to connect to the SSH machine
or is this the PC with SSH on it.
by the way i am using SSH to connect to the firewall

Could you please remind me on something.
the iptables-gw file, i edit this file then run it and it updates my iptables. could you please tell me how the system knows that when i execute ./iptables-gw how does it know to update iptables
0
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 12031986
"-s ssh-machine-ip" would be the IP of the inside machine that will initiate the ssh connection.

> could you please tell me how the system knows that when i execute ./iptables-gw how does it know to update iptables

When you execute ./iptables-gw it will remove all existing iptables rules and set then back up again.
0
 

Author Comment

by:jaxxman
ID: 12032100
if i renamed iptables-gw will it still work.

still a bit confussed about SSH

the inside ip address of the firewall is 192.168.253.3 and this is the PC which i want to connect to which is running SSH
my windoes PC ip is 192.168.253.35
so in the script i would use this one 192.168.253.35
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12032282
You'd set:

INSIDE=192.168.253.3

in the script and add:

$IPT -A INPUT -i $INSIDE -s  192.168.253.35 -d $INSIDE_IP -p tcp --dport 22 -j ACCEPT

to iptables-gw. After running the script you'd be able to go to the windows box at 192.168.253.35 , start putty or some other ssh clinet and connect via ssh to your Linux firewall.

And no it doesn't matter what the name of the script file is. You could name it /root/have-a-nice-day and then execute it as ./have-a-nice-day from root's login.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:jaxxman
ID: 12034775
thanks.
just as a matter of interest is that your picture the one with the woman with sun glasses on. because its a really cool pic of you.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12039142
No, that's a made image of a non-existant person.
0
 

Author Comment

by:jaxxman
ID: 12039328
oh sorry, now i am lost as to what you look like but that not important as you are able to answer all my problems.

0
 
LVL 40

Expert Comment

by:jlevie
ID: 12039383
I really need to get a picture and turn it in...
0
 

Author Comment

by:jaxxman
ID: 12039409
yes that would be a good idea
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to line 1 45
kerberos passwd: Authentication token manipulation error 8 83
CentOS User Audit 3 82
The endless cat and mouse game of fail2ban 4 97
​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now