4 ms·
Network interface: /sys/class/net/<name> Process: /proc/<id>/ IPv4 Route: /proc/net/route User account: /etc/passwd
by abpavel 10y ago
Network interface: /sys/class/net/<name>
Process: /proc/<id>/
IPv4 Route: /proc/net/route
User account: /etc/passwd
- dozzie 10y agoOK, configure the network interface this way. Oh, you can't. So it is not a file, it just has some metadata exposed with a file interface. Create a process in the same manner. Oh, again you can't do that. What a shame. And with route and user account examples you confuse being a file and being a record in a file (which, couriously, is not a file itself).
- abpavel 10y agoYou mean /etc/network/interfaces? I can set tx queue length of eth0 to 300 packets: echo 300 > /sys/class/net/eth0/tx_queue_len Or change frame forwarding behavior from switch to hub: cat 0x65535 > /sys/class/net/vnet0_11/bridge/group_fwd_mask Granted, it's not possible to change IPv6 address through /proc/net/if_inet6, but just because I don't know about it, doesn't mean that it isn't possible.
- dozzie 10y ago> You mean /etc/network/interfaces? No. It's a configuration file for a separate set of tools that actually configure the interface for you. You can't set its current IP address by writing to any file. > I can set tx queue length of eth0 to 300 packets: echo 300 > /sys/class/net/eth0/tx_queue_len Or change frame forwarding behavior from switch to hub: cat 0x65535 > /sys/class/net/vnet0_11/bridge/group_fwd_mask Sorry, no banana; you only can control two or three aspects this way, and not the most fundamental ones at that. Network interface is simply not a file, it's a separate OS-level construct, it's not exposed to userland as a file. Not everything in Linux or unix is a file, even though many things (the ones more remote from kernel) are.