Linux下固定IP共享NAT代理上网
2007-05-17 05:05
316 查看
#/bin/sh
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
echo "1">/proc/sys/net/ipv4/ip_forward
arp -s 192.168.0.5 00:E0:11:01:CE:BD
iptables -A FORWARD -s 192.168.0.5 -m mac --mac 00:E0:11:01:CE:BD -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -j ACCEPT
iptables -A FORWARD -s 192.168.0.6 -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/28 -j DROP
iptables -t nat -A POSTROUTING -s 192.168.0.0/28 -o eth1 -j SNAT --to-source 58.1
6.172.2
iptables -A FORWARD -s 192.168.1.2 -j ACCEPT
iptables -A FORWARD -s 192.168.1.0/25 -p tcp --dport ! 80 -j DROP
iptables -A FORWARD -s 192.168.1.0/25 -p udp --dport ! 53 -j DROP
iptables -t nat -A POSTROUTING -s 192.168.1.0/25 -j SNAT --to-source 58.16.172.2
iptables -t nat -A PREROUTING -s 192.168.1.0/25 -i eth0 -p tcp --dport 80 -j RED
IRECT --to-port 3128
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
echo "1">/proc/sys/net/ipv4/ip_forward
arp -s 192.168.0.5 00:E0:11:01:CE:BD
iptables -A FORWARD -s 192.168.0.5 -m mac --mac 00:E0:11:01:CE:BD -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -j ACCEPT
iptables -A FORWARD -s 192.168.0.6 -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/28 -j DROP
iptables -t nat -A POSTROUTING -s 192.168.0.0/28 -o eth1 -j SNAT --to-source 58.1
6.172.2
iptables -A FORWARD -s 192.168.1.2 -j ACCEPT
iptables -A FORWARD -s 192.168.1.0/25 -p tcp --dport ! 80 -j DROP
iptables -A FORWARD -s 192.168.1.0/25 -p udp --dport ! 53 -j DROP
iptables -t nat -A POSTROUTING -s 192.168.1.0/25 -j SNAT --to-source 58.16.172.2
iptables -t nat -A PREROUTING -s 192.168.1.0/25 -i eth0 -p tcp --dport 80 -j RED
IRECT --to-port 3128
相关文章推荐
- Linux下固定IP共享NAT代理上网
- Linux下固定IP共享NAT代理上网
- Linux下固定IP共享NAT代理上网
- RouterOS 5.22固定公网IP共享上网设置
- VMware Linux NAT 固定IP上网
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- Ros固定IP共享上网的设置
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- Linux设置固定IP上网方法
- Linux系列:Fedora虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- LINUX设置固定IP上网方法
- Fedora10 NAT方式以固定IP共享主机上网
- LINUX设置固定IP上网方法
- linux 虚拟机centos64位_6.5+VM10 主机是固定IP局域网设置代理上网,虚机设置固定ip 图文详细步骤
- vmware上的linux以nat方式固定ip上网
- Ros固定IP共享上网设置
- Ros固定IP共享上网设置 推荐
- Linux系列:Fedora虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)
- Linux系列:Ubuntu虚拟机设置固定IP上网(配置IP、网关、DNS、防止resolv.conf被重写)