网络解析过程

来源:互联网 发布:小说设定软件 编辑:程序博客网 时间:2024/06/07 15:22

arp  who has 192.168.0.5 tell 192.168.0.11

arp reply 192.168.0.5  is-at 00:12:56:fe:45:67

192.168.43.12(网卡).54589 (端口号)>175.23.2.56(DNS服务器地址).domain:53620+A?www.baidu.com.29 域名解析过程。

h1(四层主机).im(三级).qq(二级).com(一级).cn(顶级域名)

ping   -c  3   www.sohu.com

ipfwd写1使能转发,iptables中filter表中的forward链 accept,修改getprop 中net.dns1,net.dns2的ip地址,

iptables -t nat -A PREROUTING -i eth1 -j DNAT --to-destination 192.168.0.5( 网关地址)

iptables -t nat -A PREROUTING -d  114.10.0.58/24 -j DNAT --to-destination 192.168.0.5( 网关地址)

                                                     (eth1的ip也是每次动态变化,为了省去每次都要修改eth1的ip,直接写成:-i eth1)


iptables -t nat -A POSTROUTING -s 192.168.0.5/24 -j SNAT --to-source 192.168.56.2(wlan0,但是它的ip每次都动态变化,直接写成-o wlan0)

iptables -t nat -A POSTROUTING -s  192.168.0.5/24 -o wlan0 -j MASQUERADE


rfc2131.c标准






0 0
原创粉丝点击