Improve the gifconfiguration commands even better.
PR: docs/103151 Submitted by: loader <loader at freebsdmall dot com>
This commit is contained in:
parent
baf1a62ce4
commit
c3bbd98f30
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=28838
1 changed files with 17 additions and 14 deletions
|
|
@ -3422,18 +3422,20 @@ Network #2 [ Internal Hosts ]
|
|||
configured using &man.ifconfig.8;.</para>
|
||||
|
||||
<para>On the gateway machine on network #1 you would run the
|
||||
following two commands to configure the tunnel.</para>
|
||||
|
||||
<programlisting>ifconfig gif0 A.B.C.D W.X.Y.Z
|
||||
ifconfig gif0 inet 192.168.1.1 192.168.2.1 netmask 0xffffffff
|
||||
</programlisting>
|
||||
following commands to configure the tunnel.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>ifconfig <replaceable>gif0</replaceable> create</userinput>
|
||||
&prompt.root; <userinput>ifconfig tunnel <replaceable>gif0</replaceable> <replaceable>A.B.C.D</replaceable> <replaceable>W.X.Y.Z</replaceable></userinput>
|
||||
&prompt.root; <userinput>ifconfig <replaceable>gif0</replaceable> inet <replaceable>192.168.1.1</replaceable> <replaceable>192.168.2.1</replaceable> netmask <replaceable>0xffffffff</replaceable></userinput>
|
||||
</screen>
|
||||
|
||||
<para>On the other gateway machine you run the same commands,
|
||||
but with the order of the IP addresses reversed.</para>
|
||||
|
||||
<programlisting>ifconfig gif0 W.X.Y.Z A.B.C.D
|
||||
ifconfig gif0 inet 192.168.2.1 192.168.1.1 netmask 0xffffffff
|
||||
</programlisting>
|
||||
|
||||
<screen>&prompt.root; <userinput>ifconfig <replaceable>gif0</replaceable> create</userinput>
|
||||
&prompt.root; <userinput>ifconfig tunnel <replaceable>gif0</replaceable> <replaceable>W.X.Y.Z</replaceable> <replaceable>A.B.C.D</replaceable></userinput>
|
||||
&prompt.root; <userinput>ifconfig <replaceable>gif0</replaceable> inet <replaceable>192.168.2.1</replaceable> <replaceable>192.168.1.1</replaceable> netmask <replaceable>0xffffffff</replaceable></userinput>
|
||||
</screen>
|
||||
|
||||
<para>You can then run:</para>
|
||||
|
||||
|
|
@ -3443,11 +3445,11 @@ ifconfig gif0 inet 192.168.2.1 192.168.1.1 netmask 0xffffffff
|
|||
gateway, you would see this:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>ifconfig gif0</userinput>
|
||||
gif0: flags=8011<UP,POINTTOPOINT,MULTICAST> mtu 1280
|
||||
inet 192.168.1.1 --> 192.168.2.1 netmask 0xffffffff
|
||||
physical address inet A.B.C.D --> W.X.Y.Z
|
||||
gif0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280
|
||||
tunnel inet A.B.C.D --> W.X.Y.Z
|
||||
inet 192.168.1.1 --> 192.168.2.1 netmask 0xffffffff
|
||||
</screen>
|
||||
|
||||
|
||||
<para>As you can see, a tunnel has been created between the
|
||||
physical addresses <hostid role="ipaddr">A.B.C.D</hostid> and
|
||||
<hostid role="ipaddr">W.X.Y.Z</hostid>, and the traffic allowed
|
||||
|
|
@ -3565,7 +3567,8 @@ Destination Gateway Flags Refs Use Netif Expire
|
|||
<para>Edit <filename>/etc/rc.conf</filename> on gateway host
|
||||
#1 and add the following lines (replacing IP addresses as
|
||||
necessary).</para>
|
||||
<programlisting>ifconfig_gif0="tunnel A.B.C.D W.X.Y.Z"
|
||||
<programlisting>gif_interfaces="gif0"
|
||||
gifconfig_gif0="A.B.C.D W.X.Y.Z"
|
||||
ifconfig_gif0="inet 192.168.1.1 192.168.2.1 netmask 0xffffffff"
|
||||
static_routes="vpn"
|
||||
route_vpn="192.168.2.0 192.168.2.1 netmask 0xffffff00"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue