|
NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
||||
Here's a little help on IP routing.
Routes to directly connected networks are automatic, and defined by the size of the attached subnet. A simple example is shown below. In the example, traffic to a device on subnet A, such as 10.1.1.99, is routed through the NIC configured as 10.1.1.1/24, while traffic to a device on subnet B, such as 10.2.2.99, is routed through the NIC configured as 10.2.2.2/24. With /24 subnets (netmask 255.255.255.0), the first three bytes define the subnet, the last byte defines an address on the subnet. Code:
[A: 10.1.1.1/24] - [router] - [B: 10.2.2.2/24] In the simplest of Internet-connected networks, there is a single gateway router and a default route, where the destination subnet is the entire Internet -- all addresses -- defined either with "0.0.0.0/0" or "default". And the default route is usually assigned by DHCP. |
|
||||
I gave both IPs
(OpenBSD) Code:
openbsd$ ifconfig fxp0 inet alias 192.168.1.10/24 Code:
arm64$ ifconfig ure0 inet alias 192.168.1.11/24 Then I routed urtwn0(192.168.0.117) to ure0(192.168.1.11) Code:
arm64$ sudo route add -net 192.168.1.11/24 192.168.0.117 route: writing to routing socket: File exists add net 192.168.1.11: gateway 192.168.0.117: File exists Then made 192.168.1.10(fxp0) the default gateway Code:
openbsd$ sudo route add -inet default 192.168.1.10 add net default: gateway 192.168.1.10 ure0 has a new IP as well that I didn't add Code:
ure0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 capabilities=3ff00<IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx> capabilities=3ff00<UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx,TCP6CSUM_Tx> capabilities=3ff00<UDP6CSUM_Rx,UDP6CSUM_Tx> enabled=0 ec_capabilities=1<VLAN_MTU> ec_enabled=0 address: 00:e0:4c:36:36:f0 media: Ethernet autoselect (100baseTX full-duplex) status: active inet6 fe80::6be:76ed:5ad:5640%ure0/64 flags 0x0 scopeid 0x1 inet 192.168.1.11/24 broadcast 192.168.1.255 flags 0x0 inet 169.254.160.81/16 broadcast 169.254.255.255 flags 0x0 Code:
arm64$ sudo ifconfig ure0 inet delete 169.254.237.167 arm64$ ifconfig ure0 ure0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 capabilities=3ff00<IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx> capabilities=3ff00<UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx,TCP6CSUM_Tx> capabilities=3ff00<UDP6CSUM_Rx,UDP6CSUM_Tx> enabled=0 ec_capabilities=1<VLAN_MTU> ec_enabled=0 address: 00:e0:4c:36:36:f0 media: Ethernet autoselect (100baseTX full-duplex) status: active inet6 fe80::6be:76ed:5ad:5640%ure0/64 flags 0x0 scopeid 0x1 inet 169.254.166.23/16 broadcast 169.254.255.255 flags 0x1<TENTATIVE> Last edited by dnslc; 28th July 2020 at 07:10 PM. |
|
||||
Trying something new
Code:
openbsd$ sudo ifconfig fxp0 inet 10.0.0.1/24 Code:
arm64$ sudo ifconfig ure0 inet 10.0.0.2 netmask 0xffffff00 They can ping each other now. Code:
arm64$ sudo route add -inet 10.0.0.2 192.168.0.117 Code:
openbsd$ sudo route add -inet default 10.0.0.1 It looks like NetBSD is acting as a router Code:
arm64$ netstat -r Routing tables Internet: Destination Gateway Flags Refs Use Mtu Interface default 192.168.0.1 UGS - - - mue0 10.0.0/24 link#1 UC - - - ure0 [...] Code:
route can be used to modify nearly any aspect of the routing policy, except packet forwarding, which can be manipulated through the sysctl(8) command. Last edited by dnslc; 28th July 2020 at 08:45 PM. |
|
||||
Quote:
Quote:
Quote:
It may help to diagram your planned topology, such as in my first post. |
|
||||
It looks like you have partial progress, but still some mistakes. I haven't been able to follow everything (partly due to lack of time), e.g., I don't understand where mue0 came from. But I'll try to follow up on one area.
The NetBSD machine can be a router, no need for a bridge. As for OpenBSD not having internet, it looks to me like this may be (part of) the problem: Quote:
Quote:
|
|
||||
Quote:
Thanks a lot your post is helping, I am understanding a bit. Code:
openbsd$ sudo route add -inet default 10.0.0.2 I would assume that I would need to run Code:
$ sudo route add -inet 10.0.0.0 192.168.0.1 But that command does nothing, OpenBSD still can't ping 192.168.0/24 (apart from mue0/urtwn0, 192.168.0.108/192.168.0.116) |
|
||||
Please let me know if this attempt to diagram your topology is correct or incorrect. (All subnets /24):
Code:
NetBSD: {Internet} - [mue0 192.168.0.108] {Wired LAN} - [ure0 10.0.0.2] {WiFi LAN} - [urtwn0 192.168.0.117] OpenBSD: {Wired LAN} - [fxp0 10.0.0.1] If my view of your topology matches your configuration, then my recommendations are:
|
|
||||
FWIW regarding step 3: NetBSD does not appear to have a pseudo-NIC solution for wired/wireless on the same subnet. There are at least 2 different solutions, though: https://blog.netbsd.org/tnf/entry/sw...d_and_wireless
|
Tags |
ethernet, netbsd, router |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
home router + firewall behind ISP router | beiroot | OpenBSD General | 24 | 3rd April 2017 08:40 PM |
NAT router | psypro | OpenBSD General | 18 | 27th October 2016 08:29 PM |
DSL Router | Zvrk | NetBSD General | 1 | 18th June 2009 01:21 PM |
Using OpenBSD as a second router | paran0iaX | OpenBSD Security | 32 | 20th March 2009 04:51 AM |
D-link (DI-524) router | c0mrade | General software and network | 3 | 26th January 2009 08:14 AM |