-
Notifications
You must be signed in to change notification settings - Fork 0
/
FreeBSD-TODO
140 lines (121 loc) · 4 KB
/
FreeBSD-TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
- TODO
define - define an interface from an XML file
change-begin - mark the beginning of a set of revertible network config changes
change-commit - commit the pending network config changes
change-rollback - rollback (revert) a set of network config changes
-- done
dumpxml
- output XML version of the current network config of an interface (hiren)
list - list network interfaces
- iterate over the list of valid net interfaces and output names
- all arguments work (hiren + sean)
ifup - bring up an interface
- ioctl to set an interface up (sean)
ifdown - bring down an interface
- ioctl to set an interface down (sean)
undefine - undefine an interface
help - print help
quit - exit the program
Bugs
====
- The MAC address is not included in dumpxml in non -live mode.
- ncf_lookup_by_name returns a netcf_if * even if the interface does not exist
Example output
==============
list
----
feynman% src/ncftool list --all --macs
em0 90:2b:34:00:01:02
plip0 could not get MAC
fwe0 02:49:e5:00:01:02
fwip0 could not get MAC
alc0 90:2b:34:03:04:05
lo0 could not get MAC
vboxnet0 0a:00:27:00:00:00
vboxnet1 0a:00:27:00:00:01
vboxnet2 0a:00:27:00:00:02
vboxnet3 0a:00:27:00:00:03
br0 90:2b:34:00:01:02
dumpxml
-------
feynman% src/ncftool dumpxml em0
<interface type="ethernet" name="em0">
<start mode="none"/>
<mac address=""/>
<mtu size=""/>
<protocol family="ipv4">
<dhcp/>
</protocol>
</interface>
On CentOS, <start mode="onboot"/> and MAC address is printed (because the
MAC address is defined in /etc/sysconfig/network-scripts/ifcfg-$name).
feynman% src/ncftool dumpxml -live em0
<interface type="ethernet" name="em0">
<start mode="none"/>
<mac address="90:2b:34:01:02:03"/>
<mtu size="1500"/>
<protocol family="ipv4">
<dhcp/>
</protocol>
</interface>
define
------
undefine
--------
feynman% src/ncftool undefine em0
Could not open tmp file
ifup
----
feynman% sudo src/ncftool ifup em0
Interface em0 successfully brought up
ifdown
------
feynman% src/ncftool ifdown em0
Interface em0 bring-down failed!
feynman% sudo src/ncftool ifdown em0
Interface em0 successfully brought down
feynman% ifconfig em0
em0: flags=28d02<BROADCAST,PROMISC,OACTIVE,SIMPLEX,MULTICAST,PPROMISC> metric 0 mtu 1500
options=153098<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MCAST,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,NETMAP>
ether 90:2b:34:00:01:02
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
change-begin
------------
feynman% src/ncftool change-begin
Attempting to execute /usr/bin/false change-begin
error: failed to execute external program
error: Running '/usr/bin/false change-begin' failed with exit code 1:
change-commit
-------------
feynman% src/ncftool change-commit
Attempting to execute /usr/bin/false change-commit
error: failed to execute external program
error: Running '/usr/bin/false change-commit' failed with exit code 1:
change-rollback
---------------
feynman% src/ncftool change-rollback
Attempting to execute /usr/bin/false change-rollback
error: failed to execute external program
error: Running '/usr/bin/false change-rollback' failed with exit code 1:
help
----
feynman% src/ncftool help
Commands:
list - list network interfaces
dumpxml - dump the XML description of an interface
define - define an interface from an XML file
undefine - undefine an interface
ifup - bring up an interface
ifdown - bring down an interface
change-begin - mark the beginning of a set of revertible network config changes
change-commit - commit the pending network config changes
change-rollback - rollback (revert) a set of network config changes
help - print help
quit - exit the program
Type 'help <command>' for more information on a command
quit
----
feynman% src/ncftool
ncftool> quit