wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* Minor bugs in the sample script for ns-routing
@ 2020-02-08  5:01 Isaac Nickaein
  2020-02-08 21:33 ` Jason A. Donenfeld
  0 siblings, 1 reply; 2+ messages in thread
From: Isaac Nickaein @ 2020-02-08  5:01 UTC (permalink / raw)
  To: wireguard

The sample script provided at "Routing and Network Namespace
Intergration" page seems to have a few bugs, at least on Ubuntu 19.10:

1. The execi command seems to have an extra "exec" at the beginning. Instead of:

exec ip netns exec physical sudo -E -u \#${SUDO_UID:-$(id -u)} -g
\#${SUDO_GID:-$(id -g)} -- "$@"

It should say:

ip netns exec physical sudo -E -u \#${SUDO_UID:-$(id -u)} -g
\#${SUDO_GID:-$(id -g)} -- "$@"


2. The "shift" command should be moved into "execi" function.

3. dhcpd seems to be replaced by dhclient. It would be nice if the
script set it (and other configurations) as a variable, e.g. to make
it easier for user to adopt the script:

DHCP_DAEMON=dhcpd
WG_IFACE=wgvpn0
WLAN_IFACE=wlan0
WLAN_PHY=phy0
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Minor bugs in the sample script for ns-routing
  2020-02-08  5:01 Minor bugs in the sample script for ns-routing Isaac Nickaein
@ 2020-02-08 21:33 ` Jason A. Donenfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Jason A. Donenfeld @ 2020-02-08 21:33 UTC (permalink / raw)
  To: Isaac Nickaein; +Cc: WireGuard mailing list

On Sat, Feb 8, 2020 at 10:28 PM Isaac Nickaein <nickaein.i@gmail.com> wrote:
>
> The sample script provided at "Routing and Network Namespace
> Intergration" page seems to have a few bugs, at least on Ubuntu 19.10:
>
> 1. The execi command seems to have an extra "exec" at the beginning. Instead of:
>
> exec ip netns exec physical sudo -E -u \#${SUDO_UID:-$(id -u)} -g
> \#${SUDO_GID:-$(id -g)} -- "$@"
>
> It should say:
>
> ip netns exec physical sudo -E -u \#${SUDO_UID:-$(id -u)} -g
> \#${SUDO_GID:-$(id -g)} -- "$@"

No. The intent is that the ip process replaces the bash process
without fork(2)+wait(2), via execve(2).

> 2. The "shift" command should be moved into "execi" function.

Why? What does that accomplish? The structure is that the subcommands
inherit their arguments as though they've been called directly.

> 3. dhcpd seems to be replaced by dhclient. It would be nice if the
> script set it (and other configurations) as a variable, e.g. to make
> it easier for user to adopt the script:
>
> DHCP_DAEMON=dhcpd
> WG_IFACE=wgvpn0
> WLAN_IFACE=wlan0
> WLAN_PHY=phy0

You're free to reorganize this to work with any network daemon you
won't. For most users, dhcpcd+wpa_supplicant probably doesn't describe
their network setup, since most folks are in the habit of using large
management tools.
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-08 21:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-08  5:01 Minor bugs in the sample script for ns-routing Isaac Nickaein
2020-02-08 21:33 ` Jason A. Donenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).