Skip to content
This repository was archived by the owner on Jul 20, 2024. It is now read-only.

Commit 38e00a2

Browse files
authored
Prevent setting default route to eth0 after reboot (#42)
1 parent f4c9210 commit 38e00a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

snat.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/bash -x
1+
#!/bin/bash
2+
set -x
23

34
# wait for eth1
45
while ! ip link show dev eth1; do
@@ -10,6 +11,9 @@ sysctl -q -w net.ipv4.ip_forward=1
1011
sysctl -q -w net.ipv4.conf.eth1.send_redirects=0
1112
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
1213

14+
# prevent setting the default route to eth0 after reboot
15+
rm -f /etc/sysconfig/network-scripts/ifcfg-eth0
16+
1317
# switch the default route to eth1
1418
ip route del default dev eth0
1519

0 commit comments

Comments
 (0)