View previous topic :: View next topic |
Author |
Message |
jzono1 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 01 Feb 2004 Posts: 128
|
Posted: Tue Jan 24, 2006 12:50 pm Post subject: DNS, iptables and dropping. |
|
|
My apache serves different pages depending on the dns adress resolved to get to it. Would it be possible to only allow ssh, IF ssh was innitiated by ssh some.host.my.domain.com, but NOT some.other.host.my.domain.com? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
tuxmin l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/473518307438a03b302dca.jpg)
Joined: 24 Apr 2004 Posts: 838 Location: Heidelberg
|
Posted: Tue Jan 24, 2006 2:03 pm Post subject: |
|
|
Certainly, you can filter by source and/or target address. However, as it's called ipfilter and not dnsfilter, you cannot create rules by dns names if that was your question.
alex _________________ ALT-F4 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jzono1 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 01 Feb 2004 Posts: 128
|
Posted: Tue Jan 24, 2006 7:16 pm Post subject: |
|
|
Well, dns names is what i'd want.
Like, run a public http server on my.example.domain.com, with just letting through port 80 when someone scans my.example.domain.com, but allow ssh on another dns.
Is it even possible? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
tuxmin l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/473518307438a03b302dca.jpg)
Joined: 24 Apr 2004 Posts: 838 Location: Heidelberg
|
Posted: Wed Jan 25, 2006 9:03 am Post subject: |
|
|
You can always try to resolve these dns names to IP addresses. However, things will break with dynamic IPs. _________________ ALT-F4 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
HAL_9000 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/1004011790415afad3b4676.gif)
Joined: 29 Sep 2004 Posts: 114 Location: Netherlands
|
Posted: Wed Jan 25, 2006 1:16 pm Post subject: |
|
|
/sbin/iptables -A INPUT -i $iface -p tcp -s $youralloweddnsentry --sport 1024: -d $ip --dport 22 -m state --state NEW -j ACCEPT
/sbin/iptables -A OUTPUT -o $iface -p tcp ! --syn -s $ip --sport 22 -d $youralloweddnsentry--dport 1024: -j ACCEPT
with $iface being the network device in question, $ip being the IP of that network device in question
$youralloweddnsentry for the hostname you want to connect from...
(written for a DROP the rest policy :> ) _________________ We are the keepers of the sacred words: Ni peng and Nee wom! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|