- #Changes the netfilter mark of packets to trigger rerouting.
- #We need to change the mark because the kernel triggers the rerouting process only
- #if it sees that the netfilter mark has been altered in the mangle iptables chain
- iptables -t mangle -A OUTPUT -m mark --mark $sliver_nid -j MARK --set-mark $temp_nid
-
- #Adds an SNAT rule to set the source IP address of packets that are about to go out through the UMTS
- #interface. The kernel sets the source address of packets when the first routing process happens
- #so, without this rule, packets would have the source ip address set on the first routing process of the ethernet interface
- iptables -t nat -A POSTROUTING -o $PPP_INT -j SNAT --to-source $ppp_addr
-
- #Restores the original netfilter mark for planetflow
- iptables -t mangle -I POSTROUTING 1 -m mark --mark $temp_nid -j MARK --set-mark $sliver_nid
-
- #Forbids other slices to use the UMTS interface
- iptables -t mangle -I POSTROUTING 2 -o $PPP_INT -m mark ! --mark $sliver_nid -j DROP
-
- #Enables the explicit bind to the UMTS interface. Applications launched by the user in the slice that is using the UMTS and that
- #bind to the UMTS interface will have packets going out through the UMTS interface
- ip route flush table umts_table >/dev/null 2>&1
- ip rule add from $ppp_addr fwmark $temp_nid table umts_table >/dev/null 2>&1
- ip route add default dev $PPP_INT src $ppp_addr table umts_table >/dev/null 2>&1
- ip route flush cache >/dev/null 2>&1
+# check if sliceip is activated for the slice
+function check_sliceip(){
+
+ if ! [ -e /vsys/sliceip ]; then
+ echo "Sliceip is not installed. Exiting."
+ return 1
+ fi
+