Skip to content

Instantly share code, notes, and snippets.

@bdonlan
Created May 21, 2009 02:55
Show Gist options
  • Save bdonlan/115243 to your computer and use it in GitHub Desktop.
Save bdonlan/115243 to your computer and use it in GitHub Desktop.
This assumes debian's uml-utilities is installed.
] cat /etc/default/uml-utilities
# Options to pass to uml_switch.
# set to "false" if you want to prevent uml_switch from
# starting with SysV scripts in /etc/init.d
# UML_SWITCH_START="false"
# For preconfigured tap setup, see
# /usr/share/doc/uml-utilities/examples/interfaces.example
UML_SWITCH_OPTIONS="-tap tap0"
# User as which to run uml_switch
#UML_SWITCH_USER="uml-net"
# Socket file to use
# Debian's default is:
UML_SWITCH_CTL="/var/run/uml-utilities/uml_switch.ctl"
#
# if you instead use your rolled up kernel from upstream
# sources you may want to uncomment the following:
#UML_SWITCH_CTL="/tmp/uml.ctl"
Arguments to UML:
mem=256M root=/dev/ubda umid=brick con0=fd:0,fd:1 con=xterm xterm=urxvt,-T,-e ubd0=brick.img eth0=daemon,,,/var/run/uml-utilities/uml_switch.ctl, debug
iptables/etc setup script:
DEV=tap0
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F FORWARD
iptables -P FORWARD DROP
iptables -A FORWARD -i eth0 -o $DEV -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $DEV -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment