|  | @@ -164,6 +164,18 @@ function stop {
 | 
	
		
			
			| 164 | 164 |      iptables -D INPUT -p tcp --dport 8942 -j ACCEPT
 | 
	
		
			
			| 165 | 165 |      iptables -D INPUT -p udp --dport 8942 -j ACCEPT
 | 
	
		
			
			| 166 | 166 |  
 | 
	
		
			
			|  | 167 | +    iptables -t nat -D POSTROUTING -o $EIFACE -j MASQUERADE
 | 
	
		
			
			|  | 168 | +    iptables -D FORWARD -i $EIFACE -o $IFACE -j ACCEPT -m state –state RELATED,ESTABLISHED
 | 
	
		
			
			|  | 169 | +    iptables -D FORWARD -i $IFACE -o $EIFACE -j ACCEPT
 | 
	
		
			
			|  | 170 | +
 | 
	
		
			
			|  | 171 | +    if [ $IFACE_SECONDARY ]; then
 | 
	
		
			
			|  | 172 | +        iptables -D FORWARD -i $IFACE -o $IFACE_SECONDARY -j ACCEPT -m state –state RELATED,ESTABLISHED
 | 
	
		
			
			|  | 173 | +        iptables -D FORWARD -i $IFACE_SECONDARY -o $IFACE -j ACCEPT
 | 
	
		
			
			|  | 174 | +    fi
 | 
	
		
			
			|  | 175 | +
 | 
	
		
			
			|  | 176 | +    echo 0 > /proc/sys/net/ipv4/ip_forward
 | 
	
		
			
			|  | 177 | +    sed -i 's|net.ipv4.ip_forward=.*|net.ipv4.ip_forward=0|g' /etc/sysctl.conf
 | 
	
		
			
			|  | 178 | +
 | 
	
		
			
			| 167 | 179 |      systemctl restart network-manager
 | 
	
		
			
			| 168 | 180 |  }
 | 
	
		
			
			| 169 | 181 |  
 | 
	
	
		
			
			|  | @@ -251,6 +263,7 @@ function start {
 | 
	
		
			
			| 251 | 263 |          dhclient $BRIDGE
 | 
	
		
			
			| 252 | 264 |      fi
 | 
	
		
			
			| 253 | 265 |  
 | 
	
		
			
			|  | 266 | +    hotspot_enabled=
 | 
	
		
			
			| 254 | 267 |      if [ $IFACE_SECONDARY ]; then
 | 
	
		
			
			| 255 | 268 |          if [[ $IFACE != $IFACE_SECONDARY ]]; then
 | 
	
		
			
			| 256 | 269 |              if [ -d /etc/hostapd ]; then
 | 
	
	
		
			
			|  | @@ -291,6 +304,7 @@ function start {
 | 
	
		
			
			| 291 | 304 |                  ifconfig $IFACE_SECONDARY up promisc
 | 
	
		
			
			| 292 | 305 |                  #ifconfig $IFACE_SECONDARY auto-dhcp start
 | 
	
		
			
			| 293 | 306 |                  systemctl start hostapd
 | 
	
		
			
			|  | 307 | +                hotspot_enabled=1
 | 
	
		
			
			| 294 | 308 |              fi
 | 
	
		
			
			| 295 | 309 |          fi
 | 
	
		
			
			| 296 | 310 |      fi
 | 
	
	
		
			
			|  | @@ -324,6 +338,20 @@ function start {
 | 
	
		
			
			| 324 | 338 |      iptables -A INPUT -p tcp --dport 8942 -j ACCEPT
 | 
	
		
			
			| 325 | 339 |      iptables -A INPUT -p udp --dport 8942 -j ACCEPT
 | 
	
		
			
			| 326 | 340 |  
 | 
	
		
			
			|  | 341 | +    iptables -t nat -A POSTROUTING -o $EIFACE -j MASQUERADE
 | 
	
		
			
			|  | 342 | +    iptables -A FORWARD -i $EIFACE -o $IFACE -j ACCEPT -m state –state RELATED,ESTABLISHED
 | 
	
		
			
			|  | 343 | +    iptables -A FORWARD -i $IFACE -o $EIFACE -j ACCEPT
 | 
	
		
			
			|  | 344 | +
 | 
	
		
			
			|  | 345 | +    if [ $hotspot_enabled ]; then
 | 
	
		
			
			|  | 346 | +        iptables -A FORWARD -i $IFACE -o $IFACE_SECONDARY -j ACCEPT -m state –state RELATED,ESTABLISHED
 | 
	
		
			
			|  | 347 | +        iptables -A FORWARD -i $IFACE_SECONDARY -o $IFACE -j ACCEPT
 | 
	
		
			
			|  | 348 | +    fi
 | 
	
		
			
			|  | 349 | +
 | 
	
		
			
			|  | 350 | +    echo 1 > /proc/sys/net/ipv4/ip_forward
 | 
	
		
			
			|  | 351 | +    sed -i 's|# net.ipv4.ip_forward|net.ipv4.ip_forward|g' /etc/sysctl.conf
 | 
	
		
			
			|  | 352 | +    sed -i 's|#net.ipv4.ip_forward|net.ipv4.ip_forward|g' /etc/sysctl.conf
 | 
	
		
			
			|  | 353 | +    sed -i 's|net.ipv4.ip_forward.*|net.ipv4.ip_forward=1|g' /etc/sysctl.conf
 | 
	
		
			
			|  | 354 | +
 | 
	
		
			
			| 327 | 355 |      systemctl restart avahi-daemon
 | 
	
		
			
			| 328 | 356 |  
 | 
	
		
			
			| 329 | 357 |      verify
 |