Loading src/network.sh +10 −10 Original line number Diff line number Diff line Loading @@ -403,7 +403,6 @@ configureNAT() { # Create the necessary file structure for /dev/net/tun if [ ! -c /dev/net/tun ]; then [[ "$PODMAN" == [Yy1]* ]] && return 1 [ ! -d /dev/net ] && mkdir -m 755 /dev/net if mknod /dev/net/tun c 10 200; then chmod 666 /dev/net/tun Loading @@ -411,6 +410,7 @@ configureNAT() { fi if [ ! -c /dev/net/tun ]; then [[ "$PODMAN" == [Yy1]* ]] && return 1 warn "$tuntap" && return 1 fi Loading @@ -418,6 +418,7 @@ configureNAT() { if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then { sysctl -w net.ipv4.ip_forward=1 > /dev/null 2>&1; rc=$?; } || : if (( rc != 0 )) || [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then [[ "$PODMAN" == [Yy1]* ]] && return 1 warn "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1" return 1 fi Loading @@ -444,6 +445,7 @@ configureNAT() { { ip link add dev "$VM_NET_BRIDGE" type bridge ; rc=$?; } || : if (( rc != 0 )); then [[ "$PODMAN" == [Yy1]* ]] && return 1 warn "failed to create bridge. $ADD_ERR --cap-add NET_ADMIN" && return 1 fi Loading @@ -458,6 +460,7 @@ configureNAT() { # QEMU Works with taps, set tap to the bridge created if ! ip tuntap add dev "$VM_NET_TAP" mode tap; then [[ "$PODMAN" == [Yy1]* ]] && return 1 warn "$tuntap" && return 1 fi Loading Loading @@ -737,13 +740,6 @@ getInfo() { GATEWAY_MAC=$(echo "$VM_NET_MAC" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/') if [[ "$PODMAN" == [Yy1]* && "$DHCP" != [Yy1]* ]]; then if [ -z "$NETWORK" ] || [[ "${NETWORK^^}" == "Y" ]]; then # By default Podman has no permissions for NAT networking NETWORK="user" fi fi if [[ "$DEBUG" == [Yy1]* ]]; then line="Host: $HOST IP: $IP Gateway: $GATEWAY Interface: $VM_NET_DEV MAC: $VM_NET_MAC MTU: $mtu" [[ "$MTU" != "0" && "$MTU" != "$mtu" ]] && line+=" ($MTU)" Loading Loading @@ -805,8 +801,12 @@ else closeBridge NETWORK="user" if [[ "$PODMAN" != [Yy1]* ]]; then msg="falling back to user-mode networking!" msg="failed to setup NAT networking, $msg" warn "$msg" fi fi ;; Loading Loading
src/network.sh +10 −10 Original line number Diff line number Diff line Loading @@ -403,7 +403,6 @@ configureNAT() { # Create the necessary file structure for /dev/net/tun if [ ! -c /dev/net/tun ]; then [[ "$PODMAN" == [Yy1]* ]] && return 1 [ ! -d /dev/net ] && mkdir -m 755 /dev/net if mknod /dev/net/tun c 10 200; then chmod 666 /dev/net/tun Loading @@ -411,6 +410,7 @@ configureNAT() { fi if [ ! -c /dev/net/tun ]; then [[ "$PODMAN" == [Yy1]* ]] && return 1 warn "$tuntap" && return 1 fi Loading @@ -418,6 +418,7 @@ configureNAT() { if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then { sysctl -w net.ipv4.ip_forward=1 > /dev/null 2>&1; rc=$?; } || : if (( rc != 0 )) || [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then [[ "$PODMAN" == [Yy1]* ]] && return 1 warn "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1" return 1 fi Loading @@ -444,6 +445,7 @@ configureNAT() { { ip link add dev "$VM_NET_BRIDGE" type bridge ; rc=$?; } || : if (( rc != 0 )); then [[ "$PODMAN" == [Yy1]* ]] && return 1 warn "failed to create bridge. $ADD_ERR --cap-add NET_ADMIN" && return 1 fi Loading @@ -458,6 +460,7 @@ configureNAT() { # QEMU Works with taps, set tap to the bridge created if ! ip tuntap add dev "$VM_NET_TAP" mode tap; then [[ "$PODMAN" == [Yy1]* ]] && return 1 warn "$tuntap" && return 1 fi Loading Loading @@ -737,13 +740,6 @@ getInfo() { GATEWAY_MAC=$(echo "$VM_NET_MAC" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/') if [[ "$PODMAN" == [Yy1]* && "$DHCP" != [Yy1]* ]]; then if [ -z "$NETWORK" ] || [[ "${NETWORK^^}" == "Y" ]]; then # By default Podman has no permissions for NAT networking NETWORK="user" fi fi if [[ "$DEBUG" == [Yy1]* ]]; then line="Host: $HOST IP: $IP Gateway: $GATEWAY Interface: $VM_NET_DEV MAC: $VM_NET_MAC MTU: $mtu" [[ "$MTU" != "0" && "$MTU" != "$mtu" ]] && line+=" ($MTU)" Loading Loading @@ -805,8 +801,12 @@ else closeBridge NETWORK="user" if [[ "$PODMAN" != [Yy1]* ]]; then msg="falling back to user-mode networking!" msg="failed to setup NAT networking, $msg" warn "$msg" fi fi ;; Loading