-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows for a normal network interface provided that the ip range is not 192.168.1.X. Deffault is 192.168.2.X
- Loading branch information
1 parent
6de968c
commit 54bd175
Showing
3 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# Wii NIC | ||
wiiface="wlx687f747d2e59" | ||
|
||
# Normal NIC | ||
interface="eth0" | ||
ip="192.168.2.137" | ||
subnet="192.168.2.0/24" # subnet? terminology might be wrong | ||
gateway="192.168.2.1" | ||
|
||
# These are for the Wii U and gamepad. | ||
# They appear to be static but here Justin Case. | ||
WII_LOCAL_IP="192.168.1.11" | ||
WII_SUBNET="192.168.1.0/24" | ||
WII_GATEWAY="192.168.1.1" | ||
|
||
# Assign an ip to the interface. | ||
sudo ifconfig $wiiface $WII_LOCAL_IP | ||
|
||
# This creates two different routing tables, that we use based on the source-address. | ||
sudo ip rule add from $ip table 1 | ||
sudo ip rule add from $WII_LOCAL_IP table 2 | ||
|
||
# Configure the two different routing tables | ||
sudo ip route add $subnet dev $interface scope link table 1 | ||
sudo ip route add default via $gateway dev $interface table 1 | ||
|
||
sudo ip route add $WII_SUBNET dev $wiiface scope link table 2 | ||
sudo ip route add default via $WII_GATEWAY dev $wiiface table 2 | ||
|
||
# default route for the selection process of normal internet-traffic | ||
sudo ip route add default scope global nexthop via $gateway dev $interface | ||
|
||
# Setup dhcp | ||
sudo dhclient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters