{"id":20183433,"url":"https://github.com/duncaen/netsh","last_synced_at":"2025-03-03T06:22:48.054Z","repository":{"id":71215110,"uuid":"46142994","full_name":"Duncaen/netsh","owner":"Duncaen","description":null,"archived":false,"fork":false,"pushed_at":"2015-11-14T19:10:54.000Z","size":0,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-13T17:41:57.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Duncaen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-13T19:35:18.000Z","updated_at":"2022-09-02T10:55:44.000Z","dependencies_parsed_at":"2023-03-11T10:04:34.989Z","dependency_job_id":null,"html_url":"https://github.com/Duncaen/netsh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duncaen%2Fnetsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duncaen%2Fnetsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duncaen%2Fnetsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duncaen%2Fnetsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Duncaen","download_url":"https://codeload.github.com/Duncaen/netsh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241617624,"owners_count":19991716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T02:45:53.322Z","updated_at":"2025-03-03T06:22:48.030Z","avatar_url":"https://github.com/Duncaen.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WIP DOES NOT WORK AT ALL!!!\n\n### `conf` variables\n\nConfiguration options for each network service should be added to the services\n`conf` file.\n\n#### DHCP\n\n```sh\nIP=\"dhcp\"\nDHCP_CLIENT=\"dhcpcd\"\nDHCP_RELEASE_ON_STOP=\"1\"\n# DHCPCD_OPTS=\"\"\n# DHCLIENT_OPTS=\"\"\n\nIP6=\"dhcp\"\nDHCP6_CLIENT=\"dhcpcd\"\n# DHCPCD6_OPTS=\"\"\n# DHCLIENT6_OPTS=\"\"\n```\n\n##### dhcpcd\n\nTo use `dhcpcd` you have to enable the `dhcpcd` daemon in master mode `-M, --master` or a `dhcpcd` daemon for the specific interface.\n\n##### dhclient\n\nTo use `dhclient` you have to enable the `dhcclient` daemon.\n\n#### Static\n\n```sh\nIP=\"static\"\nADDRESS=\"192.168.123/24 192.168.1.87/24\"\nROUTES=\"192.168.0.0/24\"\nGATEWAY=\"192.168.1.1\"\n\nIP6=\"static\"\nADDRESS6=\"1234:5678:9abc:def::1/64 1234:3456::123/96\"\nROUTES6=\"abcd::1234\"\nGATEWAY6=\"1234:0:123::abcd\"\n```\n\n#### Network namespace\n\nThe `NETNS` variable adds the network service into a network namespace before anything is configured.\nNetork namspaces can be created with the `netns-$NAMESPACE` service type or any other tool, the service does not start until the namespace is available.\n\n```sh\nNETNS=\"ns0\"\n```\n\n### service names\n\nBased on the service type it takes options from the service name if the option is not provided in `conf`.\n\nA service with the name `/etc/sv/ethernet-TOLOLOL` and `INTERFACE=\"eth0\"` in `conf` is the same as a service named `/etc/sv/ethernet-eth0` without `INTERFACE` in `conf`.\n\n#### ethernet\n\n`ethernet-[$NAME]`\n\n#### bridge\n\n`bridge-[$NAME]`\n\n#### bond\n\n`bond-[$NAME]`\n\n#### netns\n\n`netns-[$NAME]`\n\n#### veth\n\n`veth-[[$PAIR_1]-[$PAIR_2]]`\n\n#### Adding a new network service\n\n```sh\ncp -r /etc/sv/$TYPE-generic /etc/sv/$TYPE-$NAME_OR_OPTIONS\necho \"INTERFACE=eth0\" \u003e\u003e /etc/sv/$TYPE-$NAME_OR_OPTIONS/conf\necho \"IP=dhcp\" \u003e\u003e /etc/sv/$TYPE-$NAME_OR_OPTIONS/conf\nln -s /etc/sv/$TYPE-$NAME_OR_OPTIONS /var/service\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduncaen%2Fnetsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduncaen%2Fnetsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduncaen%2Fnetsh/lists"}