Skip to content

Instantly share code, notes, and snippets.

@chan-mai
Last active April 16, 2024 10:50
Show Gist options
  • Save chan-mai/7656cedcda775d85190147f540c740f4 to your computer and use it in GitHub Desktop.
Save chan-mai/7656cedcda775d85190147f540c740f4 to your computer and use it in GitHub Desktop.
config
interfaces {
ethernet eth0 {
address 172.16.10.1/20
dhcpv6-options {
pd 1 {
interface eth1 {
}
}
}
hw-id bc:24:11:34:67:cc
vrf local-dmz
}
ethernet eth1 {
address dhcpv6
dhcpv6-options {
duid 00:03:00:01:BC:24:11:5B:3F:EA
pd 1 {
interface eth0 {
sla-id 1
}
length 56
}
}
hw-id bc:24:11:5b:3f:ea
ipv6 {
address {
autoconf
}
dup-addr-detect-transmits 1
}
}
loopback lo {
}
tunnel tun0 {
address 103.247.181.213/31
address 2403:bd80:bbc0:a304::2/64
description HomeNOC
encapsulation ip6gre
parameters {
ipv6 {
encaplimit none
}
}
remote 2405:6586:80:2a00::1111
source-address 2400:4152:6062:a400:be24:11ff:fe5b:3fea
source-interface eth1
vrf HomeNOC
}
}
protocols {
bgp {
address-family {
ipv4-unicast {
network [割当v4アドレス/prefix] {
}
}
ipv6-unicast {
network [割当v6アドレス/prefix] {
}
}
}
neighbor 103.247.181.212 {
address-family {
ipv4-unicast {
}
}
remote-as 59105
}
neighbor 2403:bd80:bbc0:a304::1 {
address-family {
ipv6-unicast {
}
}
remote-as 59105
}
system-as 65057
}
static {
route 172.16.0.0/20 {
}
}
}
service {
ntp {
allow-client {
address 0.0.0.0/0
address ::/0
}
server time1.vyos.net {
}
server time2.vyos.net {
}
server time3.vyos.net {
}
}
ssh {
}
}
system {
config-management {
commit-revisions 100
}
conntrack {
modules {
ftp
h323
nfs
pptp
sip
sqlnet
tftp
}
}
console {
device ttyS0 {
speed 115200
}
}
host-name vy-router
login {
user chan-mai {
authentication {
encrypted-password ****************
}
}
}
name-server 1.1.1.1
syslog {
global {
facility all {
level info
}
facility local7 {
level debug
}
}
}
}
vrf {
bind-to-all
name HomeNOC {
protocols {
static {
route 103.247.181.212/31 {
next-hop 103.247.181.213 {
}
}
}
}
table 200
}
name local-dmz {
protocols {
static {
route 172.16.0.0/20 {
next-hop 172.16.0.1 {
}
}
}
}
table 100
}
}
# HomeNOC側境界v4アドレスへのping
chan-mai@vy-router:~$ ping 103.247.181.212 count 5
/bin/ping: connect: Network is unreachable
# HomeNOC側境界v6アドレスへのping
chan-mai@vy-router:~$ ping 2403:bd80:bbc0:a304::1 count 5
PING 2403:bd80:bbc0:a304::1(2403:bd80:bbc0:a304::1) 56 data bytes
64 bytes from 2403:bd80:bbc0:a304::1: icmp_seq=1 ttl=51 time=44.5 ms
64 bytes from 2403:bd80:bbc0:a304::1: icmp_seq=2 ttl=51 time=43.9 ms
64 bytes from 2403:bd80:bbc0:a304::1: icmp_seq=3 ttl=51 time=43.5 ms
64 bytes from 2403:bd80:bbc0:a304::1: icmp_seq=4 ttl=51 time=43.1 ms
64 bytes from 2403:bd80:bbc0:a304::1: icmp_seq=5 ttl=51 time=43.5 ms
--- 2403:bd80:bbc0:a304::1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 43.104/43.724/44.519/0.473 ms
chan-mai@vy-router:~$ show bgp summary
IPv4 Unicast Summary (VRF default):
BGP router identifier 0.0.0.0, local AS number 65057 vrf-id 0
BGP table version 1
RIB entries 1, using 96 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
103.247.181.212 4 59105 0 0 0 0 0 never Active 0 N/A
Total number of neighbors 1
IPv6 Unicast Summary (VRF default):
BGP router identifier 0.0.0.0, local AS number 65057 vrf-id 0
BGP table version 1
RIB entries 1, using 96 bytes of memory
Peers 1, using 20 KiB of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
2403:bd80:bbc0:a304::1 4 59105 0 0 0 0 0 never Active 0 N/A
Total number of neighbors 1
chan-mai@vy-router:~$ show interfaces tunnel tun0
tun0@eth1: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1476 qdisc noqueue master HomeNOC state UNKNOWN group default qlen 1000
link/gre6 2400:4152:6062:a400:be24:11ff:fe5b:3fea peer 2405:6586:80:2a00::1111 permaddr a29f:db25:b8d8::
inet 103.247.181.213/31 scope global tun0
valid_lft forever preferred_lft forever
inet6 2403:bd80:bbc0:a304::2/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::f449:d9ff:fe9d:d503/64 scope link
valid_lft forever preferred_lft forever
Description: HomeNOC
RX: bytes packets errors dropped overrun mcast
2431161 41539 0 0 0 0
TX: bytes packets errors dropped carrier collisions
731980 11947 0 0 0 0
chan-mai@vy-router:~$ show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address MAC VRF MTU S/L Description
----------- ------------------------------------------ ----------------- --------- ----- ----- -------------
eth0 172.16.10.1/20 bc:24:11:34:67:cc local-dmz 1500 u/u
eth1 2400:4152:6062:a400:be24:11ff:fe5b:3fea/64 bc:24:11:5b:3f:ea default 1500 u/u
lo 127.0.0.1/8 00:00:00:00:00:00 default 65536 u/u
::1/128
tun0 103.247.181.213/31 n/a HomeNOC 1476 u/u HomeNOC
2403:bd80:bbc0:a304::2/64
chan-mai@vy-router:~$ show version
Version: VyOS 1.5-rolling-202404010021
Release train: current
Built by: [email protected]
Built on: Mon 01 Apr 2024 02:26 UTC
Build UUID: e16697c2-0798-49e2-b52f-06f19e79cb99
Build commit ID: ebfbdc852e8715
Architecture: x86_64
Boot via: installed image
System type: KVM guest
Hardware vendor: QEMU
Hardware model: Standard PC (i440FX + PIIX, 1996)
Hardware S/N:
Hardware UUID: 4d63e7d4-d86b-4c65-a449-6655daeb5d13
Copyright: VyOS maintainers and contributors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment