Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save buhman/5457850 to your computer and use it in GitHub Desktop.
Save buhman/5457850 to your computer and use it in GitHub Desktop.
[Unit]
Description=Wireless Static IP Connectivity
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-eth0.device
After=sys-subsystem-net-devices-eth0.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set eth0 up promisc on
ExecStart=/usr/sbin/brctl brctl addbr br0
ExecStart=/usr/sbin/brctl brctl addif br0 eth0
ExecStart=/sbin/ip addr add 10.0.1.111/24 dev br0
ExecStart=/sbin/ip route add default via 10.0.1.1
ExecStop=/sbin/ip addr flush dev br0
ExecStop=/usr/sbin/brctl brctl delif br0 eth0
ExecStop=/usr/sbin/brctl brctl delbr br0
ExecStop=/sbin/ip link eth0 down
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment