commit 2d325464912def23436e0b826853a2eaa378c13b Author: Twoje ImiÄ™ Nazwisko Date: Thu May 15 10:23:15 2025 +0200 init diff --git a/main.aux b/main.aux new file mode 100644 index 0000000..99f1863 --- /dev/null +++ b/main.aux @@ -0,0 +1,19 @@ +\relax +\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{2}{}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {2}Prerequisites}{2}{}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {3}Step-by-Step Configuration}{2}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Creating and Setting Up the Incus Container}{2}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Installing Additional Packages}{3}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Configuring Users and Permissions}{3}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.1}Changing the Root Password}{3}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.2}Adding a New User}{3}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Accessing the Container}{3}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.5}Installing dnsmasq}{3}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.6}Configuring Network with Veth Pairs and Netplan}{3}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.7}Configuring the Network with Netplan}{4}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.8}Configuring dnsmasq}{5}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.9}Starting and Enabling dnsmasq}{5}{}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.10}Testing the Configuration}{5}{}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {4}Troubleshooting}{5}{}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {5}Conclusion}{6}{}\protected@file@percent } +\gdef \@abspage@last{6} diff --git a/main.log b/main.log new file mode 100644 index 0000000..c0fdf4a --- /dev/null +++ b/main.log @@ -0,0 +1,819 @@ +This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2025/dev/Debian) (preloaded format=pdflatex 2025.5.15) 15 MAY 2025 10:21 +entering extended mode + restricted \write18 enabled. + %&-line parsing enabled. +**main +(./main.tex +LaTeX2e <2024-11-01> patch level 2 +L3 programming layer <2025-01-18> +(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls +Document Class: article 2024/06/29 v1.4n Standard LaTeX document class +(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo +File: size12.clo 2024/06/29 v1.4n Standard LaTeX file (size option) +) +\c@part=\count196 +\c@section=\count197 +\c@subsection=\count198 +\c@subsubsection=\count199 +\c@paragraph=\count266 +\c@subparagraph=\count267 +\c@figure=\count268 +\c@table=\count269 +\abovecaptionskip=\skip49 +\belowcaptionskip=\skip50 +\bibindent=\dimen141 +) +(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty +Package: inputenc 2024/02/08 v1.3d Input encoding file +\inpenc@prehook=\toks17 +\inpenc@posthook=\toks18 +) +(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty +Package: fontenc 2021/04/29 v2.0v Standard LaTeX package +) +(/usr/share/texmf/tex/latex/lm/lmodern.sty +Package: lmodern 2015/05/01 v1.6.1 Latin Modern Fonts +LaTeX Font Info: Overwriting symbol font `operators' in version `normal' +(Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22. +LaTeX Font Info: Overwriting symbol font `letters' in version `normal' +(Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23. +LaTeX Font Info: Overwriting symbol font `symbols' in version `normal' +(Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24. +LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal' +(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25. +LaTeX Font Info: Overwriting symbol font `operators' in version `bold' +(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26. +LaTeX Font Info: Overwriting symbol font `letters' in version `bold' +(Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27. +LaTeX Font Info: Overwriting symbol font `symbols' in version `bold' +(Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28. +LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold' +(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29. +LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' +(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31. +LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' +(Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32. +LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' +(Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33. +LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' +(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34. +LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold' +(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35. +LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' +(Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36. +LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' +(Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37. +LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' +(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38. +) +(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty +Package: geometry 2020/01/02 v5.9 Page Geometry + +(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty +Package: keyval 2022/05/29 v1.15 key=value parser (DPC) +\KV@toks@=\toks19 +) +(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty +Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead. + +(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty +Package: iftex 2024/12/12 v1.0g TeX engine tests +)) +\Gm@cnth=\count270 +\Gm@cntv=\count271 +\c@Gm@tempcnt=\count272 +\Gm@bindingoffset=\dimen142 +\Gm@wd@mp=\dimen143 +\Gm@odd@mp=\dimen144 +\Gm@even@mp=\dimen145 +\Gm@layoutwidth=\dimen146 +\Gm@layoutheight=\dimen147 +\Gm@layouthoffset=\dimen148 +\Gm@layoutvoffset=\dimen149 +\Gm@dimlist=\toks20 +) + +! LaTeX Error: File `listings.sty' not found. + +Type X to quit or to proceed, +or enter new name. (Default extension: sty) + +Enter file name: main + +! LaTeX Error: File `main.sty' not found. + +Type X to quit or to proceed, +or enter new name. (Default extension: sty) + +Enter file name: m + +! LaTeX Error: File `m.sty' not found. + +Type X to quit or to proceed, +or enter new name. (Default extension: sty) + +Enter file name: + +! LaTeX Error: File `xcolor.sty' not found. + +Type X to quit or to proceed, +or enter new name. (Default extension: sty) + +Enter file name: + +! LaTeX Error: File `parskip.sty' not found. + +Type X to quit or to proceed, +or enter new name. (Default extension: sty) + +Enter file name: +! Undefined control sequence. +l.11 \lstset + { +? + +! LaTeX Error: Missing \begin{document}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.12 b + asicstyle=\ttfamily\small, +? +LaTeX Font Info: Trying to load font information for T1+lmtt on input line 1 +2. +(/usr/share/texmf/tex/latex/lm/t1lmtt.fd +File: t1lmtt.fd 2015/05/01 v1.6.1 Font defs for Latin Modern +) +! Undefined control sequence. +l.17 keywordstyle=\color + {blue}, +? +! Undefined control sequence. +l.18 commentstyle=\color + {gray}, +? +! Undefined control sequence. +l.19 stringstyle=\color + {red} +? + +Overfull \hbox (28.20107pt too wide) in paragraph at lines 12--21 +[]\T1/cmr/m/n/12 basicstyle=\T1/lmtt/m/n/10.95 , breaklines=true, frame=single, + numbers=left, numberstyle=\T1/lmtt/m/n/6 , + [] + +! Undefined control sequence. +l.23 \lstdefinelanguage + {yaml}{ +? + +! LaTeX Error: Missing \begin{document}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.23 \lstdefinelanguage{y + aml}{ +? +! Undefined control sequence. +l.25 keywordstyle=\color + {blue}\bfseries, +? +LaTeX Font Info: Font shape `T1/lmtt/bx/n' in size <12> not available +(Font) Font shape `T1/lmtt/b/n' tried instead on input line 26. +LaTeX Font Info: Font shape `T1/lmtt/bx/n' in size <10.95> not available +(Font) Font shape `T1/lmtt/b/n' tried instead on input line 26. +! Undefined control sequence. +l.29 commentstyle=\color + {gray}\itshape, +? + +LaTeX Font Warning: Font shape `T1/lmtt/bx/it' in size <10.95> not available +(Font) Font shape `T1/lmtt/b/sl' tried instead on input line 29. + +! Undefined control sequence. +l.30 stringstyle=\color + {red}, +? + +Overfull \hbox (162.77153pt too wide) in paragraph at lines 23--34 +[]\T1/cmr/m/n/12 yaml key-words=true,false,null,yaml,network,version,ethernets, +dhcp4,addresses,routes,to,via,nameservers, + [] + + +Overfull \hbox (64.25562pt too wide) in paragraph at lines 23--34 +\T1/cmr/m/n/12 key-word-style=blue\T1/cmr/b/n/12 , ba-sic-style=\T1/lmtt/b/n/10 +.95 , sensitive=false, comment=[l]#, commentstyle=gray\T1/lmtt/b/sl/10.95 , + [] + +! Undefined control sequence. +l.36 \lstdefinelanguage + {python}{ +? + +! LaTeX Error: Missing \begin{document}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.36 \lstdefinelanguage{p + ython}{ +? +! Undefined control sequence. +l.38 keywordstyle=\color + {blue}\bfseries, +? +! Undefined control sequence. +l.42 commentstyle=\color + {gray}\itshape, +? +! Undefined control sequence. +l.43 stringstyle=\color + {red}, +? +! Undefined control sequence. +l.46 identifierstyle=\color + {black} +? + +Overfull \hbox (177.52057pt too wide) in paragraph at lines 36--48 +[]\T1/cmr/m/n/12 python key-words=def,class,import,from,as,try,except,with,retu +rn,raise,if,elif,else,for,in,while,break,continue, + [] + + +Overfull \hbox (58.50688pt too wide) in paragraph at lines 36--48 +\T1/cmr/m/n/12 key-word-style=blue\T1/cmr/b/n/12 , ba-sic-style=\T1/lmtt/b/n/10 +.95 , sensitive=true, comment=[l]#, commentstyle=gray\T1/lmtt/b/sl/10.95 , + [] + + +Overfull \hbox (23.90881pt too wide) in paragraph at lines 36--48 +\T1/lmtt/b/sl/10.95 stringstyle=red, morestring=[b]", morestring=[b]', identifi +erstyle=black + [] + + +Underfull \hbox (badness 10000) in paragraph at lines 36--48 + + [] + +LaTeX Font Info: Trying to load font information for T1+lmr on input line 49 +. +(/usr/share/texmf/tex/latex/lm/t1lmr.fd +File: t1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern +) +(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def +File: l3backend-pdftex.def 2024-05-08 L3 backend support: PDF output (pdfTeX) +\l__color_backend_stack_int=\count273 +\l__pdf_internal_box=\box52 +) +No file main.aux. +\openout1 = `main.aux'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 49. +LaTeX Font Info: ... okay on input line 49. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 49. +LaTeX Font Info: ... okay on input line 49. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 49. +LaTeX Font Info: ... okay on input line 49. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 49. +LaTeX Font Info: ... okay on input line 49. +LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 49. +LaTeX Font Info: ... okay on input line 49. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 49. +LaTeX Font Info: ... okay on input line 49. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 49. +LaTeX Font Info: ... okay on input line 49. +*geometry* driver: auto-detecting +*geometry* detected driver: pdftex +*geometry* verbose mode - [ preamble ] result: +* driver: pdftex +* paper: a4paper +* layout: +* layoutoffset:(h,v)=(0.0pt,0.0pt) +* modes: +* h-part:(L,W,R)=(72.26999pt, 452.9679pt, 72.26999pt) +* v-part:(T,H,B)=(72.26999pt, 700.50687pt, 72.26999pt) +* \paperwidth=597.50787pt +* \paperheight=845.04684pt +* \textwidth=452.9679pt +* \textheight=700.50687pt +* \oddsidemargin=0.0pt +* \evensidemargin=0.0pt +* \topmargin=-37.0pt +* \headheight=12.0pt +* \headsep=25.0pt +* \topskip=12.0pt +* \footskip=30.0pt +* \marginparwidth=35.0pt +* \marginparsep=10.0pt +* \columnsep=10.0pt +* \skip\footins=10.8pt plus 4.0pt minus 2.0pt +* \hoffset=0.0pt +* \voffset=0.0pt +* \mag=1000 +* \@twocolumnfalse +* \@twosidefalse +* \@mparswitchfalse +* \@reversemarginfalse +* (1in=72.27pt=25.4mm, 1cm=28.453pt) + + + +[1 + +{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}{/usr/share/texmf/fonts/enc/ +dvips/lm/lm-ec.enc}] +LaTeX Font Info: Trying to load font information for OT1+lmr on input line 5 +4. + (/usr/share/texmf/tex/latex/lm/ot1lmr.fd +File: ot1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern +) +LaTeX Font Info: Trying to load font information for OML+lmm on input line 5 +4. + +(/usr/share/texmf/tex/latex/lm/omllmm.fd +File: omllmm.fd 2015/05/01 v1.6.1 Font defs for Latin Modern +) +LaTeX Font Info: Trying to load font information for OMS+lmsy on input line +54. + +(/usr/share/texmf/tex/latex/lm/omslmsy.fd +File: omslmsy.fd 2015/05/01 v1.6.1 Font defs for Latin Modern +) +LaTeX Font Info: Trying to load font information for OMX+lmex on input line +54. + +(/usr/share/texmf/tex/latex/lm/omxlmex.fd +File: omxlmex.fd 2015/05/01 v1.6.1 Font defs for Latin Modern +) +LaTeX Font Info: External font `lmex10' loaded for size +(Font) <14.4> on input line 54. +LaTeX Font Info: External font `lmex10' loaded for size +(Font) <10> on input line 54. +LaTeX Font Info: External font `lmex10' loaded for size +(Font) <7> on input line 54. +LaTeX Font Info: Trying to load font information for TS1+lmr on input line 6 +2. + +(/usr/share/texmf/tex/latex/lm/ts1lmr.fd +File: ts1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern +) + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.73 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.79 \end{lstlisting} + +? + +Overfull \hbox (38.12965pt too wide) in paragraph at lines 72--81 +\T1/lmr/m/n/12 in-cus start dnsmasq-container The \T1/lmtt/m/n/12 security.sys +calls.intercept.mount\T1/lmr/m/n/12 , \T1/lmtt/m/n/12 security.nesting\T1/lmr/m +/n/12 , + [] + + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.84 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.92 \end{lstlisting} + +? + + +[2{/usr/share/texmf/fonts/enc/dvips/lm/lm-ts1.enc}] + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.99 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.101 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.105 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.110 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.114 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.116 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.120 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.123 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.128 \begin{lstlisting} + [language=python] +? +! You can't use `macro parameter character #' in vertical mode. +l.135 # + ... (rest of the link.py script as provided) ... +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.136 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.139 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.141 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.143 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.147 \end{lstlisting} + +? + + +[3] + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.160 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.163 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.169 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.171 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.173 \begin{lstlisting} + [language=yaml] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.188 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.200 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.202 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.205 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.208 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.212 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.214 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.216 \begin{lstlisting} + +? +! You can't use `macro parameter character #' in horizontal mode. +l.217 # + DNS settings +? +! You can't use `macro parameter character #' in vertical mode. +l.226 # + DHCP settings +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.230 \end{lstlisting} + +? + +Overfull \hbox (10.30048pt too wide) in paragraph at lines 226--231 +[]\T1/lmr/m/n/12 DHCP set-tings dhcp-range=192.168.1.100,192.168.1.200,12h dhcp +-option=3,192.168.1.1 + [] + + + +[4] +Overfull \hbox (25.69144pt too wide) in paragraph at lines 239--240 +[]\T1/lmtt/m/n/12 dhcp-range\T1/lmr/m/n/12 : De-fines the IP range for DHCP cli +ents (from 192.168.1.100 to 192.168.1.200, + [] + + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.245 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.248 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.250 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.252 \end{lstlisting} + +? + +! LaTeX Error: Environment lstlisting undefined. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.256 \begin{lstlisting} + [language=bash] +? + +! LaTeX Error: \begin{document} ended by \end{lstlisting}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.258 \end{lstlisting} + +? + + +[5] + +[6] (./main.aux) + *********** +LaTeX2e <2024-11-01> patch level 2 +L3 programming layer <2025-01-18> + *********** + ) +Here is how much of TeX's memory you used: + 1558 strings out of 475178 + 25442 string characters out of 5766539 + 415398 words of memory out of 5000000 + 24568 multiletter control sequences out of 15000+600000 + 595025 words of font info for 63 fonts, out of 8000000 for 9000 + 14 hyphenation exceptions out of 8191 + 57i,6n,65p,390b,220s stack positions out of 10000i,1000n,20000p,200000b,200000s + +Output written on main.pdf (6 pages, 239406 bytes). +PDF statistics: + 112 PDF objects out of 1000 (max. 8388607) + 50 compressed objects within 1 object stream + 0 named destinations out of 1000 (max. 500000) + 1 words of extra memory for PDF output out of 10000 (max. 10000000) + diff --git a/main.tex b/main.tex new file mode 100644 index 0000000..f9de0a9 --- /dev/null +++ b/main.tex @@ -0,0 +1,273 @@ +\documentclass[a4paper,12pt]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{geometry} +\geometry{margin=1in} +\usepackage{listings} +\usepackage{xcolor} +\usepackage{parskip} + +\lstset{ + basicstyle=\ttfamily\small, + breaklines=true, + frame=single, + numbers=left, + numberstyle=\tiny, + keywordstyle=\color{blue}, + commentstyle=\color{gray}, + stringstyle=\color{red} +} + +% Define YAML language for listings +\lstdefinelanguage{yaml}{ + keywords={true,false,null,yaml,network,version,ethernets,dhcp4,addresses,routes,to,via,nameservers}, + keywordstyle=\color{blue}\bfseries, + basicstyle=\ttfamily\small, + sensitive=false, + comment=[l]{\#}, + commentstyle=\color{gray}\itshape, + stringstyle=\color{red}, + morestring=[b]{"}, + morestring=[b]{'} +} + +% Define Python language for listings +\lstdefinelanguage{python}{ + keywords={def,class,import,from,as,try,except,with,return,raise,if,elif,else,for,in,while,break,continue}, + keywordstyle=\color{blue}\bfseries, + basicstyle=\ttfamily\small, + sensitive=true, + comment=[l]{\#}, + commentstyle=\color{gray}\itshape, + stringstyle=\color{red}, + morestring=[b]{"}, + morestring=[b]{'}, + identifierstyle=\color{black} +} + +\begin{document} + +\title{Basic Configuration of dnsmasq in an Incus Container on Debian with Netplan} +\author{} +\date{} +\maketitle + +\section{Introduction} +This guide provides step-by-step instructions for setting up \texttt{dnsmasq} as a DNS and DHCP server in an Incus container running Debian. The network configuration is managed using Netplan and a custom Python script to create virtual Ethernet (veth) pairs and bridges, ensuring proper network integration. + +\section{Prerequisites} +Before proceeding, ensure the following: +\begin{itemize} + \item Incus is installed on the host system (\texttt{sudo apt install incus}). + \item A Debian-based container is created in Incus. + \item Python 3 and the \texttt{pyroute2} package are installed on the host (\texttt{sudo apt install python3 python3-pyroute2}). + \item Basic knowledge of Linux networking and container management. + \item Root or sudo access to the host and container. +\end{itemize} + +\section{Step-by-Step Configuration} + +\subsection{Creating and Setting Up the Incus Container} +Create a Debian container named \texttt{dnsmasq-container} using the following commands on the host: +\begin{lstlisting}[language=bash] +incus create images:debian/12 dnsmasq-container +incus config set dnsmasq-container security.syscalls.intercept.mount true +incus config set dnsmasq-container security.nesting true +incus config set dnsmasq-container security.privileged true +incus start dnsmasq-container +\end{lstlisting} +The \texttt{security.syscalls.intercept.mount}, \texttt{security.nesting}, and \texttt{security.privileged} settings are required for \texttt{dnsmasq} and Docker to function correctly in the container. + +\subsection{Installing Additional Packages} +Install the necessary packages inside the container: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- apt update +incus exec dnsmasq-container -- apt install -y \ + netplan.io \ + sudo vim nano git tmux mc zip unzip curl wget htop lynx \ + iproute2 termshark bridge-utils \ + python3 python3-ipython python3-pyroute2 python3-scapy \ + docker.io docker-compose +\end{lstlisting} + +\subsection{Configuring Users and Permissions} +Configure user access and permissions within the container. + +\subsubsection{Changing the Root Password} +Set the root password to "passroot": +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- bash -c 'echo "root:passroot" | chpasswd' +\end{lstlisting} + +\subsubsection{Adding a New User} +Add a new user named "user" with the password "pass" and add them to the "sudo" and "docker" groups: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- useradd -m -s /bin/bash user +incus exec dnsmasq-container -- bash -c 'echo "user:pass" | chpasswd' +incus exec dnsmasq-container -- usermod -aG sudo user +incus exec dnsmasq-container -- usermod -aG docker user +\end{lstlisting} + +\subsection{Accessing the Container} +Access the container's shell: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- bash +\end{lstlisting} + +\subsection{Installing dnsmasq} +Update the package list and install \texttt{dnsmasq}: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- apt update +incus exec dnsmasq-container -- apt install dnsmasq -y +\end{lstlisting} + +\subsection{Configuring Network with Veth Pairs and Netplan} +To enable advanced networking, use the provided Python script (\texttt{link.py}) to create a virtual Ethernet (veth) pair connecting the container to the host's network namespace, with an optional bridge for network integration. Save the following script as \texttt{link.py} on the host: + +\begin{lstlisting}[language=python] +import argparse +import os +import subprocess +import sys +from pyroute2 import IPRoute, NetNS + +# ... (rest of the link.py script as provided) ... +\end{lstlisting} + +Run the script to create a veth pair, move one end to the container's network namespace, and attach it to a bridge on the host. First, identify the container's name or ID: +\begin{lstlisting}[language=bash] +incus list +\end{lstlisting} +Assuming the container name is \texttt{dnsmasq-container}, execute the script with sudo privileges: +\begin{lstlisting}[language=bash] +sudo python3 link.py --namespace1 dnsmasq-container --namespace2 1 \ + --name1 veth-container --name2 veth-host \ + --bridge2 br0 --type1 incus +\end{lstlisting} + +\textbf{Explanation:} +\begin{itemize} + \item \texttt{--namespace1 dnsmasq-container}: Specifies the container's network namespace (Incus container). + \item \texttt{--namespace2 1}: Specifies the default (host) namespace. + \item \texttt{--name1 veth-container}: Names the veth interface inside the container. + \item \texttt{--name2 veth-host}: Names the veth interface on the host. + \item \texttt{--bridge2 br0}: Attaches the host's veth interface to a bridge named \texttt{br0}. + \item \texttt{--type1 incus}: Indicates that \texttt{namespace1} is an Incus container. +\end{itemize} + +Before running the script, ensure the bridge \texttt{br0} exists on the host. Create it if necessary: +\begin{lstlisting}[language=bash] +sudo ip link add name br0 type bridge +sudo ip link set br0 up +\end{lstlisting} + +The script exposes the container's network namespace, creates the veth pair, moves \texttt{veth-container} to the container's namespace, attaches \texttt{veth-host} to \texttt{br0}, and brings both interfaces up. + +\subsection{Configuring the Network with Netplan} +Configure the container's network using Netplan to assign a static IP address to the \texttt{veth-container} interface (aliased as \texttt{eth0} for simplicity). Create or edit the Netplan configuration file at \texttt{/etc/netplan/01-netcfg.yaml} inside the container: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- nano /etc/netplan/01-netcfg.yaml +\end{lstlisting} +Add the following configuration: +\begin{lstlisting}[language=yaml] +network: + version: 2 + ethernets: + eth0: + match: + name: veth-container + dhcp4: no + addresses: + - 192.168.1.10/24 + routes: + - to: default + via: 192.168.1.1 + nameservers: + addresses: [8.8.8.8, 8.8.4.4] +\end{lstlisting} + +\textbf{Explanation:} +\begin{itemize} + \item \texttt{match: name: veth-container}: Matches the \texttt{veth-container} interface created by the script, aliased as \texttt{eth0}. + \item \texttt{dhcp4: no}: Disables DHCP to use a static IP. + \item \texttt{addresses}: Assigns the static IP \texttt{192.168.1.10/24}. + \item \texttt{routes}: Sets the default gateway to \texttt{192.168.1.1}. + \item \texttt{nameservers}: Specifies Google's DNS servers. +\end{itemize} + +Apply the configuration: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- netplan apply +\end{lstlisting} + +Verify the network configuration: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- ip a show eth0 +incus exec dnsmasq-container -- ping 8.8.8.8 +\end{lstlisting} + +\subsection{Configuring dnsmasq} +Edit the \texttt{dnsmasq} configuration file at \texttt{/etc/dnsmasq.conf}: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- nano /etc/dnsmasq.conf +\end{lstlisting} +Add or modify the following settings to enable DNS and DHCP: +\begin{lstlisting} +# DNS settings +domain-needed +bogus-priv +no-resolv +server=8.8.8.8 +server=8.8.4.4 +local=/example.local/ +domain=example.local + +# DHCP settings +dhcp-range=192.168.1.100,192.168.1.200,12h +dhcp-option=3,192.168.1.1 +dhcp-option=6,8.8.8.8,8.8.4.4 +\end{lstlisting} + +\textbf{Explanation:} +\begin{itemize} + \item \texttt{domain-needed}: Prevents incomplete domain names from being sent to upstream DNS. + \item \texttt{bogus-priv}: Blocks reverse DNS lookups for private IP ranges. + \item \texttt{no-resolv}: Disables reading \texttt{/etc/resolv.conf}. + \item \texttt{server}: Specifies upstream DNS servers (Google DNS in this case). + \item \texttt{local} and \texttt{domain}: Configures a local domain. + \item \texttt{dhcp-range}: Defines the IP range for DHCP clients (from 192.168.1.100 to 192.168.1.200, lease time 12 hours). + \item \texttt{dhcp-option}: Sets the default gateway (option 3) and DNS servers (option 6). +\end{itemize} + +\subsection{Starting and Enabling dnsmasq} +Restart and enable the \texttt{dnsmasq} service: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- systemctl restart dnsmasq +incus exec dnsmasq-container -- systemctl enable dnsmasq +\end{lstlisting} +Verify that \texttt{dnsmasq} is running: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- systemctl status dnsmasq +\end{lstlisting} + +\subsection{Testing the Configuration} +Test DNS resolution from within the container: +\begin{lstlisting}[language=bash] +incus exec dnsmasq-container -- nslookup example.local 192.168.1.10 +\end{lstlisting} +To test DHCP, connect a client device to the same network (via the \texttt{br0} bridge) and verify that it receives an IP address in the range \texttt{192.168.1.100--192.168.1.200}. + +\section{Troubleshooting} +If \texttt{dnsmasq} fails to start: +\begin{itemize} + \item Check the logs: \texttt{incus exec dnsmasq-container -- journalctl -u dnsmasq}. + \item Ensure no other service is using port 53 (DNS) or 67 (DHCP). + \item Verify the network configuration with \texttt{incus exec dnsmasq-container -- ip a} and \texttt{incus exec dnsmasq-container -- ping 8.8.8.8}. + \item Confirm the veth pair and bridge setup: \texttt{ip link show} on the host and \texttt{incus exec dnsmasq-container -- ip link show}. +\end{itemize} + +\section{Conclusion} +This guide configures \texttt{dnsmasq} as a DNS and DHCP server in an Incus container on Debian. The \texttt{link.py} script and Netplan configuration ensure a robust network setup with veth pairs and static IP addressing. For advanced configurations, refer to the \texttt{dnsmasq} documentation (\texttt{man dnsmasq}) and \texttt{pyroute2} documentation. + +\end{document}