Score:0

GRE set outbound IP route

pk flag

Node A Public IP: 198.244.xxx.151 Node B Public IP: 37.59.xxx.234

Node A:

sudo ip tunnel add gre1 mode gre local 198.244.xxx.151 remote 37.59.xxx.234 ttl 255
sudo ip addr add 10.0.0.1/30 dev gre1
sudo ip link set gre1 up
iptables -t nat -A POSTROUTING -s 10.0.0.0/30 ! -o gre+ -j SNAT --to-source 198.244.xxx.151
sudo iptables -D FORWARD -d 10.0.0.2 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
sudo iptables -D FORWARD -s 10.0.0.2 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
sudo iptables -t nat -A PREROUTING -d 198.244.xxx.151 -j DNAT --to-destination 10.0.0.2

Node B:

sudo ip tunnel add gre1 mode gre local 37.59.xxx.234 remote 198.244.xxx.151 ttl 255
sudo ip addr add 10.0.0.2/30 dev gre1
sudo ip link set gre1 up
sudo echo '100 GRE' >> /etc/iproute2/rt_tables
sudo ip rule add from 10.0.0.0/30 table GRE
sudo ip route add default via 10.0.0.1 table GRE

I would like to make it so all outbound traffic on Node B uses the IP of Node A. Running curl ifconfig.me should return 198.244.xxx.151 from Node B where as right now it only works if I specify the IP curl http://www.cpanel.net/showip.cgi --interface 10.0.0.2

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.