Questions tagged «ip-forwarding»

2
将Open vSwitch交换机连接到真实网络:iptables假面舞会
我正在使用Open vSwitch在virtualBox来宾计算机之间创建交换网络,并且我希望主机OS(Ubuntu 12.04)加入该网络并将其配置为该虚拟网络的网关: 首先,我创建了一个vswitch并添加了端口以点按设备(虚拟机将它们用作桥接接口): ovs-vsctl add-br sw0 ovs-vsctl add-port sw0 tap0 之后,我静态设置了Lubuntu 12.04虚拟机的IP: ifconfig eth0 192.168.1.3/24 up route add -net 0.0.0.0/0 gw 192.168.1.1 在主机操作系统方面,我还设置了IP地址: ifconfig sw0 192.168.1.1/24 up 目前,我可以从Lubunut ping到Ubunutu。我现在要在主机中使用IP伪装,将网络192.168.1.0/24的流量转发到我的物理接口(连接到Internet): sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -o eth1 -s 192.168.1.0/24 -j MASQUERADE 因此,从Lubuntu(虚拟机),我可以ping Ubuntu eth1接口,但是我无法访问真实网络(例如:真实LAN上的网关),我已经尝试过: nslookup google.com dig …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.