deck16
asked on
Simple question: closing ports
I want to close off some ports on my machine and I was told to use iptables (I have kernel 2.4.3). I can't figure out how to do it from the man page. What command would I issue to say close off port 111?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you put a place to put my IP. I don't have a static IP. What do I put there? (localhost?)
ASKER
rrr, I hate the auto-login (sorry for posting with a different account I'm at by brother's house (zxcvzxcv) not used to having to logout and then back in :-)
What about
ADDR=$(/sbin/ifconfig ppp0 | grep addr | cut -d':' -f 2 | cut -d' ' -f 1)
There the address is set as it IP number of your machine
and later refer to the IP address as $ADDR
Like
iptables -A FORWARD -d $ADDR/32 --dport 111 -j DROP
ADDR=$(/sbin/ifconfig ppp0 | grep addr | cut -d':' -f 2 | cut -d' ' -f 1)
There the address is set as it IP number of your machine
and later refer to the IP address as $ADDR
Like
iptables -A FORWARD -d $ADDR/32 --dport 111 -j DROP
ASKER
why $ADDR/32 in the iptables argument?
that is the mask for the address 32 bits = 255.255.255.255