XPost: alt.computer.workshop
On 27 Apr 2025 04:26:11 GMT, Creon <
[email protected]> wrote in <
[email protected]>:
Actually had a success story with AI to share.
Using ChatGPT, regarding Linux, I was able to give it my current output
of "ifconfig -a" and have it generate an accurate netplan yaml file for network configuration -- which worked.
Then I had it add some policy routing, which also worked.
I did this to renumber three servers. The only snag was when I went to reconfigure the Red Hat-based server...it was so old, it didn't support
Red Hat's more modern network configuration scriptlets. So I had
ChatGPT walk me through writing a script to do the configuration, then
set up a systemd unit file to run the script when the networking service started. All done.
I was pleasantly surprised at how accurate ChatGPT was with its
configuration directives, scripting, and unit file setup.
Here is the netplan yaml file, with IP addresses anonymized:
network:
version: 2
renderer: networkd
ethernets:
eth0:
match:
macaddress: 00:11:22:33:44:55
set-name: eth0
addresses:
- 192.0.2.10/29 # Source IP 1
- 198.51.100.10/28 # Source IP 2
dhcp4: no
dhcp6: no
ipv6-link-local: [auto]
routing-policy:
- from: 192.0.2.10
table: 100
- from: 198.51.100.10
table: 200
routes:
# Table 100 for 192.0.2.10
- to: 0.0.0.0/0
via: 192.0.2.1
table: 100
metric: 100
- to: 192.0.2.0/29
scope: link
table: 100
# Table 200 for 198.51.100.10
- to: 0.0.0.0/0
via: 198.51.100.1
table: 200
metric: 200
- to: 198.51.100.0/28
scope: link
table: 200
# Fallback default route
- to: 0.0.0.0/0
via: 198.51.100.1
metric: 500
eth1:
match:
macaddress: 00:11:22:33:44:66
set-name: eth1
addresses:
- 10.0.0.10/24
dhcp4: no
dhcp6: no
routes:
- to: 10.0.0.0/24
scope: link
--
-v
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)