【发布时间】:2013-11-20 18:52:37
【问题描述】:
我正在使用以下步骤在两台 Linux (CentOS6) 服务器之间创建 GRE 隧道。
在主服务器上:
chkconfig iptables 关闭
服务 iptables 停止
sysctl -w net.ipv4.conf.default.rp_filter=0
modprobe ip_gre
ip tunnel add tun1 mode gre remote 98.123.87.97 local 106.61.58.98 ttl 255
ip addr add 10.0.1.0/24 dev tun1
ip link set dev tun1 up
ip addr add 98.123.87.95/27 dev eth0
在从服务器上:
chkconfig iptables 关闭
服务 iptables 停止
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv4.conf.all.forwarding=1
sysctl -w net.ipv4.conf.proxy_arp=1
sysctl -w net.ipv4.conf.all.proxy_arp=1
sysctl -w net.ipv4.conf.eth0.rp_filter=0
sysctl -w net.ipv4.conf.default.rp_filter=0
modprobe ip_gre
ip tunnel add tunx mode gre remote 106.61.58.98 local 98.123.87.97 ttl 255
ip addr add 10.0.2.0/24 dev tun0
ip 链接设置 tunx up
ip route add 98.123.87.95/27 dev tun0
我需要将从属服务器的 IP 添加到我的主服务器上,我收到来自隧道 IP(从属服务器的 IP)的 ping 响应,当我尝试通过 SSH 连接隧道 IP(从属 IP)时,我正在访问主服务器(这就是我想要的)。
问题是当我尝试通过隧道 IP(从属 IP)发送诸如 DNS 查询之类的传出流量时,我收到了超时请求。
我猜这是我的一台服务器的路由问题。知道我应该怎么做才能通过隧道 IP 处理我的传出流量吗?
谢谢,
【问题讨论】:
标签: linux networking routing tunnel tunneling