-
Notifications
You must be signed in to change notification settings - Fork 1
/
ip
28 lines (22 loc) · 775 Bytes
/
ip
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
# Create bridge, connect interface
ip l add br0 type bridge
ip l set br0 up
ip l set enp1s0 up
ip l set enp1s0 master br0
# enable bridging of traffic from 'IEEE 802.1D MAC Bridge Filtered MAC Group Addresses'
# this is necessary e.g. for 802.1X EAP
echo 65528 > /sys/class/net/br0/bridge/group_fwd_mask
# Remove interface from bridge, delete bridge
ip l set enp1s0 nomaster
ip l delete br0
# Create VLAN-tagged interface
ip l add link enp1s0 name enp1s0.100 type vlan id 100
ip l set dev enp1s0.100 up
dhcpcd enp1s0.100 # or add IP manually before setting device up
# Remove VLAN-tagged interface
ip l set dev enp1s0.100 down
ip l delete enp1s0.100
# Create and use network namespace
ip netns add mynetns
ip l set dev enp1s0 netns mynetns
ip netns exec mynetns fish