iptables
来源:互联网 发布:windows光盘怎么安装 编辑:程序博客网 时间:2024/04/30 09:58
http://linux.vbird.org/linux_server/0250simple_firewall.php#netfilter
iptables 是利用封包过滤机制, 分析封包的表头资料,根据表头资料定义的规则来决定是否可以进入主机或者被丢弃.
刚才在服务器上练习的时候把自己给屏蔽了,提醒大家拿其他同学的ip做练习,哈哈.
$iptables [-t tables] [-L] [-nv]
-t: 后面接table, 例如nat 或者filter,如果省略此项目,则使用预设的filter
-L:列出目前的table的规则
-n: 不进行IP与HOSTNAME的反查
-v: 列出更多的信息,包括通过该规则的封包总位元数等
tty:[0] jobs:[0] cwd:[/opt/app]14:50 [root@a]$ iptables -L -nChain INPUT (policy ACCEPT)target prot opt source destination DROP all -- 10.103.55.165 0.0.0.0/0 Chain FORWARD (policy ACCEPT)target prot opt source destination Chain OUTPUT (policy ACCEPT)target prot opt source destination
15:08 [root@a]$ iptables -hiptables v1.3.5Usage: iptables -[AD] chain rule-specification [options] iptables -[RI] chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LFZ] [chain] [options] iptables -[NX] chain iptables -E old-chain-name new-chain-name iptables -P chain target [options] iptables -h (print this help information)Commands:Either long or short options are allowed. --append -A chainAppend to chain --delete -D chainDelete matching rule from chain --delete -D chain rulenumDelete rule rulenum (1 = first) from chain --insert -I chain [rulenum]Insert in chain as rulenum (default 1=first) --replace -R chain rulenumReplace rule rulenum (1 = first) in chain --list -L [chain]List the rules in a chain or all chains --flush -F [chain]Delete all rules in chain or all chains --zero -Z [chain]Zero counters in chain or all chains --new -N chainCreate a new user-defined chain --delete-chain -X [chain]Delete a user-defined chain --policy -P chain targetChange policy on chain to target --rename-chain -E old-chain new-chainChange chain name, (moving any references)Options: --proto-p [!] protoprotocol: by number or name, eg. `tcp' --source-s [!] address[/mask]source specification --destination -d [!] address[/mask]destination specification --in-interface -i [!] input name[+]network interface name ([+] for wildcard) --jump-j targettarget for rule (may load target extension) --goto -g chain jump to chain with no return --match-m matchextended match (may load extension) --numeric-nnumeric output of addresses and ports --out-interface -o [!] output name[+]network interface name ([+] for wildcard) --table-t tabletable to manipulate (default: `filter') --verbose-vverbose mode --line-numbersprint line numbers when listing --exact-xexpand numbers (display exact values)[!] --fragment-fmatch second or further fragments only --modprobe=<command>try to insert modules using this command --set-counters PKTS BYTESset the counter during insert/append[!] --version-Vprint package version.
接下来新建一条
15:10 [root@a]$ iptables -A INPUT -s 16.16.136.66 -j DROP
由于写的是自己的ip地址,回车后已不能继续在服务器上继续操作...只能找同学帮忙删了服务器上的配置
查看一下
15:12 [root@a]$ iptables -L -nChain INPUT (policy ACCEPT)target prot opt source destination DROP all -- 10.166.16.66 0.0.0.0/0 DROP all -- 16.16.136.66 0.0.0.0/0 Chain FORWARD (policy ACCEPT)target prot opt source destination Chain OUTPUT (policy ACCEPT)target prot opt source destination
15:12 [root@a]$ iptables -D INPUT 2
0 0
- IPTABLES
- Iptables
- iptables
- iptables
- Iptables
- iptables
- iptables
- iptables
- iptables
- IPTABLES
- iptables
- iptables
- iptables
- iptables
- iptables
- iptables
- iptables
- iptables
- cocos2d-x游戏是怎么跑起来的
- Delphi Xe DataSnap Rest + Flex 开发 基本探索3(取得后台 DataSet 数据集)
- spring security权限管理
- 如何更好地赚钱你的网站
- 如何改善搜索引擎排名,必须做技术
- iptables
- 没有远程桌面客户端访问许可证
- Maven入门篇(下)
- 获取时间区域内执行代码
- relative中的组件想和relative外部的组件对齐经验
- beginning jquery---1
- 学习Oracle应该准备的技能
- hadoop下c++程序-天气实例
- 找到Environment.getExternalStorageDirectory()对应的真正目录