我必须配置NAT,并在连接到Linux盒的两个网关之间手动拆分internet流量。
如果每个网关都有特定的IP地址,则没有问题。我可以通过iproute2做到这一点:
ip route add default via 192.168.1.1 dev eth1
ip route add 2.3.4.5 via 192.168.0.1 dev eth0
ip route add 8.9.4.5 via 192.168.0.1 dev eth0
但我的问题太简单了!我无法更改网关地址和网络ids。我只需要使用两个来自Linux机器的地址相同的互联网网关,内核3.2.0和更高版本。
我正在尝试从我的mac向运行在Google VM IoT实例上的谷歌linux网关发送消息。无法让运行在linux实例中的网关服务器确认从mac上的脚本发送的消息。 设置Google VM linux实例,并按照https://codelabs.developers.google.com/codelabs/cloud-iot-core-gateways/index.html#0中的说明进行操作 我确实试着通读了https://cloud.google.com/community/tutorials/cloud-iot-gateways-rpi。我将GOOGLE_CLOUD_PROJECT设置
我有:[ Host A ] -- [ gateway ] -- [ Host B ],而A和B在不同的子网中。
网关配置:
ip -6 link set enp0s3 up
ip -6 link set enp0s9 up
ip -6 addr flush dev enp0s3
ip -6 addr flush dev enp0s9
ip -6 route flush dev enp0s3
ip -6 route flush dev enp0s9
ip -6 addr add ::ffff:5:7:1:1/126 dev enp0s3
ip -6 addr add ::ffff:5:7:2:1
我必须远程连接到网关(在Linux平台上工作),其中有两个可执行文件(signingModule.sh和taxModule.sh)。现在,我想在我的桌面上编写一个脚本,它将连接到那个网关,并在两个不同的终端上运行signingModule.sh和taxModule.sh。
我写了下面的代码:
ssh root@10.138.77.150 #to connect to gateway
sleep 5
cd /opt/swfiscal/signingModule #path of both modules
./signingModule #executable.
但是通过这段代码,我能够连接